diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-18 17:53:38 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-18 17:53:38 +0000 |
commit | 0bd80fa01bba2b3f0f49937fcb17928c74bde5a6 (patch) | |
tree | f22c8c5a92625ce558f350fb36682101af21211c /samplecode/SampleText.cpp | |
parent | cd9caa8017fbcb5538011013d6eba17a22fe6fc0 (diff) |
Added toString to SkMaskFilter-derived classes
https://codereview.appspot.com/7889043/
git-svn-id: http://skia.googlecode.com/svn/trunk@8194 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleText.cpp')
-rw-r--r-- | samplecode/SampleText.cpp | 22 |
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); } |