Merge change 8817 into donut
* changes: fix [2017532] Partial Update leaves residual image.
This commit is contained in:
@@ -691,9 +691,14 @@ void SurfaceFlinger::handleTransaction(uint32_t transactionFlags)
|
|||||||
|
|
||||||
// some layers might have been removed, so
|
// some layers might have been removed, so
|
||||||
// we need to update the regions they're exposing.
|
// we need to update the regions they're exposing.
|
||||||
size_t c = mRemovedLayers.size();
|
const SortedVector<LayerBase*>& removedLayers(mRemovedLayers);
|
||||||
|
size_t c = removedLayers.size();
|
||||||
if (c) {
|
if (c) {
|
||||||
mVisibleRegionsDirty = true;
|
mVisibleRegionsDirty = true;
|
||||||
|
while (c--) {
|
||||||
|
mDirtyRegionRemovedLayer.orSelf(
|
||||||
|
removedLayers[c]->visibleRegionScreen);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
|
const LayerVector& currentLayers = mCurrentState.layersSortedByZ;
|
||||||
@@ -733,17 +738,15 @@ void SurfaceFlinger::computeVisibleRegions(
|
|||||||
layer->validateVisibility(planeTransform);
|
layer->validateVisibility(planeTransform);
|
||||||
|
|
||||||
// start with the whole surface at its current location
|
// start with the whole surface at its current location
|
||||||
const Layer::State& s = layer->drawingState();
|
const Layer::State& s(layer->drawingState());
|
||||||
const Rect bounds(layer->visibleBounds());
|
|
||||||
|
|
||||||
// handle hidden surfaces by setting the visible region to empty
|
// handle hidden surfaces by setting the visible region to empty
|
||||||
Region opaqueRegion;
|
Region opaqueRegion;
|
||||||
Region visibleRegion;
|
Region visibleRegion;
|
||||||
Region coveredRegion;
|
Region coveredRegion;
|
||||||
if (UNLIKELY((s.flags & ISurfaceComposer::eLayerHidden) || !s.alpha)) {
|
if (LIKELY(!(s.flags & ISurfaceComposer::eLayerHidden) && s.alpha)) {
|
||||||
visibleRegion.clear();
|
|
||||||
} else {
|
|
||||||
const bool translucent = layer->needsBlending();
|
const bool translucent = layer->needsBlending();
|
||||||
|
const Rect bounds(layer->visibleBounds());
|
||||||
visibleRegion.set(bounds);
|
visibleRegion.set(bounds);
|
||||||
coveredRegion = visibleRegion;
|
coveredRegion = visibleRegion;
|
||||||
|
|
||||||
@@ -790,12 +793,16 @@ void SurfaceFlinger::computeVisibleRegions(
|
|||||||
layer->setVisibleRegion(visibleRegion);
|
layer->setVisibleRegion(visibleRegion);
|
||||||
layer->setCoveredRegion(coveredRegion);
|
layer->setCoveredRegion(coveredRegion);
|
||||||
|
|
||||||
// If a secure layer is partially visible, lockdown the screen!
|
// If a secure layer is partially visible, lock-down the screen!
|
||||||
if (layer->isSecure() && !visibleRegion.isEmpty()) {
|
if (layer->isSecure() && !visibleRegion.isEmpty()) {
|
||||||
secureFrameBuffer = true;
|
secureFrameBuffer = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// invalidate the areas where a layer was removed
|
||||||
|
dirtyRegion.orSelf(mDirtyRegionRemovedLayer);
|
||||||
|
mDirtyRegionRemovedLayer.clear();
|
||||||
|
|
||||||
mSecureFrameBuffer = secureFrameBuffer;
|
mSecureFrameBuffer = secureFrameBuffer;
|
||||||
opaqueRegion = aboveOpaqueLayers;
|
opaqueRegion = aboveOpaqueLayers;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -351,6 +351,7 @@ private:
|
|||||||
// Can only accessed from the main thread, these members
|
// Can only accessed from the main thread, these members
|
||||||
// don't need synchronization
|
// don't need synchronization
|
||||||
Region mDirtyRegion;
|
Region mDirtyRegion;
|
||||||
|
Region mDirtyRegionRemovedLayer;
|
||||||
Region mInvalidRegion;
|
Region mInvalidRegion;
|
||||||
Region mWormholeRegion;
|
Region mWormholeRegion;
|
||||||
Client* mLastScheduledBroadcast;
|
Client* mLastScheduledBroadcast;
|
||||||
|
|||||||
Reference in New Issue
Block a user