webgl: Refactor texture validations to take advantage of rust type system

This commit introduces the `WebGLValidator` trait, and uses it for multiple
validations in the texture-related WebGL code, to move that logic out of the
already bloated `webglrenderingcontext.rs` file.

It also creates a type-safe wrapper for some WebGL types, removing all the
`unreachable!`s there, and introduces a macro for generating them conveniently.

This partially addresses #10693, pending refactor more code to use this
infrastructure, and (possibly?) introducing an `AsGLError` trait for the errors
to make the error handling happen in `WebGLContext`.
This commit is contained in:
Emilio Cobos Álvarez 2016-06-12 00:16:27 +02:00
parent 8d81ee77a8
commit 46c14aced2
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
7 changed files with 706 additions and 420 deletions

View file

@ -394,6 +394,7 @@ pub mod validation;
pub mod validitystate;
pub mod values;
pub mod virtualmethods;
pub mod webgl_validations;
pub mod webglactiveinfo;
pub mod webglbuffer;
pub mod webglcontextevent;