diff options
author | Mathias Agopian <mathias@google.com> | 2011-09-02 15:31:20 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-09-02 15:31:20 -0700 |
commit | f743338c1ed6d84c1feea9888ee19755be0ba9f6 (patch) | |
tree | 6ca05b175fd1cee426ef0cd3cec177a73f968d69 | |
parent | d6ede109841f95dc6b1a6d463ae1aab63ab47ac7 (diff) | |
parent | 7f97258ab379b3bcf14846c4eb65022d2b39f390 (diff) | |
download | frameworks_base-f743338c1ed6d84c1feea9888ee19755be0ba9f6.zip frameworks_base-f743338c1ed6d84c1feea9888ee19755be0ba9f6.tar.gz frameworks_base-f743338c1ed6d84c1feea9888ee19755be0ba9f6.tar.bz2 |
Merge "fix a bug that caused the off animation to not show sometimes"
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWComposer.cpp | 17 | ||||
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWComposer.h | 3 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 6 |
3 files changed, 24 insertions, 2 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index 7d1bdf0..0ff1cce 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -108,8 +108,21 @@ status_t HWComposer::commit() const { } status_t HWComposer::release() const { - int err = mHwc->set(mHwc, NULL, NULL, NULL); - return (status_t)err; + if (mHwc) { + int err = mHwc->set(mHwc, NULL, NULL, NULL); + return (status_t)err; + } + return NO_ERROR; +} + +status_t HWComposer::disable() { + if (mHwc) { + free(mList); + mList = NULL; + int err = mHwc->prepare(mHwc, NULL); + return (status_t)err; + } + return NO_ERROR; } size_t HWComposer::getNumLayers() const { diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.h b/services/surfaceflinger/DisplayHardware/HWComposer.h index 983898a..77c1a4b 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.h +++ b/services/surfaceflinger/DisplayHardware/HWComposer.h @@ -50,6 +50,9 @@ public: // Asks the HAL what it can do status_t prepare() const; + // disable hwc until next createWorkList + status_t disable(); + // commits the list status_t commit() const; diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index b4c5dec..4a3a8ea 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -2113,6 +2113,12 @@ status_t SurfaceFlinger::turnElectronBeamOffImplLocked(int32_t mode) // we're already off return NO_ERROR; } + + // turn off hwc while we're doing the animation + hw.getHwComposer().disable(); + // and make sure to turn it back on (if needed) next time we compose + invalidateHwcGeometry(); + if (mode & ISurfaceComposer::eElectronBeamAnimationOff) { electronBeamOffAnimationImplLocked(); } |