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