Fix unit tests when workarounds are enabled

Change-Id: Ia660a6d91aa3615e0fa21fba67f5029c131b1ba2
Reviewed-on: https://skia-review.googlesource.com/128983
Commit-Queue: Adrienne Walker <enne@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This commit is contained in:
Adrienne Walker 2018-05-21 11:05:48 -07:00 committed by Skia Commit-Bot
parent 6d138bf681
commit 3a69c74415
4 changed files with 13 additions and 2 deletions

View File

@ -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,

View File

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

View File

@ -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.

View File

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