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

Side by Side Diff: src/effects/SkMergeImageFilter.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, 2 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/SkImageSource.cpp ('k') | src/effects/SkOffsetImageFilter.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 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
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 "SkMergeImageFilter.h" 8 #include "SkMergeImageFilter.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // filter does not affect transparent black. 106 // filter does not affect transparent black.
107 bool embiggen = false; 107 bool embiggen = false;
108 this->getCropRect().applyTo(bounds, ctx.ctm(), embiggen, &bounds); 108 this->getCropRect().applyTo(bounds, ctx.ctm(), embiggen, &bounds);
109 if (!bounds.intersect(ctx.clipBounds())) { 109 if (!bounds.intersect(ctx.clipBounds())) {
110 return nullptr; 110 return nullptr;
111 } 111 }
112 112
113 const int x0 = bounds.left(); 113 const int x0 = bounds.left();
114 const int y0 = bounds.top(); 114 const int y0 = bounds.top();
115 115
116 SkImageInfo info = SkImageInfo::MakeN32(bounds.width(), bounds.height(), 116 sk_sp<SkSpecialSurface> surf(source->makeSurface(ctx.outputProperties(), bou nds.size()));
117 kPremul_SkAlphaType);
118
119 sk_sp<SkSpecialSurface> surf(source->makeSurface(info));
120 if (!surf) { 117 if (!surf) {
121 return nullptr; 118 return nullptr;
122 } 119 }
123 120
124 SkCanvas* canvas = surf->getCanvas(); 121 SkCanvas* canvas = surf->getCanvas();
125 SkASSERT(canvas); 122 SkASSERT(canvas);
126 123
127 canvas->clear(0x0); 124 canvas->clear(0x0);
128 125
129 // Composite all of the filter inputs. 126 // Composite all of the filter inputs.
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 for (int i = 0; i < this->countInputs(); ++i) { 185 for (int i = 0; i < this->countInputs(); ++i) {
189 SkImageFilter* filter = this->getInput(i); 186 SkImageFilter* filter = this->getInput(i);
190 str->appendf("%d: (", i); 187 str->appendf("%d: (", i);
191 filter->toString(str); 188 filter->toString(str);
192 str->appendf(")"); 189 str->appendf(")");
193 } 190 }
194 191
195 str->append(")"); 192 str->append(")");
196 } 193 }
197 #endif 194 #endif
OLDNEW
« no previous file with comments | « src/effects/SkImageSource.cpp ('k') | src/effects/SkOffsetImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698