Don't require draw_buffers as a native ext for WebGL2. draft
authorJeff Gilbert <jdashg@gmail.com>
Thu, 17 Dec 2015 16:16:52 -0800
changeset 316086 a8cef41b6a865c7cf0cf6f105dd5aac059dd129a
parent 316085 ceeba974fa1905d5bae78b425ed799d59148d805
child 316087 13db279cebff0eda48c55c04807c406f00db79fe
push id8514
push userjgilbert@mozilla.com
push dateFri, 18 Dec 2015 00:24:33 +0000
milestone45.0a1
Don't require draw_buffers as a native ext for WebGL2.
dom/canvas/WebGL2Context.cpp
dom/canvas/WebGLContextState.cpp
--- a/dom/canvas/WebGL2Context.cpp
+++ b/dom/canvas/WebGL2Context.cpp
@@ -56,18 +56,17 @@ WebGL2Context::WrapObject(JSContext* cx,
 // WebGL 2 initialisation
 
 // These WebGL 1 extensions are natively supported by WebGL 2.
 static const WebGLExtensionID kNativelySupportedExtensions[] = {
     WebGLExtensionID::ANGLE_instanced_arrays,
     WebGLExtensionID::EXT_blend_minmax,
     WebGLExtensionID::OES_element_index_uint,
     WebGLExtensionID::OES_standard_derivatives,
-    WebGLExtensionID::OES_vertex_array_object,
-    WebGLExtensionID::WEBGL_draw_buffers
+    WebGLExtensionID::OES_vertex_array_object
 };
 
 static const gl::GLFeature kRequiredFeatures[] = {
     gl::GLFeature::blend_minmax,
     gl::GLFeature::clear_buffers,
     gl::GLFeature::copy_buffer,
     gl::GLFeature::depth_texture,
     gl::GLFeature::draw_instanced,
--- a/dom/canvas/WebGLContextState.cpp
+++ b/dom/canvas/WebGLContextState.cpp
@@ -137,17 +137,17 @@ WebGLContext::GetParameter(JSContext* cx
                 return JS::Int32Value(MINVALUE_GL_MAX_RENDERBUFFER_SIZE);
 
             default:
                 // Return the real value; we're not overriding this one
                 break;
         }
     }
 
-    if (IsExtensionEnabled(WebGLExtensionID::WEBGL_draw_buffers)) {
+    if (IsWebGL2() || IsExtensionEnabled(WebGLExtensionID::WEBGL_draw_buffers)) {
         if (pname == LOCAL_GL_MAX_COLOR_ATTACHMENTS) {
             return JS::Int32Value(mImplMaxColorAttachments);
 
         } else if (pname == LOCAL_GL_MAX_DRAW_BUFFERS) {
             return JS::Int32Value(mImplMaxDrawBuffers);
 
         } else if (pname >= LOCAL_GL_DRAW_BUFFER0 &&
                    pname < GLenum(LOCAL_GL_DRAW_BUFFER0 + mImplMaxDrawBuffers))