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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkDropShadowImageFilter.h" 8 #include "SkDropShadowImageFilter.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 SkScalarCeilToInt(SkScalarMul(sigma.y(), SkIntToScalar(3)))); 129 SkScalarCeilToInt(SkScalarMul(sigma.y(), SkIntToScalar(3))));
130 if (fShadowMode == kDrawShadowAndForeground_ShadowMode) { 130 if (fShadowMode == kDrawShadowAndForeground_ShadowMode) {
131 bounds.join(src); 131 bounds.join(src);
132 } 132 }
133 if (getInput(0) && !getInput(0)->filterBounds(bounds, ctm, &bounds)) { 133 if (getInput(0) && !getInput(0)->filterBounds(bounds, ctm, &bounds)) {
134 return false; 134 return false;
135 } 135 }
136 *dst = bounds; 136 *dst = bounds;
137 return true; 137 return true;
138 } 138 }
139
140 #ifndef SK_IGNORE_TO_STRING
141 void SkDropShadowImageFilter::toString(SkString* str) const {
142 str->appendf("SkDropShadowImageFilter: (");
143
144 str->appendf("dX: %f ", fDx);
145 str->appendf("dY: %f ", fDy);
146 str->appendf("sigmaX: %f ", fSigmaX);
147 str->appendf("sigmaY: %f ", fSigmaY);
148
149 str->append("Color: ");
150 str->appendHex(fColor);
151
152 static const char* gModeStrings[] = {
153 "kDrawShadowAndForeground", "kDrawShadowOnly"
154 };
155
156 SK_COMPILE_ASSERT(kShadowModeCount == SK_ARRAY_COUNT(gModeStrings), enum_mis match);
157
158 str->appendf(" mode: %s", gModeStrings[fShadowMode]);
159
160 str->append(")");
161 }
162 #endif
OLDNEW
« 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