| 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 "SkColor.h" | 8 #include "SkColor.h" |
| 9 #include "SkImageFilter.h" | 9 #include "SkImageFilter.h" |
| 10 #include "SkScalar.h" | 10 #include "SkScalar.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 SkImageFilter* input = NULL, | 26 SkImageFilter* input = NULL, |
| 27 const CropRect* cropRect = NULL) { | 27 const CropRect* cropRect = NULL) { |
| 28 return SkNEW_ARGS(SkDropShadowImageFilter, (dx, dy, sigmaX, sigmaY, colo
r, | 28 return SkNEW_ARGS(SkDropShadowImageFilter, (dx, dy, sigmaX, sigmaY, colo
r, |
| 29 kDrawShadowAndForeground_Sha
dowMode, | 29 kDrawShadowAndForeground_Sha
dowMode, |
| 30 input, cropRect)); | 30 input, cropRect)); |
| 31 } | 31 } |
| 32 | 32 |
| 33 static SkDropShadowImageFilter* Create(SkScalar dx, SkScalar dy, | 33 static SkDropShadowImageFilter* Create(SkScalar dx, SkScalar dy, |
| 34 SkScalar sigmaX, SkScalar sigmaY, SkC
olor color, | 34 SkScalar sigmaX, SkScalar sigmaY, SkC
olor color, |
| 35 ShadowMode shadowMode, | 35 ShadowMode shadowMode, |
| 36 SkImageFilter* input, | 36 SkImageFilter* input = NULL, |
| 37 const CropRect* cropRect, | 37 const CropRect* cropRect = NULL) { |
| 38 uint32_t = 0) { | |
| 39 return SkNEW_ARGS(SkDropShadowImageFilter, (dx, dy, sigmaX, sigmaY, colo
r, | 38 return SkNEW_ARGS(SkDropShadowImageFilter, (dx, dy, sigmaX, sigmaY, colo
r, |
| 40 shadowMode, input, cropRect)
); | 39 shadowMode, input, cropRect)
); |
| 41 } | 40 } |
| 42 | 41 |
| 43 static SkDropShadowImageFilter* Create(SkScalar dx, SkScalar dy, | |
| 44 SkScalar sigmaX, SkScalar sigmaY, SkC
olor color, | |
| 45 ShadowMode shadowMode) { | |
| 46 return SkNEW_ARGS(SkDropShadowImageFilter, (dx, dy, sigmaX, sigmaY, colo
r, | |
| 47 shadowMode, NULL, NULL)); | |
| 48 } | |
| 49 | |
| 50 void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE; | 42 void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE; |
| 51 SK_TO_STRING_OVERRIDE() | 43 SK_TO_STRING_OVERRIDE() |
| 52 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDropShadowImageFilter) | 44 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDropShadowImageFilter) |
| 53 | 45 |
| 54 protected: | 46 protected: |
| 55 SkDropShadowImageFilter(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar
sigmaY, SkColor, | 47 SkDropShadowImageFilter(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar
sigmaY, SkColor, |
| 56 ShadowMode shadowMode, SkImageFilter* input, const C
ropRect* cropRect); | 48 ShadowMode shadowMode, SkImageFilter* input, const C
ropRect* cropRect); |
| 57 void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 49 void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
| 58 bool onFilterImage(Proxy*, const SkBitmap& source, const Context&, SkBitmap*
result, SkIPoint* loc) const SK_OVERRIDE; | 50 bool onFilterImage(Proxy*, const SkBitmap& source, const Context&, SkBitmap*
result, SkIPoint* loc) const SK_OVERRIDE; |
| 59 virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&, | 51 virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&, |
| 60 SkIRect* dst) const SK_OVERRIDE; | 52 SkIRect* dst) const SK_OVERRIDE; |
| 61 | 53 |
| 62 private: | 54 private: |
| 63 SkScalar fDx, fDy, fSigmaX, fSigmaY; | 55 SkScalar fDx, fDy, fSigmaX, fSigmaY; |
| 64 SkColor fColor; | 56 SkColor fColor; |
| 65 ShadowMode fShadowMode; | 57 ShadowMode fShadowMode; |
| 66 typedef SkImageFilter INHERITED; | 58 typedef SkImageFilter INHERITED; |
| 67 }; | 59 }; |
| OLD | NEW |