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

Side by Side Diff: src/effects/SkMergeImageFilter.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/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 sk_sp<SkSpecialSurface> surf(source->makeSurface(ctx.outputProperties(), bou nds.size())); 116 SkImageInfo info = SkImageInfo::MakeN32(bounds.width(), bounds.height(),
117 kPremul_SkAlphaType);
118
119 sk_sp<SkSpecialSurface> surf(source->makeSurface(info));
117 if (!surf) { 120 if (!surf) {
118 return nullptr; 121 return nullptr;
119 } 122 }
120 123
121 SkCanvas* canvas = surf->getCanvas(); 124 SkCanvas* canvas = surf->getCanvas();
122 SkASSERT(canvas); 125 SkASSERT(canvas);
123 126
124 canvas->clear(0x0); 127 canvas->clear(0x0);
125 128
126 // Composite all of the filter inputs. 129 // Composite all of the filter inputs.
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 for (int i = 0; i < this->countInputs(); ++i) { 188 for (int i = 0; i < this->countInputs(); ++i) {
186 SkImageFilter* filter = this->getInput(i); 189 SkImageFilter* filter = this->getInput(i);
187 str->appendf("%d: (", i); 190 str->appendf("%d: (", i);
188 filter->toString(str); 191 filter->toString(str);
189 str->appendf(")"); 192 str->appendf(")");
190 } 193 }
191 194
192 str->append(")"); 195 str->append(")");
193 } 196 }
194 #endif 197 #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