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

Unified Diff: src/effects/SkDropShadowImageFilter.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/SkDisplacementMapEffect.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkDropShadowImageFilter.cpp
diff --git a/src/effects/SkDropShadowImageFilter.cpp b/src/effects/SkDropShadowImageFilter.cpp
index 5bbb958e9cc8852e0a6281c255bef986eb95b9b8..22bee9dade72c6f75438863f08925d3567b96b49 100644
--- a/src/effects/SkDropShadowImageFilter.cpp
+++ b/src/effects/SkDropShadowImageFilter.cpp
@@ -136,3 +136,27 @@ bool SkDropShadowImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix&
*dst = bounds;
return true;
}
+
+#ifndef SK_IGNORE_TO_STRING
+void SkDropShadowImageFilter::toString(SkString* str) const {
+ str->appendf("SkDropShadowImageFilter: (");
+
+ str->appendf("dX: %f ", fDx);
+ str->appendf("dY: %f ", fDy);
+ str->appendf("sigmaX: %f ", fSigmaX);
+ str->appendf("sigmaY: %f ", fSigmaY);
+
+ str->append("Color: ");
+ str->appendHex(fColor);
+
+ static const char* gModeStrings[] = {
+ "kDrawShadowAndForeground", "kDrawShadowOnly"
+ };
+
+ SK_COMPILE_ASSERT(kShadowModeCount == SK_ARRAY_COUNT(gModeStrings), enum_mismatch);
+
+ str->appendf(" mode: %s", gModeStrings[fShadowMode]);
+
+ str->append(")");
+}
+#endif
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698