diff --git a/include/private/gui/LayerState.h b/include/private/gui/LayerState.h index 9765e2816..65d9eb3b1 100644 --- a/include/private/gui/LayerState.h +++ b/include/private/gui/LayerState.h @@ -107,9 +107,11 @@ struct DisplayState { }; enum { - eSurfaceChanged = 0x1, - eLayerStackChanged = 0x2, - eTransformChanged = 0x4 + eSurfaceChanged = 0x01, + eLayerStackChanged = 0x02, + eOrientationChanged = 0x04, + eViewportChanged = 0x08, + eFrameChanged = 0x10 }; uint32_t what; diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index db86d4a41..1e6e1bdcd 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -326,7 +326,7 @@ void Composer::setDisplayOrientation(const sp& token, Mutex::Autolock _l(mLock); DisplayState& s(getDisplayStateLocked(token)); s.orientation = orientation; - s.what |= DisplayState::eTransformChanged; + s.what |= DisplayState::eOrientationChanged; mForceSynchronous = true; // TODO: do we actually still need this? } @@ -343,7 +343,7 @@ void Composer::setDisplayViewport(const sp& token, Mutex::Autolock _l(mLock); DisplayState& s(getDisplayStateLocked(token)); s.viewport = viewport; - s.what |= DisplayState::eTransformChanged; + s.what |= DisplayState::eViewportChanged; } void Composer::setDisplayFrame(const sp& token, @@ -351,7 +351,7 @@ void Composer::setDisplayFrame(const sp& token, Mutex::Autolock _l(mLock); DisplayState& s(getDisplayStateLocked(token)); s.frame = frame; - s.what |= DisplayState::eTransformChanged; + s.what |= DisplayState::eFrameChanged; } // --------------------------------------------------------------------------- diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 06d9d4057..70d6ddb24 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -142,7 +142,7 @@ void SurfaceFlinger::binderDied(const wp& who) Vector state; Vector displays; DisplayState d; - d.what = DisplayState::eTransformChanged; + d.what = DisplayState::eOrientationChanged; d.token = mDefaultDisplays[DisplayDevice::DISPLAY_ID_MAIN]; d.orientation = DisplayState::eOrientationDefault; displays.add(d); @@ -1521,15 +1521,19 @@ uint32_t SurfaceFlinger::setDisplayStateLocked(const DisplayState& s) flags |= eDisplayTransactionNeeded; } } - if (what & DisplayState::eTransformChanged) { + if (what & DisplayState::eOrientationChanged) { if (disp.orientation != s.orientation) { disp.orientation = s.orientation; flags |= eDisplayTransactionNeeded; } + } + if (what & DisplayState::eFrameChanged) { if (disp.frame != s.frame) { disp.frame = s.frame; flags |= eDisplayTransactionNeeded; } + } + if (what & DisplayState::eViewportChanged) { if (disp.viewport != s.viewport) { disp.viewport = s.viewport; flags |= eDisplayTransactionNeeded;