aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrContext.cpp')
-rw-r--r--src/gpu/GrContext.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 2a3852ce03..92be35c78c 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -400,7 +400,8 @@ bool GrContextPriv::writeSurfacePixels(GrSurfaceContext* dst,
GrPaint paint;
paint.addColorFragmentProcessor(std::move(fp));
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
- paint.setAllowSRGBInputs(true);
+ paint.setAllowSRGBInputs(SkToBool(dst->getColorSpace()) ||
+ GrPixelConfigIsSRGB(renderTargetContext->config()));
SkRect rect = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
renderTargetContext->drawRect(GrNoClip(), std::move(paint), GrAA::kNo, matrix, rect,
nullptr);