diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 39520189d7..4660cdaf53 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -2815,7 +2815,11 @@ int GrGLCaps::maxRenderTargetSampleCount(GrPixelConfig config) const { if (!table.count()) { return 0; } - return table[table.count() - 1]; + int count = table[table.count() - 1]; + if (fDriverBugWorkarounds.max_msaa_sample_count_4) { + count = SkTMin(count, 4); + } + return count; } bool validate_sized_format(GrGLenum format, SkColorType ct, GrPixelConfig* config, diff --git a/src/gpu/gl/GrGLCreateNullInterface.cpp b/src/gpu/gl/GrGLCreateNullInterface.cpp index 3b8b1fec04..9df22659dd 100644 --- a/src/gpu/gl/GrGLCreateNullInterface.cpp +++ b/src/gpu/gl/GrGLCreateNullInterface.cpp @@ -403,6 +403,9 @@ public: Framebuffer* framebuffer = fFramebufferManager.lookUp(id); GrAlwaysAssert(GR_GL_RENDERBUFFER == renderbuffertarget); + if (!renderBufferID && !fCurrRenderbuffer) { + return; + } GrAlwaysAssert(fCurrRenderbuffer); Renderbuffer* renderbuffer = fRenderbufferManager.lookUp(fCurrRenderbuffer); diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 1822d65274..36f7ed5c17 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -3399,7 +3399,9 @@ void GrGLGpu::bindFramebuffer(GrGLenum target, GrGLuint fboid) { } // The driver forgets the correct scissor when modifying the FBO binding. - fHWScissorSettings.fRect.pushToGLScissor(this->glInterface()); + if (!fHWScissorSettings.fRect.isInvalid()) { + fHWScissorSettings.fRect.pushToGLScissor(this->glInterface()); + } // crbug.com/222018 - Also on QualComm, the flush here avoids flicker, // it's unclear how this bug works. diff --git a/src/gpu/gl/GrGLIRect.h b/src/gpu/gl/GrGLIRect.h index a699ae36bd..eea341cda9 100644 --- a/src/gpu/gl/GrGLIRect.h +++ b/src/gpu/gl/GrGLIRect.h @@ -85,6 +85,8 @@ struct GrGLIRect { } void invalidate() {fLeft = fWidth = fBottom = fHeight = -1;} + bool isInvalid() const { return fLeft == -1 && fWidth == -1 && fBottom == -1 + && fHeight == -1; } bool operator ==(const GrGLIRect& glRect) const { return 0 == memcmp(this, &glRect, sizeof(GrGLIRect));