aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLCaps.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-02-12 12:10:14 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-12 12:10:14 -0800
commit083617b9a7247dd4c52f8dfd195fa34a083e6f1d (patch)
tree39f3561e6b75b1129d7860ae4a214422e488d87e /src/gpu/gl/GrGLCaps.cpp
parent0a0520afccb9dcad9db2258c936456e69012fa34 (diff)
Make copySurface work in more situations.
Diffstat (limited to 'src/gpu/gl/GrGLCaps.cpp')
-rw-r--r--src/gpu/gl/GrGLCaps.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index c2ace6cd36..79bb22efac 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -54,6 +54,8 @@ GrGLCaps::GrGLCaps(const GrContextOptions& contextOptions,
fRGBA8888PixelsOpsAreSlow = false;
fPartialFBOReadIsSlow = false;
+ fBlitFramebufferSupport = kNone_BlitFramebufferSupport;
+
fShaderCaps.reset(new GrGLSLCaps(contextOptions));
this->init(contextOptions, ctxInfo, glInterface);
@@ -766,15 +768,28 @@ void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa
} else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) {
fMSFBOType = kES_Apple_MSFBOType;
}
+
+ // Above determined the preferred MSAA approach, now decide whether glBlitFramebuffer
+ // is available.
+ if (ctxInfo.version() >= GR_GL_VER(3, 0)) {
+ fBlitFramebufferSupport = kFull_BlitFramebufferSupport;
+ } else if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) {
+ // The CHROMIUM extension uses the ANGLE version of glBlitFramebuffer and includes its
+ // limitations.
+ fBlitFramebufferSupport = kNoScalingNoMirroring_BlitFramebufferSupport;
+ }
} else {
if (fUsesMixedSamples) {
fMSFBOType = kMixedSamples_MSFBOType;
+ fBlitFramebufferSupport = kFull_BlitFramebufferSupport;
} else if ((ctxInfo.version() >= GR_GL_VER(3,0)) ||
ctxInfo.hasExtension("GL_ARB_framebuffer_object")) {
fMSFBOType = GrGLCaps::kDesktop_ARB_MSFBOType;
+ fBlitFramebufferSupport = kFull_BlitFramebufferSupport;
} else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") &&
ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) {
fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType;
+ fBlitFramebufferSupport = kFull_BlitFramebufferSupport;
}
}
}