Turn on GPU AA clipping
https://codereview.appspot.com/6638048/
git-svn-id: http://skia.googlecode.com/svn/trunk@5909 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index 5f1f0e3..322fba1 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -20,8 +20,8 @@
GR_DEFINE_RESOURCE_CACHE_DOMAIN(GrClipMaskManager, GetAlphaMaskDomain)
-//#define GR_AA_CLIP 1
-//#define GR_SW_CLIP 1
+#define GR_AA_CLIP 1
+#define GR_SW_CLIP 1
////////////////////////////////////////////////////////////////////////////////
namespace {
@@ -565,9 +565,7 @@
// TODO: make sure we don't outset if bounds are still 0,0 @ min
- if (fAACache.canReuse(*clipDataIn.fClipStack,
- devResultBounds->width(),
- devResultBounds->height())) {
+ if (fAACache.canReuse(*clipDataIn.fClipStack, *devResultBounds)) {
*result = fAACache.getLastMask();
fAACache.getLastBound(devResultBounds);
return true;
@@ -1163,6 +1161,8 @@
if (SkRegion::kReverseDifference_Op == op) {
SkRect temp;
temp.set(*devResultBounds);
+ temp.offset(SkIntToScalar(clipDataIn.fOrigin.fX),
+ SkIntToScalar(clipDataIn.fOrigin.fX));
// invert the entire scene
helper.draw(temp, SkRegion::kXOR_Op, false, 0xFF);