Bug 658856 - implement drawingbufferWidth/Height - r=jmuizelaar
authorBenoit Jacob <bjacob@mozilla.com>
Thu, 01 Sep 2011 15:28:34 -0400
changeset 76408 f6180f12b7be01f56699b53d9d972d2092146232
parent 76407 1b633e26f8a3896422bd12c1adfcd676e4db41e1
child 76409 651f1df3e9d72d0c84ad6e2ed53e75860634bfb4
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersjmuizelaar
bugs658856
milestone9.0a1
Bug 658856 - implement drawingbufferWidth/Height - r=jmuizelaar These are new WebGLRenderingContext attributes exposing the actual drawing buffer size
content/canvas/src/WebGLContext.cpp
content/canvas/test/webgl/failing_tests_linux.txt
content/canvas/test/webgl/failing_tests_mac.txt
content/canvas/test/webgl/failing_tests_windows.txt
dom/interfaces/canvas/nsIDOMWebGLRenderingContext.idl
--- a/content/canvas/src/WebGLContext.cpp
+++ b/content/canvas/src/WebGLContext.cpp
@@ -1202,16 +1202,32 @@ DOMCI_DATA(WebGLExtension, WebGLExtensio
 
 NS_INTERFACE_MAP_BEGIN(WebGLExtension)
   NS_INTERFACE_MAP_ENTRY(WebGLExtension)
   NS_INTERFACE_MAP_ENTRY(nsIWebGLExtension)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WebGLExtension)
 NS_INTERFACE_MAP_END
 
+/* readonly attribute WebGLsizei drawingBufferWidth; */
+NS_IMETHODIMP
+WebGLContext::GetDrawingBufferWidth(WebGLsizei *aWidth)
+{
+    *aWidth = mWidth;
+    return NS_OK;
+}
+
+/* readonly attribute WebGLsizei drawingBufferHeight; */
+NS_IMETHODIMP
+WebGLContext::GetDrawingBufferHeight(WebGLsizei *aHeight)
+{
+    *aHeight = mHeight;
+    return NS_OK;
+}
+
 /* [noscript] attribute WebGLint location; */
 NS_IMETHODIMP
 WebGLUniformLocation::GetLocation(WebGLint *aLocation)
 {
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
--- a/content/canvas/test/webgl/failing_tests_linux.txt
+++ b/content/canvas/test/webgl/failing_tests_linux.txt
@@ -11,15 +11,14 @@ conformance/gl-get-active-attribute.html
 conformance/gl-getshadersource.html
 conformance/gl-uniform-bool.html
 conformance/glsl-conformance.html
 conformance/glsl-long-variable-names.html
 conformance/object-deletion-behaviour.html
 conformance/premultiplyalpha-test.html
 conformance/read-pixels-test.html
 conformance/uninitialized-test.html
-conformance/webgl-specific.html
 conformance/more/conformance/quickCheckAPI.html
 conformance/more/functions/copyTexImage2D.html
 conformance/more/functions/copyTexSubImage2D.html
 conformance/more/functions/deleteBufferBadArgs.html
 conformance/more/functions/texImage2DBadArgs.html
 conformance/more/functions/uniformfArrayLen1.html
--- a/content/canvas/test/webgl/failing_tests_mac.txt
+++ b/content/canvas/test/webgl/failing_tests_mac.txt
@@ -7,16 +7,15 @@ conformance/gl-object-get-calls.html
 conformance/glsl-conformance.html
 conformance/glsl-long-variable-names.html
 conformance/object-deletion-behaviour.html
 conformance/premultiplyalpha-test.html
 conformance/program-test.html
 conformance/read-pixels-test.html
 conformance/tex-input-validation.html
 conformance/texture-npot.html
-conformance/webgl-specific.html
 conformance/more/conformance/quickCheckAPI.html
 conformance/more/functions/copyTexImage2D.html
 conformance/more/functions/copyTexSubImage2D.html
 conformance/more/functions/deleteBufferBadArgs.html
 conformance/more/functions/texImage2DBadArgs.html
 conformance/more/functions/uniformfBadArgs.html
 conformance/more/functions/uniformiBadArgs.html
--- a/content/canvas/test/webgl/failing_tests_windows.txt
+++ b/content/canvas/test/webgl/failing_tests_windows.txt
@@ -2,15 +2,14 @@ conformance/drawingbuffer-static-canvas-
 conformance/drawingbuffer-test.html
 conformance/framebuffer-object-attachment.html
 conformance/gl-getshadersource.html
 conformance/glsl-conformance.html
 conformance/glsl-long-variable-names.html
 conformance/object-deletion-behaviour.html
 conformance/premultiplyalpha-test.html
 conformance/read-pixels-test.html
-conformance/webgl-specific.html
 conformance/more/conformance/quickCheckAPI.html
 conformance/more/functions/copyTexImage2D.html
 conformance/more/functions/copyTexSubImage2D.html
 conformance/more/functions/deleteBufferBadArgs.html
 conformance/more/functions/texImage2DBadArgs.html
 conformance/more/functions/uniformfArrayLen1.html
--- a/dom/interfaces/canvas/nsIDOMWebGLRenderingContext.idl
+++ b/dom/interfaces/canvas/nsIDOMWebGLRenderingContext.idl
@@ -837,9 +837,12 @@ interface nsIDOMWebGLRenderingContext : 
   // the underlying renderer to the user.
   [noscript] DOMString mozGetUnderlyingParamString(in WebGLenum pname);
 
   // extensions
   nsIWebGLExtension getExtension(in DOMString name);
 
   nsIVariant getSupportedExtensions();
   WebGLboolean isContextLost();
+
+  readonly attribute WebGLsizei drawingBufferWidth;
+  readonly attribute WebGLsizei drawingBufferHeight;
 };