OSDN Git Service

display states can't share the dirty flags
authorMathias Agopian <mathias@google.com>
Fri, 17 Aug 2012 03:57:39 +0000 (20:57 -0700)
committerMathias Agopian <mathias@google.com>
Fri, 17 Aug 2012 03:58:57 +0000 (20:58 -0700)
Change-Id: Ifade9f2f1a0df9a36aede77a6cf5eee4be534f98

include/private/gui/LayerState.h
libs/gui/SurfaceComposerClient.cpp
services/surfaceflinger/SurfaceFlinger.cpp

index 9765e28..65d9eb3 100644 (file)
@@ -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;
index db86d4a..1e6e1bd 100644 (file)
@@ -326,7 +326,7 @@ void Composer::setDisplayOrientation(const sp<IBinder>& 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<IBinder>& 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<IBinder>& token,
@@ -351,7 +351,7 @@ void Composer::setDisplayFrame(const sp<IBinder>& token,
     Mutex::Autolock _l(mLock);
     DisplayState& s(getDisplayStateLocked(token));
     s.frame = frame;
-    s.what |= DisplayState::eTransformChanged;
+    s.what |= DisplayState::eFrameChanged;
 }
 
 // ---------------------------------------------------------------------------
index 06d9d40..70d6ddb 100644 (file)
@@ -142,7 +142,7 @@ void SurfaceFlinger::binderDied(const wp<IBinder>& who)
     Vector<ComposerState> state;
     Vector<DisplayState> 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;