r?jrmuizel - Introspect for readBuffer mode. draft
authorJeff Gilbert <jdashg@gmail.com>
Thu, 26 May 2016 18:07:03 -0700
changeset 371888 15690fbae56af285205b39664f4225a860fef322
parent 371887 7bffeafbfd6daee572f1337b8892e41d424ada60
child 371889 a2a8f632b7a91062f22f4db923f4f26de6f8468a
push id19380
push userjgilbert@mozilla.com
push dateFri, 27 May 2016 01:10:45 +0000
reviewersjrmuizel
milestone49.0a1
r?jrmuizel - Introspect for readBuffer mode. From b738f888177b57a95ace4129f856e9c0c6d4d843 Mon Sep 17 00:00:00 2001 --- dom/canvas/WebGL2ContextState.cpp | 7 ++----- dom/canvas/WebGLFramebuffer.h | 2 ++ 2 files changed, 4 insertions(+), 5 deletions(-) MozReview-Commit-ID: CkqytcPB4dY
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);