aboutsummaryrefslogtreecommitdiffstats
path: root/components/canvas/webgl_thread.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2018-03-22 18:03:16 +0100
committerAnthony Ramine <n.oxyde@gmail.com>2018-03-22 19:17:36 +0100
commite34b19c42cce8fdc19df43d2201d7153ea9c787b (patch)
tree90ed95ac39ea457e204583eafc9553a1f5eb5ef6 /components/canvas/webgl_thread.rs
parentcb6fa6e6b0b98075a7d8ac851d2f3df7fd3698e5 (diff)
downloadservo-e34b19c42cce8fdc19df43d2201d7153ea9c787b.tar.gz
servo-e34b19c42cce8fdc19df43d2201d7153ea9c787b.zip
Implement gl.getParameter(gl.VIEWPORT)
Diffstat (limited to 'components/canvas/webgl_thread.rs')
-rw-r--r--components/canvas/webgl_thread.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/components/canvas/webgl_thread.rs b/components/canvas/webgl_thread.rs
index 785df7fd6c2..529d697d17e 100644
--- a/components/canvas/webgl_thread.rs
+++ b/components/canvas/webgl_thread.rs
@@ -860,8 +860,12 @@ impl WebGLImpl {
ctx.gl().vertex_attrib_pointer_f32(attrib_id, size, normalized, stride, offset),
WebGLCommand::VertexAttribPointer(attrib_id, size, data_type, normalized, stride, offset) =>
ctx.gl().vertex_attrib_pointer(attrib_id, size, data_type, normalized, stride, offset),
- WebGLCommand::Viewport(x, y, width, height) =>
- ctx.gl().viewport(x, y, width, height),
+ WebGLCommand::GetViewport(sender) => {
+ sender.send(ctx.gl().get_viewport()).unwrap();
+ }
+ WebGLCommand::SetViewport(x, y, width, height) => {
+ ctx.gl().viewport(x, y, width, height);
+ }
WebGLCommand::TexImage2D(target, level, internal, width, height, format, data_type, data) =>
ctx.gl().tex_image_2d(target, level, internal, width, height,
/*border*/0, format, data_type, Some(&data)),
@@ -1055,8 +1059,7 @@ impl WebGLImpl {
// Int32Array
gl::MAX_VIEWPORT_DIMS |
- gl::SCISSOR_BOX |
- gl::VIEWPORT => Err(WebGLError::InvalidEnum),
+ gl::SCISSOR_BOX => Err(WebGLError::InvalidEnum),
// Invalid parameters
_ => Err(WebGLError::InvalidEnum)