diff options
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r-- | services/surfaceflinger/Layer.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 237aaffa1f..cc7b2e7c1c 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -488,7 +488,7 @@ void Layer::prepareBasicGeometryCompositionState() { compositionState->alpha = alpha; compositionState->backgroundBlurRadius = drawingState.backgroundBlurRadius; compositionState->blurRegions = drawingState.blurRegions; - compositionState->stretchEffect = drawingState.stretchEffect; + compositionState->stretchEffect = getStretchEffect(); } void Layer::prepareGeometryCompositionState() { @@ -558,7 +558,7 @@ void Layer::preparePerFrameCompositionState() { // Force client composition for special cases known only to the front-end. if (isHdrY410() || usesRoundedCorners || drawShadows() || drawingState.blurRegions.size() > 0 || - drawingState.stretchEffect.hasEffect()) { + compositionState->stretchEffect.hasEffect()) { compositionState->forceClientComposition = true; } } @@ -1436,6 +1436,22 @@ bool Layer::setStretchEffect(const StretchEffect& effect) { return true; } +StretchEffect Layer::getStretchEffect() const { + if (mDrawingState.stretchEffect.hasEffect()) { + return mDrawingState.stretchEffect; + } + + sp<Layer> parent = getParent(); + if (parent != nullptr) { + auto effect = parent->getStretchEffect(); + if (effect.hasEffect()) { + // TODO(b/179047472): Map it? Or do we make the effect be in global space? + return effect; + } + } + return StretchEffect{}; +} + void Layer::updateTreeHasFrameRateVote() { const auto traverseTree = [&](const LayerVector::Visitor& visitor) { auto parent = getParent(); @@ -1740,6 +1756,7 @@ LayerDebugInfo Layer::getLayerDebugInfo(const DisplayDevice* display) const { info.mRefreshPending = isBufferLatched(); info.mIsOpaque = isOpaque(ds); info.mContentDirty = contentDirty; + info.mStretchEffect = getStretchEffect(); return info; } |