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

Unified Diff: src/gpu/GrContext.cpp

Issue 1954863002: Make GrGammaEffect have explicit sRGB modes, plus exponential mode. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: powf -> pow in shader code Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/effects/GrGammaEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 443494073af596a9ac0f9fee05d49be897d7478c..4235ae85524ab36d9ffc4426d0e00a3d4548aa33 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -550,12 +550,9 @@ bool GrContext::applyGamma(GrRenderTarget* dst, GrTexture* src, SkScalar gamma){
}
GrPaint paint;
- if (SkScalarNearlyEqual(gamma, 1.0f)) {
- paint.addColorTextureProcessor(src, GrCoordTransform::MakeDivByTextureWHMatrix(src));
- } else {
- SkAutoTUnref<const GrFragmentProcessor> fp;
- fp.reset(GrGammaEffect::Create(src, gamma));
- paint.addColorFragmentProcessor(fp);
+ paint.addColorTextureProcessor(src, GrCoordTransform::MakeDivByTextureWHMatrix(src));
+ if (!SkScalarNearlyEqual(gamma, 1.0f)) {
+ paint.addColorFragmentProcessor(GrGammaEffect::Create(gamma))->unref();
}
paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
paint.setGammaCorrect(true);
« no previous file with comments | « no previous file | src/gpu/effects/GrGammaEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698