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

Side by Side Diff: src/effects/SkDisplacementMapEffect.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/core/SkImageFilter.cpp ('k') | src/effects/SkLightingImageFilter.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 "SkDisplacementMapEffect.h" 8 #include "SkDisplacementMapEffect.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 matrix.setTranslate(-SkIntToScalar(colorBounds.x()), -SkIntToScalar(colo rBounds.y())); 337 matrix.setTranslate(-SkIntToScalar(colorBounds.x()), -SkIntToScalar(colo rBounds.y()));
338 338
339 SkColorSpace* colorSpace = ctx.outputProperties().colorSpace(); 339 SkColorSpace* colorSpace = ctx.outputProperties().colorSpace();
340 sk_sp<GrDrawContext> drawContext( 340 sk_sp<GrDrawContext> drawContext(
341 context->makeDrawContext(SkBackingFit::kApprox, bounds.width(), boun ds.height(), 341 context->makeDrawContext(SkBackingFit::kApprox, bounds.width(), boun ds.height(),
342 GrRenderableConfigForColorSpace(colorSpace) , 342 GrRenderableConfigForColorSpace(colorSpace) ,
343 sk_ref_sp(colorSpace))); 343 sk_ref_sp(colorSpace)));
344 if (!drawContext) { 344 if (!drawContext) {
345 return nullptr; 345 return nullptr;
346 } 346 }
347 paint.setGammaCorrect(drawContext->isGammaCorrect());
347 348
348 drawContext->drawRect(GrNoClip(), paint, matrix, SkRect::Make(colorBound s)); 349 drawContext->drawRect(GrNoClip(), paint, matrix, SkRect::Make(colorBound s));
349 350
350 offset->fX = bounds.left(); 351 offset->fX = bounds.left();
351 offset->fY = bounds.top(); 352 offset->fY = bounds.top();
352 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bound s.height()), 353 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bound s.height()),
353 kNeedNewImageUniqueID_SpecialImage, 354 kNeedNewImageUniqueID_SpecialImage,
354 drawContext->asTexture(), 355 drawContext->asTexture(),
355 sk_ref_sp(drawContext->getColorSpace( ))); 356 sk_ref_sp(drawContext->getColorSpace( )));
356 } 357 }
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 void GrGLDisplacementMapEffect::GenKey(const GrProcessor& proc, 622 void GrGLDisplacementMapEffect::GenKey(const GrProcessor& proc,
622 const GrGLSLCaps&, GrProcessorKeyBuilder* b) { 623 const GrGLSLCaps&, GrProcessorKeyBuilder* b) {
623 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>(); 624 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>();
624 625
625 uint32_t xKey = displacementMap.xChannelSelector(); 626 uint32_t xKey = displacementMap.xChannelSelector();
626 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s; 627 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s;
627 628
628 b->add32(xKey | yKey); 629 b->add32(xKey | yKey);
629 } 630 }
630 #endif 631 #endif
OLDNEW
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698