| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |