summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/surfaceflinger/CompositionEngine/src/Output.cpp8
-rw-r--r--services/surfaceflinger/FrontEnd/LayerSnapshot.cpp2
-rw-r--r--services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp2
-rw-r--r--services/surfaceflinger/Layer.cpp10
4 files changed, 17 insertions, 5 deletions
diff --git a/services/surfaceflinger/CompositionEngine/src/Output.cpp b/services/surfaceflinger/CompositionEngine/src/Output.cpp
index d4230f5575..0b11e747ca 100644
--- a/services/surfaceflinger/CompositionEngine/src/Output.cpp
+++ b/services/surfaceflinger/CompositionEngine/src/Output.cpp
@@ -895,13 +895,19 @@ void Output::writeCompositionState(const compositionengine::CompositionRefreshAr
compositionengine::OutputLayer* Output::findLayerRequestingBackgroundComposition() const {
compositionengine::OutputLayer* layerRequestingBgComposition = nullptr;
for (auto* layer : getOutputLayersOrderedByZ()) {
- auto* compState = layer->getLayerFE().getCompositionState();
+ const auto* compState = layer->getLayerFE().getCompositionState();
// If any layer has a sideband stream, we will disable blurs. In that case, we don't
// want to force client composition because of the blur.
if (compState->sidebandStream != nullptr) {
return nullptr;
}
+
+ // If RenderEngine cannot render protected content, we cannot blur.
+ if (compState->hasProtectedContent &&
+ !getCompositionEngine().getRenderEngine().supportsProtectedContent()) {
+ return nullptr;
+ }
if (compState->isOpaque) {
continue;
}
diff --git a/services/surfaceflinger/FrontEnd/LayerSnapshot.cpp b/services/surfaceflinger/FrontEnd/LayerSnapshot.cpp
index d389a799ad..8f3606667d 100644
--- a/services/surfaceflinger/FrontEnd/LayerSnapshot.cpp
+++ b/services/surfaceflinger/FrontEnd/LayerSnapshot.cpp
@@ -481,7 +481,7 @@ void LayerSnapshot::merge(const RequestedLayerState& requested, bool forceUpdate
layer_state_t::eApiChanged | layer_state_t::eShadowRadiusChanged |
layer_state_t::eBlurRegionsChanged | layer_state_t::eStretchChanged)) {
forceClientComposition = isHdrY410 || shadowSettings.length > 0 ||
- requested.blurRegions.size() > 0 || stretchEffect.hasEffect();
+ stretchEffect.hasEffect();
}
if (forceUpdate ||
diff --git a/services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp b/services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp
index 23cfe928f5..cf39187f0d 100644
--- a/services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp
+++ b/services/surfaceflinger/FrontEnd/LayerSnapshotBuilder.cpp
@@ -871,7 +871,7 @@ void LayerSnapshotBuilder::updateSnapshot(LayerSnapshot& snapshot, const Args& a
// computed snapshot properties
snapshot.forceClientComposition = snapshot.isHdrY410 || snapshot.shadowSettings.length > 0 ||
- requested.blurRegions.size() > 0 || snapshot.stretchEffect.hasEffect();
+ snapshot.stretchEffect.hasEffect();
snapshot.contentOpaque = snapshot.isContentOpaque();
snapshot.isOpaque = snapshot.contentOpaque && !snapshot.roundedCorner.hasRoundedCorners() &&
snapshot.color.a == 1.f;
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 1a0517ac0d..cfcc424622 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -659,8 +659,7 @@ void Layer::preparePerFrameCompositionState() {
// Force client composition for special cases known only to the front-end.
// Rounded corners no longer force client composition, since we may use a
// hole punch so that the layer will appear to have rounded corners.
- if (isHdrY410() || drawShadows() || drawingState.blurRegions.size() > 0 ||
- snapshot->stretchEffect.hasEffect()) {
+ if (isHdrY410() || drawShadows() || snapshot->stretchEffect.hasEffect()) {
snapshot->forceClientComposition = true;
}
// If there are no visible region changes, we still need to update blur parameters.
@@ -2111,6 +2110,13 @@ const std::vector<BlurRegion> Layer::getBlurRegions() const {
}
RoundedCornerState Layer::getRoundedCornerState() const {
+ // Today's DPUs cannot do rounded corners. If RenderEngine cannot render
+ // protected content, remove rounded corners from protected content so it
+ // can be rendered by the DPU.
+ if (isProtected() && !mFlinger->getRenderEngine().supportsProtectedContent()) {
+ return {};
+ }
+
// Get parent settings
RoundedCornerState parentSettings;
const auto& parent = mDrawingParent.promote();