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

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

Issue 2366723004: Revert of Create special surfaces according to original device (not always in N32) (Closed)
Patch Set: 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/SkTileImageFilter.cpp ('k') | tests/SpecialImageTest.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 The Android Open Source Project 2 * Copyright 2013 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 "SkXfermodeImageFilter.h" 8 #include "SkXfermodeImageFilter.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 #if SK_SUPPORT_GPU 89 #if SK_SUPPORT_GPU
90 if (source->isTextureBacked()) { 90 if (source->isTextureBacked()) {
91 return this->filterImageGPU(source, 91 return this->filterImageGPU(source,
92 background, backgroundOffset, 92 background, backgroundOffset,
93 foreground, foregroundOffset, 93 foreground, foregroundOffset,
94 bounds, ctx.outputProperties()); 94 bounds, ctx.outputProperties());
95 } 95 }
96 #endif 96 #endif
97 97
98 sk_sp<SkSpecialSurface> surf(source->makeSurface(ctx.outputProperties(), bou nds.size())); 98 const SkImageInfo info = SkImageInfo::MakeN32(bounds.width(), bounds.height( ),
99 kPremul_SkAlphaType);
100 sk_sp<SkSpecialSurface> surf(source->makeSurface(info));
99 if (!surf) { 101 if (!surf) {
100 return nullptr; 102 return nullptr;
101 } 103 }
102 104
103 SkCanvas* canvas = surf->getCanvas(); 105 SkCanvas* canvas = surf->getCanvas();
104 SkASSERT(canvas); 106 SkASSERT(canvas);
105 107
106 canvas->clear(0x0); // can't count on background to fully clear the backgrou nd 108 canvas->clear(0x0); // can't count on background to fully clear the backgrou nd
107 109
108 canvas->translate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top() )); 110 canvas->translate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top() ));
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top ())); 256 matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top ()));
255 drawContext->drawRect(GrNoClip(), paint, matrix, SkRect::Make(bounds)); 257 drawContext->drawRect(GrNoClip(), paint, matrix, SkRect::Make(bounds));
256 258
257 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.he ight()), 259 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.he ight()),
258 kNeedNewImageUniqueID_SpecialImage, 260 kNeedNewImageUniqueID_SpecialImage,
259 drawContext->asTexture(), 261 drawContext->asTexture(),
260 sk_ref_sp(drawContext->getColorSpace())); 262 sk_ref_sp(drawContext->getColorSpace()));
261 } 263 }
262 264
263 #endif 265 #endif
OLDNEW
« no previous file with comments | « src/effects/SkTileImageFilter.cpp ('k') | tests/SpecialImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698