Bug 1276096 - Introspect for readBuffer mode. - r=jrmuizel
authorJeff Gilbert <jdashg@gmail.com>
Thu, 26 May 2016 18:07:03 -0700
changeset 338814 a8497187882983a15f0327a602c5a614174a658b
parent 338813 8efba00e40e4899ab7ddd94d210f270b4f972739
child 338815 7606a20b0d3f228438374450d78409cf3a7b7c09
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1276096
milestone49.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 1276096 - Introspect for readBuffer mode. - r=jrmuizel
dom/canvas/WebGL2ContextState.cpp
dom/canvas/WebGLFramebuffer.h
--- a/dom/canvas/WebGL2ContextState.cpp
+++ b/dom/canvas/WebGL2ContextState.cpp
@@ -38,21 +38,18 @@ WebGL2Context::GetParameter(JSContext* c
     case LOCAL_GL_TRANSFORM_FEEDBACK_ACTIVE: {
       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);
-      }
+      if (mBoundReadFramebuffer)
+        return JS::Int32Value(mBoundReadFramebuffer->ReadBufferMode());
 
       return JS::Int32Value(LOCAL_GL_BACK);
     }
 
     case LOCAL_GL_FRAGMENT_SHADER_DERIVATIVE_HINT:
       /* fall through */
 
     /* GLint */
--- a/dom/canvas/WebGLFramebuffer.h
+++ b/dom/canvas/WebGLFramebuffer.h
@@ -252,16 +252,18 @@ public:
     const WebGLFBAttachPoint& DepthStencilAttachment() const {
         return mDepthStencilAttachment;
     }
 
     void SetReadBufferMode(GLenum readBufferMode) {
         mReadBufferMode = readBufferMode;
     }
 
+    GLenum ReadBufferMode() const { return mReadBufferMode; }
+
 protected:
     WebGLFBAttachPoint* GetAttachPoint(GLenum attachment); // Fallible
 
 public:
     void DetachTexture(const WebGLTexture* tex);
 
     void DetachRenderbuffer(const WebGLRenderbuffer* rb);