Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement WebGL GetRenderbufferParameter #20631
Conversation
highfive
commented
Apr 12, 2018
|
Heads up! This PR modifies the following files:
|
highfive
commented
Apr 12, 2018
|
r? |
| self.send_command(WebGLCommand::GetRenderbufferParameter(target, pname, sender)); | ||
|
|
||
| match receiver.recv().unwrap() { | ||
| value if value != 0 => Int32Value(value), |
This comment has been minimized.
This comment has been minimized.
gootorov
Apr 13, 2018
•
Contributor
0 can be a valid result, right? I think it should be just Int32Value(receiver.recv().unwrap()).
|
@bors-servo try |
…parameter, r=<try> Implement WebGL GetRenderbufferParameter This needed a bump of gleam to version 0.4.33 for this servo/gleam#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 -->
| @@ -2345,6 +2345,41 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { | |||
| Int32Value(receiver.recv().unwrap()) | |||
| } | |||
|
|
|||
| #[allow(unsafe_code)] | |||
| // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.7 | |||
| unsafe fn GetRenderbufferParameter(&self, _cx: *mut JSContext, target: u32, pname: u32) -> JSVal { | |||
This comment has been minimized.
This comment has been minimized.
gootorov
Apr 13, 2018
•
Contributor
nit: For functions with many arguments, we usually indent like so
unsafe fn GetRenderbufferParameter(
&self,
...
) -> JSVal {|
|
||
| let (sender, receiver) = webgl_channel().unwrap(); | ||
| self.send_command(WebGLCommand::GetRenderbufferParameter(target, pname, sender)); | ||
|
|
This comment has been minimized.
This comment has been minimized.
gootorov
Apr 13, 2018
•
Contributor
The following check is missing:
If the renderbuffer currently bound to target is zero, then INVALID_- OPERATION is generated.
Reference
This comment has been minimized.
This comment has been minimized.
gootorov
Apr 13, 2018
Contributor
It's just this, basically :)
if self.bound_renderbuffer.get().is_none() {
self.webgl_error(InvalidOperation);
return NullValue();
}|
|
|
I'll get to this in the evening, thanks :) Also I think my expectations for test failures are wrong, I should be updating more |
6692241
to
3cefd52
3cefd52
to
a6b6568
|
I pushed changes regarding your suggestions and removed some more "expected to fail" |
a6b6568
to
6b166ce
|
Those are known failures, don't worry about them. The relevant ones are in the |
|
@bors-servo try |
…parameter, r=<try> Implement WebGL GetRenderbufferParameter This needed a bump of gleam to version 0.4.33 for this servo/gleam#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 -->
|
|
|
r? @nox |
|
|
| @@ -1,29 +1,53 @@ | |||
| [gl-object-get-calls.html] | |||
| expected: ERROR | |||
| [WebGL test #33: gl.getRenderbufferParameter(gl.RENDERBUFFER, gl.RENDERBUFFER_WIDTH) should be 2. Threw exception TypeError: gl.getRenderbufferParameter is not a function] | |||
| expected: TIMEOUT | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
4b4c286
to
ff95682
|
@bors-servo try |
…parameter, r=<try> Implement WebGL GetRenderbufferParameter This needed a bump of gleam to version 0.4.33 for this servo/gleam#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 -->
|
|
|
Finally |
cc @nox |
|
I hope I don't need to solve conflicts again x_D |
|
Looks good modulo that. Let me know if you prefer to move that in a followup, that's fine for me :) |
| if self.bound_renderbuffer.get().is_none() { | ||
| self.webgl_error(InvalidOperation); | ||
| return NullValue(); | ||
| } |
This comment has been minimized.
This comment has been minimized.
emilio
Apr 24, 2018
Member
This should probably move after the target and parameter names, to preserve the same order used in https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glGetRenderbufferParameteriv.xml.
ff95682
to
a30674a
|
r? @emilio I moved the check to the place suggested. I thought of putting it there initially, but I thought it might be cheaper to check at the start because the second check needs |
|
@bors-servo r+ Yeah, in general optimizing for error paths isn't really necessary. And in this case it's observable, so there's not much we can do about it anyway. |
|
|
…parameter, r=emilio Implement WebGL GetRenderbufferParameter This needed a bump of gleam to version 0.4.33 for this servo/gleam#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 -->
|
|
fnune commentedApr 12, 2018
•
edited
This needed a bump of gleam to version 0.4.33 for this servo/gleam#162
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.
./mach build -ddoes not report any errors./mach build-geckolibdoes not report any errors./mach test-tidydoes not report any errorsThis change is