Bug 1170855 - Part B: READ_BUFFER requires emulation for default FB. r=jgilbert
authorDan Glastonbury <dglastonbury@mozilla.com>
Tue, 09 Jun 2015 10:40:56 +1000
changeset 248255 5b7031ee6b0d1a45b321549735b68d562de2daee
parent 248254 dfa20a123ec47dd2b656b11a414c5adfe736ecf6
child 248256 321a1148b604f91779daafd6f2ed59fc9b83bf6b
push id28893
push userkwierso@gmail.com
push dateFri, 12 Jun 2015 00:02:58 +0000
treeherderautoland@8cf9d3e497f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1170855
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1170855 - Part B: READ_BUFFER requires emulation for default FB. r=jgilbert WebGL internals use framebuffers to implement the default framebuffer. This means that we can't just return the result from glGetIntegerv(GL_READ_BUFFER, ...)
dom/canvas/WebGL2ContextState.cpp
--- a/dom/canvas/WebGL2ContextState.cpp
+++ b/dom/canvas/WebGL2ContextState.cpp
@@ -33,18 +33,27 @@ WebGL2Context::GetParameter(JSContext* c
     case LOCAL_GL_UNPACK_SKIP_PIXELS:
     case LOCAL_GL_UNPACK_SKIP_ROWS: {
       realGLboolean b = 0;
       gl->fGetBooleanv(pname, &b);
       return JS::BooleanValue(bool(b));
     }
 
     /* GLenum */
+    case LOCAL_GL_READ_BUFFER: {
+      if (mBoundReadFramebuffer) {
+        GLint val = LOCAL_GL_NONE;
+        gl->fGetIntegerv(pname, &val);
+        return JS::Int32Value(val);
+      }
+
+      return JS::Int32Value(LOCAL_GL_BACK);
+    }
+
     case LOCAL_GL_FRAGMENT_SHADER_DERIVATIVE_HINT:
-    case LOCAL_GL_READ_BUFFER:
       /* fall through */
 
     /* GLint */
     case LOCAL_GL_MAX_3D_TEXTURE_SIZE:
     case LOCAL_GL_MAX_ARRAY_TEXTURE_LAYERS:
     case LOCAL_GL_MAX_COMBINED_UNIFORM_BLOCKS:
     case LOCAL_GL_MAX_ELEMENTS_INDICES:
     case LOCAL_GL_MAX_ELEMENTS_VERTICES: