diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-11-26 20:26:54 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-11-26 20:26:54 +0000 |
commit | 971aca75572ed6e0c5e1cc959173dc58ca7b6b8d (patch) | |
tree | ee8ee93c54512b7815268442bd8faa301b274cbf /samplecode | |
parent | db3f0fda6899b11e3213c1213165f2d22ad0fb83 (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 'samplecode')
-rw-r--r-- | samplecode/SampleApp.cpp | 3 | ||||
-rw-r--r-- | samplecode/SampleLayers.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index c94a772edf..0943d774f0 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -491,7 +491,7 @@ public: SkOSMenu::TriState hinting) : fLCDState(lcd), fAAState(aa), fFilterState(filter), fHintingState(hinting) {} - virtual void filter(SkPaint* paint, Type t) { + virtual bool filter(SkPaint* paint, Type t) { if (kText_Type == t && SkOSMenu::kMixedState != fLCDState) { paint->setLCDRenderText(SkOSMenu::kOnState == fLCDState); } @@ -506,6 +506,7 @@ public: SkPaint::kNormal_Hinting : SkPaint::kSlight_Hinting); } + return true; } private: diff --git a/samplecode/SampleLayers.cpp b/samplecode/SampleLayers.cpp index 6d57c2a59e..cf6b0090f4 100644 --- a/samplecode/SampleLayers.cpp +++ b/samplecode/SampleLayers.cpp @@ -125,11 +125,12 @@ static void test_fade(SkCanvas* canvas) { class RedFilter : public SkDrawFilter { public: - virtual void filter(SkPaint* p, SkDrawFilter::Type) SK_OVERRIDE { + virtual bool filter(SkPaint* p, SkDrawFilter::Type) SK_OVERRIDE { fColor = p->getColor(); if (fColor == SK_ColorRED) { p->setColor(SK_ColorGREEN); } + return true; } private: |