aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleText.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-18 17:53:38 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-18 17:53:38 +0000
commit0bd80fa01bba2b3f0f49937fcb17928c74bde5a6 (patch)
treef22c8c5a92625ce558f350fb36682101af21211c /samplecode/SampleText.cpp
parentcd9caa8017fbcb5538011013d6eba17a22fe6fc0 (diff)
Added toString to SkMaskFilter-derived classes
Diffstat (limited to 'samplecode/SampleText.cpp')
-rw-r--r--samplecode/SampleText.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/samplecode/SampleText.cpp b/samplecode/SampleText.cpp
index ee447d3066..5873091836 100644
--- a/samplecode/SampleText.cpp
+++ b/samplecode/SampleText.cpp
@@ -48,10 +48,21 @@ public:
// if (c < min) c = min;
return c;
}
+
+#ifdef SK_DEVELOPER
+ virtual void toString(SkString* str) const SK_OVERRIDE {
+ str->append("ReduceNoise: (");
+ this->INHERITED::toString(str);
+ str->append(")");
+ }
+#endif
+
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(ReduceNoise)
private:
ReduceNoise(SkFlattenableReadBuffer& rb) : SkKernel33ProcMaskFilter(rb) {}
+
+ typedef SkKernel33ProcMaskFilter INHERITED;
};
class Darken : public SkKernel33ProcMaskFilter {
@@ -69,10 +80,21 @@ public:
SkASSERT(f >= 0 && f <= 1);
return (int)(f * 255);
}
+
+#ifdef SK_DEVELOPER
+ virtual void toString(SkString* str) const SK_OVERRIDE {
+ str->append("Darken: (");
+ this->INHERITED::toString(str);
+ str->append(")");
+ }
+#endif
+
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(Darken)
private:
Darken(SkFlattenableReadBuffer& rb) : SkKernel33ProcMaskFilter(rb) {}
+
+ typedef SkKernel33ProcMaskFilter INHERITED;
};
static SkMaskFilter* makemf() { return new Darken(0x30); }