am 5805765d: am f8d25ea8: Merge "Don\'t promote functors onto layers due to outline rect clipping" into mnc-dev

* commit '5805765d6e3e00e367ef4e2b0a096c72d511ed45':
  Don't promote functors onto layers due to outline rect clipping
This commit is contained in:
Chris Craik
2015-06-26 20:50:29 +00:00
committed by Android Git Automerger
2 changed files with 7 additions and 1 deletions

View File

@@ -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);

View File

@@ -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