improve resize transactions
use a flag instead of pre-committing the "requested" state
to prevent propagation or "requested" to "active", which makes
things a lot clearer when reading the code.
also avoid going through the "resized" code-path when requested
size is equal to "active" size.
Bug: 6498869
Change-Id: I24f893ba0ec5ca06aac5b8da9818989ae7ce4005
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index fc7c767..722813d 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -428,8 +428,8 @@
const Layer::State& front(drawingState());
const Layer::State& temp(currentState());
- const bool sizeChanged = (front.requested.w != temp.requested.w) ||
- (front.requested.h != temp.requested.h);
+ const bool sizeChanged = (temp.requested.w != front.active.w) ||
+ (temp.requested.h != front.active.h);
if (sizeChanged) {
// the size changed, we need to ask our client to request a new buffer
@@ -472,8 +472,7 @@
if (!isFixedSize()) {
// this will make sure LayerBase::doTransaction doesn't update
// the drawing state's geometry
- Layer::State& editDraw(mDrawingState);
- editDraw.requested = temp.requested;
+ flags |= eDontUpdateGeometryState;
}
// record the new size, form this point on, when the client request