From 05cec9d1275fd939c2d1aec235dca2bdb8edef63 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 23 May 2012 14:35:49 -0700 Subject: 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 --- services/surfaceflinger/LayerBase.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'services/surfaceflinger/LayerBase.cpp') diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp index 7c6a28afb7..16bac8f79c 100644 --- a/services/surfaceflinger/LayerBase.cpp +++ b/services/surfaceflinger/LayerBase.cpp @@ -201,12 +201,14 @@ uint32_t LayerBase::doTransaction(uint32_t flags) const Layer::State& front(drawingState()); const Layer::State& temp(currentState()); - if (front.requested != temp.requested) { - // geometry of the layer has changed, set the active geometry - // to the requested geometry. + // always set active to requested, unless we're asked not to + // this is used by Layer, which special cases resizes. + if (flags & eDontUpdateGeometryState) { + } else { Layer::State& editTemp(currentState()); editTemp.active = temp.requested; } + if (front.active != temp.active) { // invalidate and recompute the visible regions if needed flags |= Layer::eVisibleRegion; -- cgit v1.2.3-59-g8ed1b