Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Unified Diff: src/gpu/gl/GrGpuGL.cpp

Issue 23404002: Add support for ES3 MSAA. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: rebase and comments Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLInterface.cpp ('k') | src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGpuGL.cpp
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 28e41af5f040f0eeb6281bde4fb968865ea919aa..47dd1b43ac22b6db6656987df91469ae98c18638 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -789,11 +789,43 @@ bool renderbuffer_storage_msaa(GrGLContext& ctx,
created = (GR_GL_NO_ERROR == CHECK_ALLOC_ERROR(ctx.interface()));
}
if (!created) {
+#if GR_GL_IGNORE_ES3_MSAA
GL_ALLOC_CALL(ctx.interface(),
RenderbufferStorageMultisample(GR_GL_RENDERBUFFER,
sampleCount,
format,
width, height));
+#else
+ switch (ctx.info().caps()->msFBOType()) {
+ case GrGLCaps::kDesktop_ARB_MSFBOType:
+ case GrGLCaps::kDesktop_EXT_MSFBOType:
+ case GrGLCaps::kES_3_0_MSFBOType:
+ GL_ALLOC_CALL(ctx.interface(),
+ RenderbufferStorageMultisample(GR_GL_RENDERBUFFER,
+ sampleCount,
+ format,
+ width, height));
+ break;
+ case GrGLCaps::kES_Apple_MSFBOType:
+ GL_ALLOC_CALL(ctx.interface(),
+ RenderbufferStorageMultisampleES2APPLE(GR_GL_RENDERBUFFER,
+ sampleCount,
+ format,
+ width, height));
+ break;
+ case GrGLCaps::kES_EXT_MsToTexture_MSFBOType:
+ case GrGLCaps::kES_IMG_MsToTexture_MSFBOType:
+ GL_ALLOC_CALL(ctx.interface(),
+ RenderbufferStorageMultisampleES2EXT(GR_GL_RENDERBUFFER,
+ sampleCount,
+ format,
+ width, height));
+ break;
+ case GrGLCaps::kNone_MSFBOType:
+ GrCrash("Shouldn't be here if we don't support multisampled renderbuffers.");
+ break;
+ }
+#endif
created = (GR_GL_NO_ERROR == CHECK_ALLOC_ERROR(ctx.interface()));
}
return created;
@@ -2313,6 +2345,12 @@ inline bool can_blit_framebuffer(const GrSurface* dst,
if (gpu->isConfigRenderable(dst->config()) &&
gpu->isConfigRenderable(src->config()) &&
gpu->glCaps().usesMSAARenderBuffers()) {
+ // ES3 doesn't allow framebuffer blits when the src has MSAA and the configs don't match
+ // or the rects are not the same (not just the same size but have the same edges).
+ if (GrGLCaps::kES_3_0_MSFBOType == gpu->glCaps().msFBOType() &&
+ (src->desc().fSampleCnt > 0 || src->config() != dst->config())) {
+ return false;
+ }
if (NULL != wouldNeedTempFBO) {
*wouldNeedTempFBO = NULL == dst->asRenderTarget() || NULL == src->asRenderTarget();
}
« no previous file with comments | « src/gpu/gl/GrGLInterface.cpp ('k') | src/gpu/gl/android/GrGLCreateNativeInterface_android.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698