mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
webgl: Add multiple WebGL calls (activeTexture + blend*)
* activeTexture * blendColor * blendFunc * blendFuncSeparate * blendEquation * blendEquationSeparate Blocked on gleam.
This commit is contained in:
parent
c33776a600
commit
ff568ecc90
6 changed files with 199 additions and 61 deletions
|
@ -138,6 +138,37 @@ impl<'a> WebGLRenderingContextMethods for JSRef<'a, WebGLRenderingContext> {
|
|||
0 as *mut JSObject
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
|
||||
fn ActiveTexture(self, texture: u32) {
|
||||
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::ActiveTexture(texture))).unwrap();
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
|
||||
fn BlendColor(self, r: f32, g: f32, b: f32, a: f32) {
|
||||
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::BlendColor(r, g, b, a))).unwrap();
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
|
||||
fn BlendEquation(self, mode: u32) {
|
||||
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::BlendEquation(mode))).unwrap();
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
|
||||
fn BlendEquationSeparate(self, mode_rgb: u32, mode_alpha: u32) {
|
||||
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::BlendEquationSeparate(mode_rgb, mode_alpha))).unwrap();
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
|
||||
fn BlendFunc(self, src_factor: u32, dest_factor: u32) {
|
||||
self.renderer.send(CanvasMsg::WebGL(CanvasWebGLMsg::BlendFunc(src_factor, dest_factor))).unwrap();
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
|
||||
fn BlendFuncSeparate(self, src_rgb: u32, dest_rgb: u32, src_alpha: u32, dest_alpha: u32) {
|
||||
self.renderer.send(
|
||||
CanvasMsg::WebGL(CanvasWebGLMsg::BlendFuncSeparate(src_rgb, dest_rgb, src_alpha, dest_alpha))).unwrap();
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
||||
fn AttachShader(self, program: Option<JSRef<WebGLProgram>>, shader: Option<JSRef<WebGLShader>>) {
|
||||
let program_id = match program {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue