Bug 1247810 - Redirect the enum query on Core profiles. - r=jrmuizel
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 13 Apr 2016 16:27:49 -0700
changeset 316897 f054c2480618ee6ac9603c8c6cf10b1eeeab2cfe
parent 316896 d6091fcaa0b271d235728b835f18b4c4be5c6992
child 316898 59231900a5a5dc916ac76a333f40776d63540f8a
push id9480
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 17:12:58 +0000
treeherdermozilla-aurora@0d6a91c76a9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1247810
milestone48.0a1
Bug 1247810 - Redirect the enum query on Core profiles. - r=jrmuizel
dom/canvas/WebGLContextState.cpp
--- a/dom/canvas/WebGLContextState.cpp
+++ b/dom/canvas/WebGLContextState.cpp
@@ -564,18 +564,25 @@ WebGLContext::GetParameter(JSContext* cx
 
         ////////////////////////////////
         // Complex values
 
         // 2 floats
         case LOCAL_GL_DEPTH_RANGE:
         case LOCAL_GL_ALIASED_POINT_SIZE_RANGE:
         case LOCAL_GL_ALIASED_LINE_WIDTH_RANGE: {
+            GLenum driverPName = pname;
+            if (gl->IsCoreProfile() &&
+                driverPName == LOCAL_GL_ALIASED_POINT_SIZE_RANGE)
+            {
+                driverPName = LOCAL_GL_POINT_SIZE_RANGE;
+            }
+
             GLfloat fv[2] = { 0 };
-            gl->fGetFloatv(pname, fv);
+            gl->fGetFloatv(driverPName, fv);
             JSObject* obj = dom::Float32Array::Create(cx, this, 2, fv);
             if (!obj) {
                 rv = NS_ERROR_OUT_OF_MEMORY;
             }
             return JS::ObjectOrNullValue(obj);
         }
 
         // 4 floats