aboutsummaryrefslogtreecommitdiffstats
path: root/components/canvas_traits/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/canvas_traits/lib.rs')
-rw-r--r--components/canvas_traits/lib.rs24
1 files changed, 21 insertions, 3 deletions
diff --git a/components/canvas_traits/lib.rs b/components/canvas_traits/lib.rs
index 0fee050d78d..51c9a1dafb2 100644
--- a/components/canvas_traits/lib.rs
+++ b/components/canvas_traits/lib.rs
@@ -107,9 +107,9 @@ pub enum CanvasWebGLMsg {
BindTexture(u32, u32),
DrawArrays(u32, i32, i32),
EnableVertexAttribArray(u32),
- GetAttribLocation(u32, String, Sender<i32>),
- GetShaderInfoLog(u32, Sender<String>),
- GetShaderParameter(u32, u32, Sender<i32>),
+ GetShaderInfoLog(u32, Sender<Option<String>>),
+ GetShaderParameter(u32, u32, Sender<WebGLShaderParameter>),
+ GetAttribLocation(u32, String, Sender<Option<i32>>),
GetUniformLocation(u32, String, Sender<Option<i32>>),
LinkProgram(u32),
ShaderSource(u32, String),
@@ -122,6 +122,24 @@ pub enum CanvasWebGLMsg {
}
#[derive(Clone)]
+pub enum WebGLError {
+ InvalidEnum,
+ InvalidOperation,
+ InvalidValue,
+ OutOfMemory,
+ ContextLost,
+}
+
+pub type WebGLResult<T> = Result<T, WebGLError>;
+
+#[derive(Clone)]
+pub enum WebGLShaderParameter {
+ Int(i32),
+ Bool(bool),
+ Invalid,
+}
+
+#[derive(Clone)]
pub enum CanvasCommonMsg {
Close,
Recreate(Size2D<i32>),