aboutsummaryrefslogtreecommitdiffstats
path: root/components/canvas_traits/lib.rs
diff options
context:
space:
mode:
authorecoal95 <ecoal95@gmail.com>2015-07-25 21:01:44 +0200
committerecoal95 <ecoal95@gmail.com>2015-08-25 17:16:46 +0200
commit6341c77700fa5f914c32c6153e9c532bc69474fd (patch)
tree3509f4dc996823641e384972baf7a22aa5ad1ad9 /components/canvas_traits/lib.rs
parentaf3310f1490e93b2b1a77c1c1e9aab13cc46c9d5 (diff)
downloadservo-6341c77700fa5f914c32c6153e9c532bc69474fd.tar.gz
servo-6341c77700fa5f914c32c6153e9c532bc69474fd.zip
webgl: Implement multiple calls and improve error detection
This commit implements WebGL's: * cullFace * frontFace * enable * disable * depthMask * colorMask * clearDepth * clearStencil * depthFunc * depthRange * hint * lineWidth * pixelStorei * polygonOffset * texParameteri * texParameterf * texImage2D (partially) It inlines a lot of OpenGL calls to keep the file `components/canvas/webgl_paint_task.rs` as small as possible while keeping readability. It also improves error detection on previous calls, and sets node damage on the canvas in the drawing calls. It adds a `TexImage2D` reftest, even though it's not enabled because: * WebGL paints the image when it loads (asynchronously), so the reftest doesn't wait for it and it finishes early * If we change the source for the base64 src of the image it works as expected in non-headless mode, but the test harness locks
Diffstat (limited to 'components/canvas_traits/lib.rs')
-rw-r--r--components/canvas_traits/lib.rs19
1 files changed, 18 insertions, 1 deletions
diff --git a/components/canvas_traits/lib.rs b/components/canvas_traits/lib.rs
index 2ce53dfbb76..068eada3d9d 100644
--- a/components/canvas_traits/lib.rs
+++ b/components/canvas_traits/lib.rs
@@ -128,6 +128,16 @@ pub enum CanvasWebGLMsg {
BufferData(u32, Vec<f32>, u32),
Clear(u32),
ClearColor(f32, f32, f32, f32),
+ ClearDepth(f64),
+ ClearStencil(i32),
+ ColorMask(bool, bool, bool, bool),
+ CullFace(u32),
+ FrontFace(u32),
+ DepthFunc(u32),
+ DepthMask(bool),
+ DepthRange(f64, f64),
+ Enable(u32),
+ Disable(u32),
CompileShader(u32),
CreateBuffer(IpcSender<Option<NonZero<u32>>>),
CreateFramebuffer(IpcSender<Option<NonZero<u32>>>),
@@ -151,12 +161,19 @@ pub enum CanvasWebGLMsg {
GetShaderParameter(u32, u32, IpcSender<WebGLShaderParameter>),
GetAttribLocation(u32, String, IpcSender<Option<i32>>),
GetUniformLocation(u32, String, IpcSender<Option<i32>>),
+ PolygonOffset(f32, f32),
+ Hint(u32, u32),
+ LineWidth(f32),
+ PixelStorei(u32, i32),
LinkProgram(u32),
ShaderSource(u32, String),
Uniform4fv(i32, Vec<f32>),
UseProgram(u32),
- VertexAttribPointer2f(u32, i32, bool, i32, i64),
+ VertexAttribPointer2f(u32, i32, bool, i32, u32),
Viewport(i32, i32, i32, i32),
+ TexImage2D(u32, i32, i32, i32, i32, u32, u32, Vec<u8>),
+ TexParameteri(u32, u32, i32),
+ TexParameterf(u32, u32, f32),
DrawingBufferWidth(IpcSender<i32>),
DrawingBufferHeight(IpcSender<i32>),
}