summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2015-06-25 17:15:16 -0700
committerChris Craik <ccraik@google.com>2015-06-25 17:15:17 -0700
commitb60d3e7856f74c72898b2cba553db0d2e2d1365d (patch)
treee774f13f701dbfff2f966279712bc23332191434 /libs/hwui
parentbcca4ac4fb4fa66f2e4196437998c08e4dbed1d3 (diff)
downloadframeworks_base-b60d3e7856f74c72898b2cba553db0d2e2d1365d.zip
frameworks_base-b60d3e7856f74c72898b2cba553db0d2e2d1365d.tar.gz
frameworks_base-b60d3e7856f74c72898b2cba553db0d2e2d1365d.tar.bz2
Don't promote functors onto layers due to outline rect clipping
bug:21320333 Change-Id: Ie70982c88498395148dab6eaca861de66e6207ed
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/Outline.h6
-rw-r--r--libs/hwui/RenderProperties.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/libs/hwui/Outline.h b/libs/hwui/Outline.h
index 5e9b213..c98932c 100644
--- a/libs/hwui/Outline.h
+++ b/libs/hwui/Outline.h
@@ -19,6 +19,7 @@
#include <SkPath.h>
#include "Rect.h"
+#include "utils/MathUtils.h"
namespace android {
namespace uirenderer {
@@ -85,6 +86,11 @@ public:
return mShouldClip && (mType == kOutlineType_RoundRect);
}
+ bool willRoundRectClip() const {
+ // only round rect outlines can be used for clipping
+ return willClip() && MathUtils::isPositive(mRadius);
+ }
+
bool getAsRoundRect(Rect* outRect, float* outRadius) const {
if (mType == kOutlineType_RoundRect) {
outRect->set(mBounds);
diff --git a/libs/hwui/RenderProperties.h b/libs/hwui/RenderProperties.h
index 81cf2df..11abd70 100644
--- a/libs/hwui/RenderProperties.h
+++ b/libs/hwui/RenderProperties.h
@@ -169,7 +169,7 @@ public:
bool functorsNeedLayer = ancestorDictatesFunctorsNeedLayer
// Round rect clipping forces layer for functors
- || CC_UNLIKELY(getOutline().willClip())
+ || CC_UNLIKELY(getOutline().willRoundRectClip())
|| CC_UNLIKELY(getRevealClip().willClip())
// Complex matrices forces layer, due to stencil clipping