aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-12 11:33:56 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-12 11:33:56 +0000
commitba998f2ddc5a904376bfdb118976868b9ee2b6e8 (patch)
tree8408fe6e3abc48a589cc79585b1a7e69073acdac /src
parent5b6f91643d3ad1bdcdd65329d656f0fc43174be3 (diff)
Turn on GPU AA clipping
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrClipMaskCache.h5
-rw-r--r--src/gpu/GrClipMaskManager.cpp10
2 files changed, 7 insertions, 8 deletions
diff --git a/src/gpu/GrClipMaskCache.h b/src/gpu/GrClipMaskCache.h
index f1152cc6be..6722d70362 100644
--- a/src/gpu/GrClipMaskCache.h
+++ b/src/gpu/GrClipMaskCache.h
@@ -31,7 +31,7 @@ public:
}
}
- bool canReuse(const SkClipStack& clip, int width, int height) {
+ bool canReuse(const SkClipStack& clip, const GrIRect& devBounds) {
if (fStack.empty()) {
GrAssert(false);
@@ -41,8 +41,7 @@ public:
GrClipStackFrame* back = (GrClipStackFrame*) fStack.back();
if (back->fLastMask.texture() &&
- back->fLastMask.texture()->width() >= width &&
- back->fLastMask.texture()->height() >= height &&
+ back->fLastBound == devBounds &&
clip == back->fLastClip) {
return true;
}
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index 5f1f0e3899..322fba146a 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 @@ bool GrClipMaskManager::clipMaskPreamble(const GrClipData& clipDataIn,
// 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 @@ bool GrClipMaskManager::createSoftwareClipMask(const GrClipData& clipDataIn,
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);