display states can't share the dirty flags

Change-Id: Ifade9f2f1a0df9a36aede77a6cf5eee4be534f98
This commit is contained in:
Mathias Agopian 2012-08-16 20:57:39 -07:00
parent 111b2d8922
commit 818b46058a
3 changed files with 14 additions and 8 deletions

View 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;

View 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;
}
// ---------------------------------------------------------------------------

View 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;