From f3f5bad7ded35265c0b5d042cc4174386b197a33 Mon Sep 17 00:00:00 2001 From: robertphillips Date: Fri, 19 Dec 2014 13:49:15 -0800 Subject: Add toString methods to SkImageFilter-derived classes This isn't definitive but at least makes something show up in the debugger. Review URL: https://codereview.chromium.org/789163006 --- tests/ImageFilterTest.cpp | 8 ++++++++ tests/PDFPrimitivesTest.cpp | 8 ++++++++ 2 files changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp index 9fd4351b42..b67383682b 100644 --- a/tests/ImageFilterTest.cpp +++ b/tests/ImageFilterTest.cpp @@ -55,6 +55,7 @@ public: return true; } + SK_TO_STRING_OVERRIDE() SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(MatrixTestImageFilter) protected: @@ -81,6 +82,13 @@ SkFlattenable* MatrixTestImageFilter::CreateProc(SkReadBuffer& buffer) { return SkNEW_ARGS(MatrixTestImageFilter, (reporter, matrix)); } +#ifndef SK_IGNORE_TO_STRING +void MatrixTestImageFilter::toString(SkString* str) const { + str->appendf("MatrixTestImageFilter: ("); + str->append(")"); +} +#endif + static void make_small_bitmap(SkBitmap& bitmap) { bitmap.allocN32Pixels(kBitmapSize, kBitmapSize); SkCanvas canvas(bitmap); diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp index ca18b2aebf..3f539e3843 100644 --- a/tests/PDFPrimitivesTest.cpp +++ b/tests/PDFPrimitivesTest.cpp @@ -443,6 +443,7 @@ public: *result = src; return true; } + SK_TO_STRING_OVERRIDE() SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(DummyImageFilter) bool visited() const { return fVisited; } @@ -456,6 +457,13 @@ SkFlattenable* DummyImageFilter::CreateProc(SkReadBuffer& buffer) { return SkNEW_ARGS(DummyImageFilter, (visited)); } +#ifndef SK_IGNORE_TO_STRING +void DummyImageFilter::toString(SkString* str) const { + str->appendf("DummyImageFilter: ("); + str->append(")"); +} +#endif + }; // Check that PDF rendering of image filters successfully falls back to -- cgit v1.2.3