Auto merge of #20631 - brainlessdeveloper:add-webgl-get-renderbuffer-parameter, r=emilio

Implement WebGL GetRenderbufferParameter

This needed a bump of gleam to version 0.4.33 for this https://github.com/servo/gleam/pull/162

<!-- Please describe your changes on the following line: -->

I think my changes in test expectations are pretty naive and I have to wait for the PR to run on CI to see what the actual impact is. I'd like some guidance on this, too.

---
<!-- 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 build-geckolib` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #20514 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/20631)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-04-25 04:18:38 -04:00 committed by GitHub
commit f1a06e0d0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 191 additions and 110 deletions

View file

@ -754,6 +754,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::GetRenderbufferParameter(target, pname, chan) =>
Self::get_renderbuffer_parameter(ctx.gl(), target, pname, chan),
WebGLCommand::GetFramebufferAttachmentParameter(target, attachment, pname, chan) =>
Self::get_framebuffer_attachment_parameter(ctx.gl(), target, attachment, pname, chan),
WebGLCommand::GetVertexAttrib(index, pname, chan) =>
@ -1188,6 +1190,17 @@ impl WebGLImpl {
chan.send(parameter).unwrap();
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.7
fn get_renderbuffer_parameter(
gl: &gl::Gl,
target: u32,
pname: u32,
chan: WebGLSender<i32>
) {
let parameter = gl.get_renderbuffer_parameter_iv(target, pname);
chan.send(parameter).unwrap();
}
fn uniform_location(gl: &gl::Gl,
program_id: WebGLProgramId,
name: String,