Analytic rrect clip for cicular corners, radius >= 0.5
BUG=skia:2181
R=robertphillips@google.com, jvanverth@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/171413004
git-svn-id: http://skia.googlecode.com/svn/trunk@13498 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index 7ccf30f..b637bd6 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -19,6 +19,7 @@
#include "GrSWMaskHelper.h"
#include "effects/GrTextureDomain.h"
#include "effects/GrConvexPolyEffect.h"
+#include "effects/GrRRectEffect.h"
#include "SkRasterClip.h"
#include "SkStrokeRec.h"
#include "SkTLazy.h"
@@ -189,6 +190,9 @@
GrConvexPolyEffect::kFillNoAA_EdgeType;
effect.reset(GrConvexPolyEffect::Create(type, path, &offset));
}
+ } else if (isAA && SkClipStack::Element::kRRect_Type == type && !rt->isMultisampled()) {
+ const SkRRect& rrect = elements.tail()->getRRect();
+ effect.reset(GrRRectEffect::Create(rrect));
} else if (isAA && SkClipStack::Element::kRect_Type == type && !rt->isMultisampled()) {
// We only handle AA/non-MSAA rects here. Coverage effect AA isn't MSAA friendly and
// non-AA rect clips are handled by the scissor.