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

Unified Diff: src/gpu/GrContext.cpp

Issue 1964943003: Revert of Make GrGammaEffect have explicit sRGB modes, plus exponential mode. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 4235ae85524ab36d9ffc4426d0e00a3d4548aa33..443494073af596a9ac0f9fee05d49be897d7478c 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -550,9 +550,12 @@
}
GrPaint paint;
- paint.addColorTextureProcessor(src, GrCoordTransform::MakeDivByTextureWHMatrix(src));
- if (!SkScalarNearlyEqual(gamma, 1.0f)) {
- paint.addColorFragmentProcessor(GrGammaEffect::Create(gamma))->unref();
+ 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.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