ErrorResult is in a separate header file so it can be included from all over the
place without having to pull in mozilla/dom/Utils.h and all the xpconnect gunk
that needs.
This adds APIs suitable for calling from the new DOM bindings to WebGLContext and makes the XPCOM
versions of the WebGL context API call through to the new-binding versions.
Sorry for this little no-review patch. I meant to roll this into another of the patches for review and apparently forgot. It's 3 lines and quite trivial.
The main change is: remove the WebGLRectangleObject inheritance from
WebGLFramebufferAttachment, and instead have WebGLFramebufferAttachment
query its texture or renderbuffer for their dimensions, when needed.
In the course of doing this, a couple other needed changes appeared:
- let WebGLTexture::ImageInfo inherit WebGLRectangleObject, so that WebGLFramebufferAttachment can return a pointer to it right away in the texture case
- add a FramebufferRectangleObject() method to WebGLContext, that will return the dimensions of the bound FBO if there is one, otherwise will just return the contexts' own dimensions.
- in order to do that, it was very convenient to let WebGLContext inherit WebGLRectangleObject so that FramebufferRectangleObject() could just return a pointer to that in the no-bound-FBO case.
- move WebGLRectangleObject up in the file, above WebGLContext
- there was a plain bug in WebGLFramebufferAttachment::HasAlpha(), we were not using the right image info within the texture.
The EXT_lose_context extension spec has had updates from Khronos which break our
current implementation. Primarily, it is mostly asynchronous now with more
heavily defined behavior.
NOTE: This patch will not pass on our current copy of context-lost.html and
context-lost-restored.html see bug for more info.
Similar to ARB_robustness, uses our current robustness framework. There are some
problems preventing this from being completely usable, but we can't do anything
about them yet. See the bug for more info.
Currently, WebGLProgram holds a hashtable of refptrs to all WebGLUniformLocation's created from it.
It's used for one thing: to ensure that multiple getUniformLocation() calls on same uniform return the same WebGLUniformLocation object.
However, in a discussion on the public_webgl mailing list this week, we agreed that this was not mandated by the spec and that on the contrary, to ensure consistent behavior across browsers, we're going to require that NOT to happen. So this becomes a conformance issue.
Removing this hashtable also simplifies code and ownership patterns.
This patch switches to the new mutual ownership pattern for WebGL objects, based on maintaining a second WebGL-specific refcount mirroring the OpenGL refcount which we can't access, using the helper classes that were introduced in patches 1 and 2.
These IIDs were used in the past to check, using do_QueryInterface, that the objects passed to WebGL functions were really of the expected type. Now that WebGL classes are marked 'builtinclass' in the IDL and that check has been removed (see bug 638328), none of that is needed anymore.
This patch should improve performance of the robustness timer by not resetting
it each time a draw operation happens. It still checks if there's any activity
and, if not, it will stop firing it. It includes a single extra timer firing
after activity dies to make sure we don't miss anything. Also includes a fix for
robustness being marked as existing when it really isn't.
Antialiasing can be blocked through the downloaded blocklist now, as well as
static analysis compiled into the OS-specific handlers for graphics features.
We are supposed to clear the WebGL framebuffer after it's been presented to the compositor and before the next draw operation, and were using the wrong way to know when we got composited. The right way is DidTransactionCallback.