diff options
author | Igor Gutorov <igootorov@gmail.com> | 2018-03-14 20:41:36 +0200 |
---|---|---|
committer | Igor Gutorov <igootorov@gmail.com> | 2018-03-22 18:26:18 +0200 |
commit | ee5bdbbd8b99b58eda19c117b1a06e4a90a61bb1 (patch) | |
tree | f4c3a2dcc85b6e576ddaaa585210bc293ffbff6c /components/canvas | |
parent | f92f0809f89593d4b70eb0f507f6ca4409c9ed91 (diff) | |
download | servo-ee5bdbbd8b99b58eda19c117b1a06e4a90a61bb1.tar.gz servo-ee5bdbbd8b99b58eda19c117b1a06e4a90a61bb1.zip |
Implement WebGL getFramebufferAttachmentParameter API
Diffstat (limited to 'components/canvas')
-rw-r--r-- | components/canvas/webgl_thread.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/components/canvas/webgl_thread.rs b/components/canvas/webgl_thread.rs index e27d85c4395..785df7fd6c2 100644 --- a/components/canvas/webgl_thread.rs +++ b/components/canvas/webgl_thread.rs @@ -750,6 +750,8 @@ impl WebGLImpl { Self::active_uniform(ctx.gl(), program_id, index, chan), WebGLCommand::GetAttribLocation(program_id, name, chan) => Self::attrib_location(ctx.gl(), program_id, name, chan), + WebGLCommand::GetFramebufferAttachmentParameter(target, attachment, pname, chan) => + Self::get_framebuffer_attachment_parameter(ctx.gl(), target, attachment, pname, chan), WebGLCommand::GetVertexAttrib(index, pname, chan) => Self::vertex_attrib(ctx.gl(), index, pname, chan), WebGLCommand::GetVertexAttribOffset(index, pname, chan) => @@ -1165,6 +1167,18 @@ impl WebGLImpl { chan.send(gl.get_string(gl::EXTENSIONS)).unwrap(); } + // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.6 + fn get_framebuffer_attachment_parameter( + gl: &gl::Gl, + target: u32, + attachment: u32, + pname: u32, + chan: WebGLSender<i32> + ) { + let parameter = gl.get_framebuffer_attachment_parameter_iv(target, attachment, pname); + chan.send(parameter).unwrap(); + } + fn uniform_location(gl: &gl::Gl, program_id: WebGLProgramId, name: String, |