summaryrefslogtreecommitdiff
path: root/libs/hwui/RenderProperties.h
diff options
context:
space:
mode:
authorStan Iliev <stani@google.com>2018-11-06 17:35:50 -0500
committerStan Iliev <stani@google.com>2019-01-30 13:43:12 -0500
commitf09ee58eb7edf7efb0cf8e24ad763a582dac0228 (patch)
tree45ee79658df15f788f9647135a9761e5ac9fc28e /libs/hwui/RenderProperties.h
parent2444f5a5104e8bad7712db0a1087ee0aab93b957 (diff)
Put Vulkan WebViews on a HW layer if stencil clip
Put WebViews in a HW layer, if the clip is a non-rect. This CL reuses logic implemented by ag/705975. This used to be the way GL WebViews were drawn in Android M. Implement complex clip detection at recording time, which was not previously supported by the canvas. Vulkan WebViews using GL interop are already drawn in a layer, but this CL will be useful when WebView supports new Vulkan interop. Test: WebView CTS pass for Vulkan and GL Bug: 115613038 Change-Id: I9b02c6f4de8efd504a7507633f3d849004215a16
Diffstat (limited to 'libs/hwui/RenderProperties.h')
-rw-r--r--libs/hwui/RenderProperties.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/hwui/RenderProperties.h b/libs/hwui/RenderProperties.h
index ddb7e4e4ce74..e6710cc8f950 100644
--- a/libs/hwui/RenderProperties.h
+++ b/libs/hwui/RenderProperties.h
@@ -151,6 +151,7 @@ public:
// parent may have already dictated that a descendant layer is needed
bool functorsNeedLayer =
ancestorDictatesFunctorsNeedLayer
+ || CC_UNLIKELY(isClipMayBeComplex())
// Round rect clipping forces layer for functors
|| CC_UNLIKELY(getOutline().willRoundRectClip()) ||
@@ -193,6 +194,12 @@ public:
bool isProjectionReceiver() const { return mPrimitiveFields.mProjectionReceiver; }
+ bool setClipMayBeComplex(bool isClipMayBeComplex) {
+ return RP_SET(mPrimitiveFields.mClipMayBeComplex, isClipMayBeComplex);
+ }
+
+ bool isClipMayBeComplex() const { return mPrimitiveFields.mClipMayBeComplex; }
+
bool setStaticMatrix(const SkMatrix* matrix) {
delete mStaticMatrix;
if (matrix) {
@@ -563,6 +570,7 @@ private:
bool mProjectBackwards = false;
bool mProjectionReceiver = false;
bool mAllowForceDark = true;
+ bool mClipMayBeComplex = false;
Rect mClipBounds;
Outline mOutline;
RevealClip mRevealClip;