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

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

Issue 2349373004: Create special surfaces according to original device (not always in N32) (Closed)
Patch Set: Remove copy-pasted default parameter, expand comment 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 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
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
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