aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLGpu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl/GrGLGpu.cpp')
-rw-r--r--src/gpu/gl/GrGLGpu.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 908d367fcd..d957eb3c8a 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -1353,6 +1353,7 @@ bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc,
fGLContext->caps()->markConfigAsValidColorAttachment(desc.fConfig);
}
+ this->didBindFramebuffer();
return true;
FAILED:
@@ -2475,6 +2476,7 @@ void GrGLGpu::flushRenderTargetNoColorWrites(GrGLRenderTarget* target, bool disa
if (fHWBoundRenderTargetUniqueID != rtID) {
fStats.incRenderTargetBinds();
GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, target->renderFBOID()));
+ this->didBindFramebuffer();
#ifdef SK_DEBUG
// don't do this check in Chromium -- this is causing
// lots of repeated command buffer flushes when the compositor is
@@ -3379,6 +3381,7 @@ void GrGLGpu::bindSurfaceFBOForPixelOps(GrSurface* surface, GrGLenum fboTarget,
GR_GL_CALL(this->glInterface(), BindFramebuffer(fboTarget, rt->renderFBOID()));
*viewport = rt->getViewport();
}
+ this->didBindFramebuffer();
}
void GrGLGpu::unbindTextureFBOForPixelOps(GrGLenum fboTarget, GrSurface* surface) {
@@ -3394,6 +3397,19 @@ void GrGLGpu::unbindTextureFBOForPixelOps(GrGLenum fboTarget, GrSurface* surface
}
}
+void GrGLGpu::didBindFramebuffer() {
+ if (!this->caps()->workarounds().restore_scissor_on_fbo_change) {
+ return;
+ }
+
+ // The driver forgets the correct scissor when modifying the FBO binding.
+ fHWScissorSettings.fRect.pushToGLScissor(this->glInterface());
+
+ // crbug.com/222018 - Also on QualComm, the flush here avoids flicker,
+ // it's unclear how this bug works.
+ GL_CALL(Flush());
+}
+
bool GrGLGpu::onCopySurface(GrSurface* dst, GrSurfaceOrigin dstOrigin,
GrSurface* src, GrSurfaceOrigin srcOrigin,
const SkIRect& srcRect, const SkIPoint& dstPoint,