aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-12-19 13:49:15 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-19 13:49:15 -0800
commitf3f5bad7ded35265c0b5d042cc4174386b197a33 (patch)
treeb8197317dd26d7e5b65f1559446c8d39e8be1457 /gm
parent290c09b8bbd8d221d363150e2ce87158f4668df0 (diff)
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
Diffstat (limited to 'gm')
-rw-r--r--gm/imagefiltersbase.cpp16
-rw-r--r--gm/imagefiltersgraph.cpp8
2 files changed, 24 insertions, 0 deletions
diff --git a/gm/imagefiltersbase.cpp b/gm/imagefiltersbase.cpp
index 749334a61e..be8d402528 100644
--- a/gm/imagefiltersbase.cpp
+++ b/gm/imagefiltersbase.cpp
@@ -30,6 +30,7 @@ public:
return SkNEW(FailImageFilter);
}
+ SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(FailImageFilter)
protected:
@@ -51,6 +52,13 @@ SkFlattenable* FailImageFilter::CreateProc(SkReadBuffer& buffer) {
return FailImageFilter::Create();
}
+#ifndef SK_IGNORE_TO_STRING
+void FailImageFilter::toString(SkString* str) const {
+ str->appendf("FailImageFilter: (");
+ str->append(")");
+}
+#endif
+
class IdentityImageFilter : public SkImageFilter {
public:
class Registrar {
@@ -65,6 +73,7 @@ public:
return SkNEW_ARGS(IdentityImageFilter, (input));
}
+ SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(IdentityImageFilter)
protected:
IdentityImageFilter(SkImageFilter* input) : INHERITED(1, &input) {}
@@ -87,6 +96,13 @@ SkFlattenable* IdentityImageFilter::CreateProc(SkReadBuffer& buffer) {
return IdentityImageFilter::Create(common.getInput(0));
}
+#ifndef SK_IGNORE_TO_STRING
+void IdentityImageFilter::toString(SkString* str) const {
+ str->appendf("IdentityImageFilter: (");
+ str->append(")");
+}
+#endif
+
///////////////////////////////////////////////////////////////////////////////
static void draw_paint(SkCanvas* canvas, const SkRect& r, SkImageFilter* imf) {
diff --git a/gm/imagefiltersgraph.cpp b/gm/imagefiltersgraph.cpp
index 8469a43b59..ae6f4a6d1f 100644
--- a/gm/imagefiltersgraph.cpp
+++ b/gm/imagefiltersgraph.cpp
@@ -62,6 +62,7 @@ public:
return true;
}
+ SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SimpleOffsetFilter);
protected:
@@ -89,6 +90,13 @@ SkFlattenable* SimpleOffsetFilter::CreateProc(SkReadBuffer& buffer) {
return Create(dx, dy, common.getInput(0));
}
+#ifndef SK_IGNORE_TO_STRING
+void SimpleOffsetFilter::toString(SkString* str) const {
+ str->appendf("SimpleOffsetFilter: (");
+ str->append(")");
+}
+#endif
+
class ImageFiltersGraphGM : public skiagm::GM {
public:
ImageFiltersGraphGM() {}