diff options
Diffstat (limited to 'services/surfaceflinger/EffectLayer.cpp')
-rw-r--r-- | services/surfaceflinger/EffectLayer.cpp | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/services/surfaceflinger/EffectLayer.cpp b/services/surfaceflinger/EffectLayer.cpp index 86c6b2161c..44d4d756e0 100644 --- a/services/surfaceflinger/EffectLayer.cpp +++ b/services/surfaceflinger/EffectLayer.cpp @@ -57,16 +57,19 @@ std::vector<compositionengine::LayerFE::LayerSettings> EffectLayer::prepareClien return {}; } - // set the shadow for the layer if needed - prepareShadowClientComposition(*layerSettings, targetSettings.viewport); + std::optional<compositionengine::LayerFE::LayerSettings> shadowSettings = + prepareShadowClientComposition(*layerSettings, targetSettings.viewport, + targetSettings.dataspace); + if (shadowSettings) { + results.push_back(*shadowSettings); + } // If fill bounds are occluded or the fill color is invalid skip the fill settings. if (targetSettings.realContentIsVisible && fillsColor()) { // Set color for color fill settings. layerSettings->source.solidColor = getColor().rgb; results.push_back(*layerSettings); - } else if (hasBlur() || drawShadows()) { - layerSettings->skipContentDraw = true; + } else if (hasBlur()) { results.push_back(*layerSettings); } @@ -74,32 +77,32 @@ std::vector<compositionengine::LayerFE::LayerSettings> EffectLayer::prepareClien } bool EffectLayer::isVisible() const { - return !isHiddenByPolicy() && (getAlpha() > 0.0_hf || hasBlur()) && hasSomethingToDraw(); + return !isHiddenByPolicy() && getAlpha() > 0.0_hf && hasSomethingToDraw(); } bool EffectLayer::setColor(const half3& color) { - if (mDrawingState.color.r == color.r && mDrawingState.color.g == color.g && - mDrawingState.color.b == color.b) { + if (mCurrentState.color.r == color.r && mCurrentState.color.g == color.g && + mCurrentState.color.b == color.b) { return false; } - mDrawingState.sequence++; - mDrawingState.color.r = color.r; - mDrawingState.color.g = color.g; - mDrawingState.color.b = color.b; - mDrawingState.modified = true; + mCurrentState.sequence++; + mCurrentState.color.r = color.r; + mCurrentState.color.g = color.g; + mCurrentState.color.b = color.b; + mCurrentState.modified = true; setTransactionFlags(eTransactionNeeded); return true; } bool EffectLayer::setDataspace(ui::Dataspace dataspace) { - if (mDrawingState.dataspace == dataspace) { + if (mCurrentState.dataspace == dataspace) { return false; } - mDrawingState.sequence++; - mDrawingState.dataspace = dataspace; - mDrawingState.modified = true; + mCurrentState.sequence++; + mCurrentState.dataspace = dataspace; + mCurrentState.modified = true; setTransactionFlags(eTransactionNeeded); return true; } @@ -127,7 +130,7 @@ const compositionengine::LayerFECompositionState* EffectLayer::getCompositionSta bool EffectLayer::isOpaque(const Layer::State& s) const { // Consider the layer to be opaque if its opaque flag is set or its effective // alpha (considering the alpha of its parents as well) is 1.0; - return (s.flags & layer_state_t::eLayerOpaque) != 0 || (fillsColor() && getAlpha() == 1.0_hf); + return (s.flags & layer_state_t::eLayerOpaque) != 0 || getAlpha() == 1.0_hf; } ui::Dataspace EffectLayer::getDataSpace() const { @@ -148,7 +151,7 @@ bool EffectLayer::fillsColor() const { } bool EffectLayer::hasBlur() const { - return getBackgroundBlurRadius() > 0 || getDrawingState().blurRegions.size() > 0; + return getBackgroundBlurRadius() > 0; } } // namespace android |