webgl: Implement the pending texImage2D overload, and add more validation

This is a large-ish refactor of the Texture2D code, but it should be
easier to read and of course more correct.

I tried to annotate every error condition with a spec paragraph.
This commit is contained in:
Emilio Cobos Álvarez 2016-04-06 23:37:02 +02:00
parent 19a5a9ad08
commit 87e112dea7
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 288 additions and 34 deletions

View file

@ -632,6 +632,10 @@ interface WebGLRenderingContextBase
//void texImage2D(GLenum target, GLint level, GLenum internalformat,
// GLsizei width, GLsizei height, GLint border, GLenum format,
// GLenum type, ArrayBufferView? pixels);
// FIXME: SM interface arguments
void texImage2D(GLenum target, GLint level, GLenum internalformat,
GLsizei width, GLsizei height, GLint border, GLenum format,
GLenum type, optional object data);
void texImage2D(GLenum target, GLint level, GLenum internalformat,
GLenum format, GLenum type, TexImageSource? source); // May throw DOMException