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

Side by Side Diff: src/effects/SkDropShadowImageFilter.cpp

Issue 2366723004: Revert of Create special surfaces according to original device (not always in N32) (Closed)
Patch Set: Created 4 years, 3 months 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/SkImageSource.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 "SkBlurImageFilter.h" 10 #include "SkBlurImageFilter.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkImageSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698