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

Unified Diff: src/effects/SkMatrixConvolutionImageFilter.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/SkMagnifierImageFilter.cpp ('k') | src/effects/SkMatrixImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkMatrixConvolutionImageFilter.cpp
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index 045f6a96d58cce817489badad9c3162e01c342b6..e9dd87852f4ee406d0165e65ee7b2cd354d69bd3 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -369,3 +369,20 @@ bool SkMatrixConvolutionImageFilter::asFragmentProcessor(GrFragmentProcessor** f
return true;
}
#endif
+
+#ifndef SK_IGNORE_TO_STRING
+void SkMatrixConvolutionImageFilter::toString(SkString* str) const {
+ str->appendf("SkMatrixConvolutionImageFilter: (");
+ str->appendf("size: (%d,%d) kernel: (", fKernelSize.width(), fKernelSize.height());
+ for (int y = 0; y < fKernelSize.height(); y++) {
+ for (int x = 0; x < fKernelSize.width(); x++) {
+ str->appendf("%f ", fKernel[y * fKernelSize.width() + x]);
+ }
+ }
+ str->appendf(")");
+ str->appendf("gain: %f bias: %f ", fGain, fBias);
+ str->appendf("offset: (%d, %d) ", fKernelOffset.fX, fKernelOffset.fY);
+ str->appendf("convolveAlpha: %s", fConvolveAlpha ? "true" : "false");
+ str->append(")");
+}
+#endif
« no previous file with comments | « src/effects/SkMagnifierImageFilter.cpp ('k') | src/effects/SkMatrixImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698