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); |