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 "SkBlurImageFilter.h" | 10 #include "SkBlurImageFilter.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 return nullptr; | 70 return nullptr; |
71 } | 71 } |
72 | 72 |
73 const SkIRect inputBounds = SkIRect::MakeXYWH(inputOffset.x(), inputOffset.y
(), | 73 const SkIRect inputBounds = SkIRect::MakeXYWH(inputOffset.x(), inputOffset.y
(), |
74 input->width(), input->height(
)); | 74 input->width(), input->height(
)); |
75 SkIRect bounds; | 75 SkIRect bounds; |
76 if (!this->applyCropRect(ctx, inputBounds, &bounds)) { | 76 if (!this->applyCropRect(ctx, inputBounds, &bounds)) { |
77 return nullptr; | 77 return nullptr; |
78 } | 78 } |
79 | 79 |
80 sk_sp<SkSpecialSurface> surf(source->makeSurface(ctx.outputProperties(), bou
nds.size())); | 80 const SkImageInfo info = SkImageInfo::MakeN32(bounds.width(), bounds.height(
), |
| 81 kPremul_SkAlphaType); |
| 82 sk_sp<SkSpecialSurface> surf(source->makeSurface(info)); |
81 if (!surf) { | 83 if (!surf) { |
82 return nullptr; | 84 return nullptr; |
83 } | 85 } |
84 | 86 |
85 SkCanvas* canvas = surf->getCanvas(); | 87 SkCanvas* canvas = surf->getCanvas(); |
86 SkASSERT(canvas); | 88 SkASSERT(canvas); |
87 | 89 |
88 canvas->clear(0x0); | 90 canvas->clear(0x0); |
89 | 91 |
90 SkVector sigma = SkVector::Make(fSigmaX, fSigmaY); | 92 SkVector sigma = SkVector::Make(fSigmaX, fSigmaY); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 "kDrawShadowAndForeground", "kDrawShadowOnly" | 164 "kDrawShadowAndForeground", "kDrawShadowOnly" |
163 }; | 165 }; |
164 | 166 |
165 static_assert(kShadowModeCount == SK_ARRAY_COUNT(gModeStrings), "enum_mismat
ch"); | 167 static_assert(kShadowModeCount == SK_ARRAY_COUNT(gModeStrings), "enum_mismat
ch"); |
166 | 168 |
167 str->appendf(" mode: %s", gModeStrings[fShadowMode]); | 169 str->appendf(" mode: %s", gModeStrings[fShadowMode]); |
168 | 170 |
169 str->append(")"); | 171 str->append(")"); |
170 } | 172 } |
171 #endif | 173 #endif |
OLD | NEW |