diff options
author | Chris Craik <ccraik@google.com> | 2015-06-26 20:28:34 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-26 20:28:36 +0000 |
commit | f8d25ea8ebece1d13f71f3e92dac814d02a32b91 (patch) | |
tree | 43e0fddd15e7ebdf2a99f18df3f579e9f6a2119c /libs/hwui | |
parent | daee1e5bdeb6a173c042438f79663c9a84a469b8 (diff) | |
parent | b60d3e7856f74c72898b2cba553db0d2e2d1365d (diff) | |
download | frameworks_base-f8d25ea8ebece1d13f71f3e92dac814d02a32b91.zip frameworks_base-f8d25ea8ebece1d13f71f3e92dac814d02a32b91.tar.gz frameworks_base-f8d25ea8ebece1d13f71f3e92dac814d02a32b91.tar.bz2 |
Merge "Don't promote functors onto layers due to outline rect clipping" into mnc-dev
Diffstat (limited to 'libs/hwui')
-rw-r--r-- | libs/hwui/Outline.h | 6 | ||||
-rw-r--r-- | libs/hwui/RenderProperties.h | 2 |
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 |