WebGL2: Implement some miscellaneous parameters (bug 1081419, r=jgilbert).
authorDavid Anderson <dvander@alliedmods.net>
Tue, 14 Oct 2014 18:00:48 -0700
changeset 210482 edabc76c30f5a6a9a8a6032e272999ae974e8993
parent 210481 5f0732a51004eea0a65ac12ed04eaa9c9e32d366
child 210483 1e7321e168fdaef13c812474c8dd4acf86497d53
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersjgilbert
bugs1081419
milestone36.0a1
WebGL2: Implement some miscellaneous parameters (bug 1081419, r=jgilbert).
dom/canvas/WebGLContextState.cpp
--- a/dom/canvas/WebGLContextState.cpp
+++ b/dom/canvas/WebGLContextState.cpp
@@ -172,16 +172,28 @@ WebGLContext::GetParameter(JSContext* cx
             if (mBoundVertexArray == mDefaultVertexArray){
                 return WebGLObjectAsJSValue(cx, (WebGLVertexArray *) nullptr, rv);
             }
 
             return WebGLObjectAsJSValue(cx, mBoundVertexArray.get(), rv);
         }
     }
 
+    if (IsWebGL2()) {
+        switch (pname) {
+            case LOCAL_GL_MAX_SAMPLES:
+            case LOCAL_GL_MAX_UNIFORM_BLOCK_SIZE:
+            case LOCAL_GL_MAX_VERTEX_UNIFORM_COMPONENTS: {
+                GLint val;
+                gl->fGetIntegerv(pname, &val);
+                return JS::NumberValue(uint32_t(val));
+            }
+        }
+    }
+
     switch (pname) {
         //
         // String params
         //
         case LOCAL_GL_VENDOR:
             return StringValue(cx, "Mozilla", rv);
         case LOCAL_GL_RENDERER:
             return StringValue(cx, "Mozilla", rv);