mirror of
https://github.com/servo/servo.git
synced 2025-06-08 00:23:30 +00:00
Implement WebGL scissor method
This commit is contained in:
parent
59a3544279
commit
6a72d4dd12
4 changed files with 11 additions and 1 deletions
|
@ -111,6 +111,8 @@ impl WebGLPaintTask {
|
||||||
gl::pixel_store_i(name, val),
|
gl::pixel_store_i(name, val),
|
||||||
CanvasWebGLMsg::PolygonOffset(factor, units) =>
|
CanvasWebGLMsg::PolygonOffset(factor, units) =>
|
||||||
gl::polygon_offset(factor, units),
|
gl::polygon_offset(factor, units),
|
||||||
|
CanvasWebGLMsg::Scissor(x, y, width, height) =>
|
||||||
|
gl::scissor(x, y, width, height),
|
||||||
CanvasWebGLMsg::EnableVertexAttribArray(attrib_id) =>
|
CanvasWebGLMsg::EnableVertexAttribArray(attrib_id) =>
|
||||||
gl::enable_vertex_attrib_array(attrib_id),
|
gl::enable_vertex_attrib_array(attrib_id),
|
||||||
CanvasWebGLMsg::GetAttribLocation(program_id, name, chan) =>
|
CanvasWebGLMsg::GetAttribLocation(program_id, name, chan) =>
|
||||||
|
|
|
@ -175,6 +175,7 @@ pub enum CanvasWebGLMsg {
|
||||||
GetAttribLocation(u32, String, IpcSender<Option<i32>>),
|
GetAttribLocation(u32, String, IpcSender<Option<i32>>),
|
||||||
GetUniformLocation(u32, String, IpcSender<Option<i32>>),
|
GetUniformLocation(u32, String, IpcSender<Option<i32>>),
|
||||||
PolygonOffset(f32, f32),
|
PolygonOffset(f32, f32),
|
||||||
|
Scissor(i32, i32, i32, i32),
|
||||||
Hint(u32, u32),
|
Hint(u32, u32),
|
||||||
LineWidth(f32),
|
LineWidth(f32),
|
||||||
PixelStorei(u32, i32),
|
PixelStorei(u32, i32),
|
||||||
|
|
|
@ -906,6 +906,13 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.4
|
||||||
|
fn Scissor(&self, x: i32, y: i32, width: i32, height: i32) {
|
||||||
|
self.ipc_renderer
|
||||||
|
.send(CanvasMsg::WebGL(CanvasWebGLMsg::Scissor(x, y, width, height)))
|
||||||
|
.unwrap()
|
||||||
|
}
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
||||||
fn LinkProgram(&self, program: Option<&WebGLProgram>) {
|
fn LinkProgram(&self, program: Option<&WebGLProgram>) {
|
||||||
if let Some(program) = program {
|
if let Some(program) = program {
|
||||||
|
|
|
@ -618,7 +618,7 @@ interface WebGLRenderingContextBase
|
||||||
//void renderbufferStorage(GLenum target, GLenum internalformat,
|
//void renderbufferStorage(GLenum target, GLenum internalformat,
|
||||||
// GLsizei width, GLsizei height);
|
// GLsizei width, GLsizei height);
|
||||||
//void sampleCoverage(GLclampf value, GLboolean invert);
|
//void sampleCoverage(GLclampf value, GLboolean invert);
|
||||||
//void scissor(GLint x, GLint y, GLsizei width, GLsizei height);
|
void scissor(GLint x, GLint y, GLsizei width, GLsizei height);
|
||||||
|
|
||||||
void shaderSource(WebGLShader? shader, DOMString source);
|
void shaderSource(WebGLShader? shader, DOMString source);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue