diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-03-22 12:28:30 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-22 12:28:30 -0400 |
commit | 4aaac61a87f4e45e46d0591be73ce108e562c33f (patch) | |
tree | e8786e5026db056b14393adeb61e63011f619bf4 /components/canvas/webgl_thread.rs | |
parent | 2de89377db63ec03ae3b1256486c4c32b33f5fce (diff) | |
parent | ee5bdbbd8b99b58eda19c117b1a06e4a90a61bb1 (diff) | |
download | servo-4aaac61a87f4e45e46d0591be73ce108e562c33f.tar.gz servo-4aaac61a87f4e45e46d0591be73ce108e562c33f.zip |
Auto merge of #20317 - gootorov:webgl-getFramebufferAttachmentParameter, r=jdm
Implement WebGL getFrameBufferAttachmentParameter API
<!-- Please describe your changes on the following line: -->
Implementation of `getFramebufferAttachmentParameter` as in WebGL1 specification.
Part of https://github.com/servo/servo/issues/10209.
r? emilio or jdm.
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).
<!-- Either: -->
- [x] There are tests for these changes
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20317)
<!-- Reviewable:end -->
Diffstat (limited to 'components/canvas/webgl_thread.rs')
-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, |