Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(941)

Unified Diff: src/effects/SkMatrixImageFilter.cpp

Issue 789163006: Add toString methods to SkImageFilter-derived classes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make sure leading 0's aren't stripped off colors Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkMatrixImageFilter.cpp
diff --git a/src/effects/SkMatrixImageFilter.cpp b/src/effects/SkMatrixImageFilter.cpp
index f2c403f443aa450e64ec75108f390bf1b4a8cabe..4d9b1fa33517130f083500a31092c9125d88424d 100644
--- a/src/effects/SkMatrixImageFilter.cpp
+++ b/src/effects/SkMatrixImageFilter.cpp
@@ -124,3 +124,27 @@ bool SkMatrixImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm
*dst = bounds;
return true;
}
+
+#ifndef SK_IGNORE_TO_STRING
+void SkMatrixImageFilter::toString(SkString* str) const {
+ str->appendf("SkMatrixImageFilter: (");
+
+ str->appendf("transform: (%f %f %f %f %f %f %f %f %f)",
+ fTransform[SkMatrix::kMScaleX],
+ fTransform[SkMatrix::kMSkewX],
+ fTransform[SkMatrix::kMTransX],
+ fTransform[SkMatrix::kMSkewY],
+ fTransform[SkMatrix::kMScaleY],
+ fTransform[SkMatrix::kMTransY],
+ fTransform[SkMatrix::kMPersp0],
+ fTransform[SkMatrix::kMPersp1],
+ fTransform[SkMatrix::kMPersp2]);
+
+ str->append("<dt>FilterLevel:</dt><dd>");
+ static const char* gFilterLevelStrings[] = { "None", "Low", "Medium", "High" };
+ str->append(gFilterLevelStrings[fFilterLevel]);
+ str->append("</dd>");
+
+ str->appendf(")");
+}
+#endif
« no previous file with comments | « src/effects/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698