aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-26 20:26:54 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-26 20:26:54 +0000
commit971aca75572ed6e0c5e1cc959173dc58ca7b6b8d (patch)
treeee8ee93c54512b7815268442bd8faa301b274cbf /src
parentdb3f0fda6899b11e3213c1213165f2d22ad0fb83 (diff)
change SkDrawFilter::filter to return a bool, where false means don't-draw
Review URL: https://codereview.appspot.com/6851111 git-svn-id: http://skia.googlecode.com/svn/trunk@6551 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/core/SkCanvas.cpp5
-rw-r--r--src/effects/SkPaintFlagsDrawFilter.cpp5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index a2354d5fae..c38ed7639a 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -354,7 +354,10 @@ bool AutoDrawLooper::doNext(SkDrawFilter::Type drawType) {
return false;
}
if (fFilter) {
- fFilter->filter(paint, drawType);
+ if (!fFilter->filter(paint, drawType)) {
+ fDone = true;
+ return false;
+ }
if (NULL == fLooper) {
// no looper means we only draw once
fDone = true;
diff --git a/src/effects/SkPaintFlagsDrawFilter.cpp b/src/effects/SkPaintFlagsDrawFilter.cpp
index 1fe440208c..92d6f642f4 100644
--- a/src/effects/SkPaintFlagsDrawFilter.cpp
+++ b/src/effects/SkPaintFlagsDrawFilter.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2011 Google Inc.
*
@@ -6,7 +5,6 @@
* found in the LICENSE file.
*/
-
#include "SkPaintFlagsDrawFilter.h"
#include "SkPaint.h"
@@ -16,7 +14,8 @@ SkPaintFlagsDrawFilter::SkPaintFlagsDrawFilter(uint32_t clearFlags,
fSetFlags = SkToU16(setFlags & SkPaint::kAllFlags);
}
-void SkPaintFlagsDrawFilter::filter(SkPaint* paint, Type) {
+bool SkPaintFlagsDrawFilter::filter(SkPaint* paint, Type) {
paint->setFlags((paint->getFlags() & ~fClearFlags) | fSetFlags);
+ return true;
}