Avoid blurring and rounded corners without EGL_EXT_protected_content
If the GPU does not support protected content, avoid forcing client
composition for protected layers. This means removing rounded corners.
It also means avoiding blurring when it would require blurring a layer
with protected content.
Bug: 196271643
Test: manual (Netflix, YouTube, ExoDefault) with modified
RenderEngine::supportsProtectedContent()
Change-Id: I9763eb22884e611568b36b2e221ee6d75ec3363e
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 83d8d9f..6c93113 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -2110,6 +2110,13 @@
}
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();