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

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

Issue 14048015: Skip copytexsubimage2D code path when src is multisampled. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGpuGL.cpp
===================================================================
--- src/gpu/gl/GrGpuGL.cpp (revision 8719)
+++ src/gpu/gl/GrGpuGL.cpp (working copy)
@@ -2262,6 +2262,12 @@
if (NULL != dstRT && dstRT->renderFBOID() != dstRT->textureFBOID()) {
return false;
}
robertphillips 2013/04/17 14:22:26 Does it make any sense to make this a test on GrSu
bsalomon 2013/04/18 18:09:33 Hmm... it's really a GL-specific thing.
+ const GrGLRenderTarget* srcRT = static_cast<const GrGLRenderTarget*>(src->asRenderTarget());
+ // If the src is multisampled (and uses an extension where there is a separate MSAA
+ // renderbuffer) then it is an invalid operation to call CopyTexSubImage
+ if (NULL != srcRT && srcRT->renderFBOID() != srcRT->textureFBOID()) {
+ return false;
+ }
if (gpu->isConfigRenderable(src->config()) && NULL != dst->asTexture() &&
dst->origin() == src->origin() && kIndex_8_GrPixelConfig != src->config()) {
if (NULL != wouldNeedTempFBO) {
@@ -2312,10 +2318,18 @@
// glCopyTexSubImage2D doesn't work with this config. We'll want to make it a render target
// in order to call glBlitFramebuffer or to copy to it by rendering.
INHERITED::initCopySurfaceDstDesc(src, desc);
+ return;
} else if (NULL == src->asRenderTarget()) {
// We don't want to have to create an FBO just to use glCopyTexSubImage2D. Let the base
// class handle it by rendering.
INHERITED::initCopySurfaceDstDesc(src, desc);
+ return;
+ }
+
+ const GrGLRenderTarget* srcRT = static_cast<const GrGLRenderTarget*>(src->asRenderTarget());
+ if (NULL != srcRT && srcRT->renderFBOID() != srcRT->textureFBOID()) {
+ // It's illegal to call CopyTexSubImage2D on a MSAA renderbuffer.
+ INHERITED::initCopySurfaceDstDesc(src, desc);
} else {
desc->fConfig = src->config();
desc->fOrigin = src->origin();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698