Bug 685694 - Don't use glDrawBuffer in GLES2. r=matt.woodrow
authorBenoit Girard <b56girard@gmail.com>
Thu, 08 Sep 2011 14:21:36 -0700
changeset 76788 5aa439407de852dd886dfb5f1cec6319a62d78af
parent 76787 f96612c06d853ac5ad0626eacd3075b4c46aee03
child 76789 daa5e76d7f13d2ed0c41cce743dc02ee9abe5408
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersmatt
bugs685694
milestone9.0a1
Bug 685694 - Don't use glDrawBuffer in GLES2. r=matt.woodrow
gfx/layers/opengl/LayerManagerOGL.cpp
--- a/gfx/layers/opengl/LayerManagerOGL.cpp
+++ b/gfx/layers/opengl/LayerManagerOGL.cpp
@@ -1013,23 +1013,23 @@ LayerManagerOGL::CopyToTarget()
 
   nsRefPtr<gfxImageSurface> imageSurface =
     new gfxImageSurface(gfxIntSize(width, height),
                         gfxASurface::ImageFormatARGB32);
 
   mGLContext->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER,
                                mGLContext->IsDoubleBuffered() ? 0 : mBackBufferFBO);
 
+#ifndef USE_GLES2
+  // GLES2 promises that binding to any custom FBO will attach
+  // to GL_COLOR_ATTACHMENT0 attachment point.
   if (mGLContext->IsDoubleBuffered()) {
     mGLContext->fReadBuffer(LOCAL_GL_BACK);
   }
-#ifndef USE_GLES2
   else {
-  // GLES2 promises that binding to any custom FBO will attach
-  // to GL_COLOR_ATTACHMENT0 attachment point.
     mGLContext->fReadBuffer(LOCAL_GL_COLOR_ATTACHMENT0);
   }
 #endif
 
   GLenum format = LOCAL_GL_RGBA;
   if (mHasBGRA)
     format = LOCAL_GL_BGRA;