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

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: Created 7 years, 4 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
Index: src/gpu/gl/GrGpuGL.cpp
===================================================================
--- src/gpu/gl/GrGpuGL.cpp (revision 10891)
+++ src/gpu/gl/GrGpuGL.cpp (working copy)
@@ -772,11 +772,43 @@
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;
@@ -2294,6 +2326,12 @@
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();
}

Powered by Google App Engine
This is Rietveld 408576698