Loading services/surfaceflinger/LayerBase.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -196,6 +196,12 @@ void LayerBase::setCoveredRegion(const Region& coveredRegion) { coveredRegionScreen = coveredRegion; } void LayerBase::setVisibleNonTransparentRegion(const Region& visibleNonTransparentRegion) { // always called from main thread this->visibleNonTransparentRegion = visibleNonTransparentRegion; } uint32_t LayerBase::doTransaction(uint32_t flags) { const Layer::State& front(drawingState()); Loading services/surfaceflinger/LayerBase.h +9 −1 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ public: Region visibleRegionScreen; Region transparentRegionScreen; Region coveredRegionScreen; Region visibleNonTransparentRegion; int32_t sequence; struct Geometry { Loading Loading @@ -98,7 +99,7 @@ public: bool setSize(uint32_t w, uint32_t h); bool setAlpha(uint8_t alpha); bool setMatrix(const layer_state_t::matrix22_t& matrix); bool setTransparentRegionHint(const Region& opaque); bool setTransparentRegionHint(const Region& transparent); bool setFlags(uint8_t flags, uint8_t mask); bool setCrop(const Rect& crop); Loading Loading @@ -158,6 +159,13 @@ public: */ virtual void setCoveredRegion(const Region& coveredRegion); /** * setVisibleNonTransparentRegion - called when the visible and * non-transparent region changes. */ virtual void setVisibleNonTransparentRegion(const Region& visibleNonTransparentRegion); /** * validateVisibility - cache a bunch of things */ Loading services/surfaceflinger/SurfaceFlinger.cpp +14 −2 Original line number Diff line number Diff line Loading @@ -620,6 +620,16 @@ void SurfaceFlinger::computeVisibleRegions( */ Region coveredRegion; /* * transparentRegion: area of a surface that is hinted to be completely * transparent. This is only used to tell when the layer has no visible * non-transparent regions and can be removed from the layer list. It * does not affect the visibleRegion of this layer or any layers * beneath it. The hint may not be correct if apps don't respect the * SurfaceView restrictions (which, sadly, some don't). */ Region transparentRegion; // handle hidden surfaces by setting the visible region to empty if (CC_LIKELY(!(s.flags & ISurfaceComposer::eLayerHidden) && s.alpha)) { Loading @@ -630,7 +640,7 @@ void SurfaceFlinger::computeVisibleRegions( if (!visibleRegion.isEmpty()) { // Remove the transparent area from the visible region if (translucent) { visibleRegion.subtractSelf(layer->transparentRegionScreen); transparentRegion = layer->transparentRegionScreen; } // compute the opaque region Loading Loading @@ -689,6 +699,8 @@ void SurfaceFlinger::computeVisibleRegions( // Store the visible region is screen space layer->setVisibleRegion(visibleRegion); layer->setCoveredRegion(coveredRegion); layer->setVisibleNonTransparentRegion( visibleRegion.subtract(transparentRegion)); // If a secure layer is partially visible, lock-down the screen! if (layer->isSecure() && !visibleRegion.isEmpty()) { Loading Loading @@ -740,7 +752,7 @@ void SurfaceFlinger::handlePageFlip() mVisibleLayersSortedByZ.clear(); mVisibleLayersSortedByZ.setCapacity(count); for (size_t i=0 ; i<count ; i++) { if (!currentLayers[i]->visibleRegionScreen.isEmpty()) if (!currentLayers[i]->visibleNonTransparentRegion.isEmpty()) mVisibleLayersSortedByZ.add(currentLayers[i]); } Loading Loading
services/surfaceflinger/LayerBase.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -196,6 +196,12 @@ void LayerBase::setCoveredRegion(const Region& coveredRegion) { coveredRegionScreen = coveredRegion; } void LayerBase::setVisibleNonTransparentRegion(const Region& visibleNonTransparentRegion) { // always called from main thread this->visibleNonTransparentRegion = visibleNonTransparentRegion; } uint32_t LayerBase::doTransaction(uint32_t flags) { const Layer::State& front(drawingState()); Loading
services/surfaceflinger/LayerBase.h +9 −1 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ public: Region visibleRegionScreen; Region transparentRegionScreen; Region coveredRegionScreen; Region visibleNonTransparentRegion; int32_t sequence; struct Geometry { Loading Loading @@ -98,7 +99,7 @@ public: bool setSize(uint32_t w, uint32_t h); bool setAlpha(uint8_t alpha); bool setMatrix(const layer_state_t::matrix22_t& matrix); bool setTransparentRegionHint(const Region& opaque); bool setTransparentRegionHint(const Region& transparent); bool setFlags(uint8_t flags, uint8_t mask); bool setCrop(const Rect& crop); Loading Loading @@ -158,6 +159,13 @@ public: */ virtual void setCoveredRegion(const Region& coveredRegion); /** * setVisibleNonTransparentRegion - called when the visible and * non-transparent region changes. */ virtual void setVisibleNonTransparentRegion(const Region& visibleNonTransparentRegion); /** * validateVisibility - cache a bunch of things */ Loading
services/surfaceflinger/SurfaceFlinger.cpp +14 −2 Original line number Diff line number Diff line Loading @@ -620,6 +620,16 @@ void SurfaceFlinger::computeVisibleRegions( */ Region coveredRegion; /* * transparentRegion: area of a surface that is hinted to be completely * transparent. This is only used to tell when the layer has no visible * non-transparent regions and can be removed from the layer list. It * does not affect the visibleRegion of this layer or any layers * beneath it. The hint may not be correct if apps don't respect the * SurfaceView restrictions (which, sadly, some don't). */ Region transparentRegion; // handle hidden surfaces by setting the visible region to empty if (CC_LIKELY(!(s.flags & ISurfaceComposer::eLayerHidden) && s.alpha)) { Loading @@ -630,7 +640,7 @@ void SurfaceFlinger::computeVisibleRegions( if (!visibleRegion.isEmpty()) { // Remove the transparent area from the visible region if (translucent) { visibleRegion.subtractSelf(layer->transparentRegionScreen); transparentRegion = layer->transparentRegionScreen; } // compute the opaque region Loading Loading @@ -689,6 +699,8 @@ void SurfaceFlinger::computeVisibleRegions( // Store the visible region is screen space layer->setVisibleRegion(visibleRegion); layer->setCoveredRegion(coveredRegion); layer->setVisibleNonTransparentRegion( visibleRegion.subtract(transparentRegion)); // If a secure layer is partially visible, lock-down the screen! if (layer->isSecure() && !visibleRegion.isEmpty()) { Loading Loading @@ -740,7 +752,7 @@ void SurfaceFlinger::handlePageFlip() mVisibleLayersSortedByZ.clear(); mVisibleLayersSortedByZ.setCapacity(count); for (size_t i=0 ; i<count ; i++) { if (!currentLayers[i]->visibleRegionScreen.isEmpty()) if (!currentLayers[i]->visibleNonTransparentRegion.isEmpty()) mVisibleLayersSortedByZ.add(currentLayers[i]); } Loading