[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.h b/services/surfaceflinger/Layer.h
index fcec262..5123e59 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -437,7 +437,8 @@
protected:
virtual bool prepareClientLayer(const RenderArea& renderArea, const Region& clip,
bool useIdentityTransform, Region& clearRegion,
- renderengine::LayerSettings& layer) = 0;
+ const bool supportProtectedContent,
+ renderengine::LayerSettings& layer);
public:
virtual void setDefaultBufferSize(uint32_t /*w*/, uint32_t /*h*/) {}
@@ -494,9 +495,10 @@
* false otherwise.
*/
bool prepareClientLayer(const RenderArea& renderArea, const Region& clip, Region& clearRegion,
- renderengine::LayerSettings& layer);
+ const bool supportProtectedContent, renderengine::LayerSettings& layer);
bool prepareClientLayer(const RenderArea& renderArea, bool useIdentityTransform,
- Region& clearRegion, renderengine::LayerSettings& layer);
+ Region& clearRegion, const bool supportProtectedContent,
+ renderengine::LayerSettings& layer);
/*
* doTransaction - process the transaction. This is a good place to figure