diff options
author | Mathias Agopian <mathias@google.com> | 2012-08-15 13:46:03 -0700 |
---|---|---|
committer | The Android Automerger <android-build@android.com> | 2012-08-15 17:44:23 -0700 |
commit | e5769db877e3ebc55195b4b53a95b51587d7b5b2 (patch) | |
tree | 428b53b0db9b56c5c79a32a5cf475a158e9a17cc | |
parent | 741fac3fee5c55583badad75ffe0e02a66affd4d (diff) | |
download | frameworks_native-e5769db877e3ebc55195b4b53a95b51587d7b5b2.zip frameworks_native-e5769db877e3ebc55195b4b53a95b51587d7b5b2.tar.gz frameworks_native-e5769db877e3ebc55195b4b53a95b51587d7b5b2.tar.bz2 |
we were mistakenly optimizing out SF's main transactions in some cases
due to a typo, SF's main transaction was conditional to having a
display transaction.
more correct fix for 6970310
Bug: 6970310
Change-Id: Iafd8c4e02afa5db829cc1c65950cfcc74754c6af
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 3a802ff..9178dfc 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -891,8 +891,7 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) * (perform the transaction for each of them if needed) */ - const bool layersNeedTransaction = transactionFlags & eTraversalNeeded; - if (layersNeedTransaction) { + if (transactionFlags & eTraversalNeeded) { for (size_t i=0 ; i<count ; i++) { const sp<LayerBase>& layer = currentLayers[i]; uint32_t trFlags = layer->getTransactionFlags(eTransactionNeeded); @@ -905,7 +904,7 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) } /* - * Perform our own transaction if needed + * Perform display own transactions if needed */ if (transactionFlags & eDisplayTransactionNeeded) { @@ -978,31 +977,35 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags) } } } + } - if (currentLayers.size() > mDrawingState.layersSortedByZ.size()) { - // layers have been added - mVisibleRegionsDirty = true; - } + /* + * Perform our own transaction if needed + */ - // some layers might have been removed, so - // we need to update the regions they're exposing. - if (mLayersRemoved) { - mLayersRemoved = false; - mVisibleRegionsDirty = true; - const LayerVector& previousLayers(mDrawingState.layersSortedByZ); - const size_t count = previousLayers.size(); - for (size_t i=0 ; i<count ; i++) { - const sp<LayerBase>& layer(previousLayers[i]); - if (currentLayers.indexOf(layer) < 0) { - // this layer is not visible anymore - // TODO: we could traverse the tree from front to back and - // compute the actual visible region - // TODO: we could cache the transformed region - Layer::State front(layer->drawingState()); - Region visibleReg = front.transform.transform( - Region(Rect(front.active.w, front.active.h))); - invalidateLayerStack(front.layerStack, visibleReg); - } + if (currentLayers.size() > mDrawingState.layersSortedByZ.size()) { + // layers have been added + mVisibleRegionsDirty = true; + } + + // some layers might have been removed, so + // we need to update the regions they're exposing. + if (mLayersRemoved) { + mLayersRemoved = false; + mVisibleRegionsDirty = true; + const LayerVector& previousLayers(mDrawingState.layersSortedByZ); + const size_t count = previousLayers.size(); + for (size_t i=0 ; i<count ; i++) { + const sp<LayerBase>& layer(previousLayers[i]); + if (currentLayers.indexOf(layer) < 0) { + // this layer is not visible anymore + // TODO: we could traverse the tree from front to back and + // compute the actual visible region + // TODO: we could cache the transformed region + Layer::State front(layer->drawingState()); + Region visibleReg = front.transform.transform( + Region(Rect(front.active.w, front.active.h))); + invalidateLayerStack(front.layerStack, visibleReg); } } } |