[SurfaceFlinger] Add GPU protected content support.
Switch to protected context when a layer with protected contents presents.
Previously we black out layers with protected contents, now that we add support
of protected contents in GPU composition, we can turn it on. In screenshot
cases for Recents, we still black out layers with protected contents.
BUG: 35315015
Test: Build, flash and boot
Test: Watch Youtube movie, verifed by force GPU composition.
Change-Id: I556bdd6f82c06c3d54ce62fab06a8c6f47599dcf
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index b7aa5a5..4ac7a90 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -683,18 +683,21 @@
// ---------------------------------------------------------------------------
bool Layer::prepareClientLayer(const RenderArea& renderArea, const Region& clip,
- Region& clearRegion, renderengine::LayerSettings& layer) {
- return prepareClientLayer(renderArea, clip, false, clearRegion, layer);
+ Region& clearRegion, const bool supportProtectedContent,
+ renderengine::LayerSettings& layer) {
+ return prepareClientLayer(renderArea, clip, false, clearRegion, supportProtectedContent, layer);
}
bool Layer::prepareClientLayer(const RenderArea& renderArea, bool useIdentityTransform,
- Region& clearRegion, renderengine::LayerSettings& layer) {
+ Region& clearRegion, const bool supportProtectedContent,
+ renderengine::LayerSettings& layer) {
return prepareClientLayer(renderArea, Region(renderArea.getBounds()), useIdentityTransform,
- clearRegion, layer);
+ clearRegion, supportProtectedContent, layer);
}
bool Layer::prepareClientLayer(const RenderArea& /*renderArea*/, const Region& /*clip*/,
bool useIdentityTransform, Region& /*clearRegion*/,
+ const bool /*supportProtectedContent*/,
renderengine::LayerSettings& layer) {
FloatRect bounds = getBounds();
half alpha = getAlpha();