aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Adrienne Walker <enne@chromium.org>2018-05-21 11:05:48 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-21 18:41:39 +0000
commit3a69c7441572c7ed72520358c95dfbbddeb394ae (patch)
treef57cdf7344a2b3767870862f2a5a23ec036c7031 /src
parent6d138bf681eee54a8b4a40e5dbbd08a137ae0d93 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp6
-rw-r--r--src/gpu/gl/GrGLCreateNullInterface.cpp3
-rw-r--r--src/gpu/gl/GrGLGpu.cpp4
-rw-r--r--src/gpu/gl/GrGLIRect.h2
4 files changed, 13 insertions, 2 deletions
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));