Bug 1246007 - Ignore RENDERBUFFER_SAMPLES outside of webgl2. - r=jrmuizel
authorJeff Gilbert <jgilbert@mozilla.com>
Fri, 05 Feb 2016 16:41:21 -0800
changeset 283244 e4dfe029dd33242203bd9bac3d7fefcc31ece890
parent 283243 1a7d89d6f69c87379671b8931ccf0c99e58eb912
child 283245 301dc955251397607077f490f3a8af488df3110b
push id71484
push userjgilbert@mozilla.com
push dateSat, 06 Feb 2016 00:41:38 +0000
treeherdermozilla-inbound@e4dfe029dd33 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1246007
milestone47.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 1246007 - Ignore RENDERBUFFER_SAMPLES outside of webgl2. - r=jrmuizel
dom/canvas/WebGLContextGL.cpp
--- a/dom/canvas/WebGLContextGL.cpp
+++ b/dom/canvas/WebGLContextGL.cpp
@@ -834,35 +834,41 @@ WebGLContext::GetRenderbufferParameter(G
     if (!mBoundRenderbuffer) {
         ErrorInvalidOperation("getRenderbufferParameter: no render buffer is bound");
         return JS::NullValue();
     }
 
     MakeContextCurrent();
 
     switch (pname) {
-        case LOCAL_GL_RENDERBUFFER_SAMPLES:
-        case LOCAL_GL_RENDERBUFFER_WIDTH:
-        case LOCAL_GL_RENDERBUFFER_HEIGHT:
-        case LOCAL_GL_RENDERBUFFER_RED_SIZE:
-        case LOCAL_GL_RENDERBUFFER_GREEN_SIZE:
-        case LOCAL_GL_RENDERBUFFER_BLUE_SIZE:
-        case LOCAL_GL_RENDERBUFFER_ALPHA_SIZE:
-        case LOCAL_GL_RENDERBUFFER_DEPTH_SIZE:
-        case LOCAL_GL_RENDERBUFFER_STENCIL_SIZE:
-        case LOCAL_GL_RENDERBUFFER_INTERNAL_FORMAT:
-        {
-            // RB emulation means we have to ask the RB itself.
-            GLint i = mBoundRenderbuffer->GetRenderbufferParameter(target, pname);
-            return JS::Int32Value(i);
-        }
-        default:
-            ErrorInvalidEnumInfo("getRenderbufferParameter: parameter", pname);
+    case LOCAL_GL_RENDERBUFFER_SAMPLES:
+        if (!IsWebGL2())
+            break;
+        // fallthrough
+
+    case LOCAL_GL_RENDERBUFFER_WIDTH:
+    case LOCAL_GL_RENDERBUFFER_HEIGHT:
+    case LOCAL_GL_RENDERBUFFER_RED_SIZE:
+    case LOCAL_GL_RENDERBUFFER_GREEN_SIZE:
+    case LOCAL_GL_RENDERBUFFER_BLUE_SIZE:
+    case LOCAL_GL_RENDERBUFFER_ALPHA_SIZE:
+    case LOCAL_GL_RENDERBUFFER_DEPTH_SIZE:
+    case LOCAL_GL_RENDERBUFFER_STENCIL_SIZE:
+    case LOCAL_GL_RENDERBUFFER_INTERNAL_FORMAT:
+    {
+        // RB emulation means we have to ask the RB itself.
+        GLint i = mBoundRenderbuffer->GetRenderbufferParameter(target, pname);
+        return JS::Int32Value(i);
     }
 
+    default:
+        break;
+    }
+
+    ErrorInvalidEnumInfo("getRenderbufferParameter: parameter", pname);
     return JS::NullValue();
 }
 
 already_AddRefed<WebGLTexture>
 WebGLContext::CreateTexture()
 {
     if (IsContextLost())
         return nullptr;