aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-07-11 11:17:47 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-11 15:41:22 +0000
commitf02fa6ffe72c596b87e277193ed82d288dbee18f (patch)
treed1f3cb8149c09154f736494b229496ac6795b176 /src/gpu/gl
parent9530f7ebf529acce1d6e99fa40032bbf13826a03 (diff)
Ensure FB sRGB conversion is on during copy-as-draw
A recent change up-stack tickled the cross context image test, exposing this bug. I have no idea how it didn't manifest sooner. In that test, we're takng a subset of a lazy image, which implements onGenerateTexture via a surface copy. In this case, we were in legacy mode, but the textures were all created with sRGB configs. In normal drawing, we disable sRGB decode. For the copy draw, we were explicitly enabling sRGB decode, but not setting the FB setting, so if it was still off (it was), the image would get decoded but not re-encoded, coming out too dark. Bug: skia: Change-Id: I4a480b11315cc308ea016b7082aff17920764214 Reviewed-on: https://skia-review.googlesource.com/22211 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/gl')
-rw-r--r--src/gpu/gl/GrGLGpu.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index bcc74af29a..e7c59fa34a 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -3886,6 +3886,9 @@ bool GrGLGpu::copySurfaceAsDraw(GrSurface* dst,
this->disableScissor();
this->disableWindowRectangles();
this->disableStencil();
+ if (this->glCaps().srgbWriteControl()) {
+ this->flushFramebufferSRGB(true);
+ }
GL_CALL(DrawArrays(GR_GL_TRIANGLE_STRIP, 0, 4));
this->unbindTextureFBOForPixelOps(GR_GL_FRAMEBUFFER, dst);