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

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

Issue 2357413004: sRGB cleanup in image filters. Ensure we configure paints correctly. (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/SkMorphologyImageFilter.cpp ('k') | no next file » | 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 243
244 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 244 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
245 245
246 sk_sp<GrDrawContext> drawContext( 246 sk_sp<GrDrawContext> drawContext(
247 context->makeDrawContext(SkBackingFit::kApprox, bounds.width(), bounds.h eight(), 247 context->makeDrawContext(SkBackingFit::kApprox, bounds.width(), bounds.h eight(),
248 GrRenderableConfigForColorSpace(outputPropertie s.colorSpace()), 248 GrRenderableConfigForColorSpace(outputPropertie s.colorSpace()),
249 sk_ref_sp(outputProperties.colorSpace()))); 249 sk_ref_sp(outputProperties.colorSpace())));
250 if (!drawContext) { 250 if (!drawContext) {
251 return nullptr; 251 return nullptr;
252 } 252 }
253 paint.setAllowSRGBInputs(drawContext->isGammaCorrect()); 253 paint.setGammaCorrect(drawContext->isGammaCorrect());
254 254
255 SkMatrix matrix; 255 SkMatrix matrix;
256 matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top ())); 256 matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top ()));
257 drawContext->drawRect(GrNoClip(), paint, matrix, SkRect::Make(bounds)); 257 drawContext->drawRect(GrNoClip(), paint, matrix, SkRect::Make(bounds));
258 258
259 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.he ight()), 259 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.he ight()),
260 kNeedNewImageUniqueID_SpecialImage, 260 kNeedNewImageUniqueID_SpecialImage,
261 drawContext->asTexture(), 261 drawContext->asTexture(),
262 sk_ref_sp(drawContext->getColorSpace())); 262 sk_ref_sp(drawContext->getColorSpace()));
263 } 263 }
264 264
265 #endif 265 #endif
OLDNEW
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698