From 0bd80fa01bba2b3f0f49937fcb17928c74bde5a6 Mon Sep 17 00:00:00 2001 From: "robertphillips@google.com" Date: Mon, 18 Mar 2013 17:53:38 +0000 Subject: 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 --- samplecode/SampleText.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'samplecode/SampleText.cpp') 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); } -- cgit v1.2.3