Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement WebGL GetRenderbufferParameter #20631

Merged
merged 2 commits into from Apr 25, 2018

Conversation

@fnune
Copy link
Contributor

fnune commented Apr 12, 2018

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 -d does not report any errors
  • ./mach build-geckolib does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #20514 (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive
Copy link

highfive commented Apr 12, 2018

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/webglrenderingcontext.rs, components/script/Cargo.toml, components/script/dom/webidls/WebGLRenderingContext.webidl, components/script/dom/webgl2renderingcontext.rs
  • @paulrouget: components/compositing/Cargo.toml, components/servo/Cargo.toml, ports/servo/Cargo.toml
  • @fitzgen: components/script/dom/webglrenderingcontext.rs, components/script/Cargo.toml, components/script/dom/webidls/WebGLRenderingContext.webidl, components/script/dom/webgl2renderingcontext.rs
  • @KiChjang: components/script/dom/webglrenderingcontext.rs, components/script/Cargo.toml, components/script/dom/webidls/WebGLRenderingContext.webidl, components/script/dom/webgl2renderingcontext.rs
@highfive
Copy link

highfive commented Apr 12, 2018

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
@fnune
Copy link
Contributor Author

fnune 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.

@gootorov

gootorov Apr 13, 2018

Contributor

0 can be a valid result, right? I think it should be just Int32Value(receiver.recv().unwrap()).

@gootorov
Copy link
Contributor

gootorov commented Apr 13, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Apr 13, 2018

Trying commit 6692241 with merge a8818d8...

bors-servo added a commit that referenced this pull request Apr 13, 2018
…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.

@gootorov

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.

@gootorov

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.

@gootorov

gootorov Apr 13, 2018

Contributor

It's just this, basically :)

if self.bound_renderbuffer.get().is_none() {
    self.webgl_error(InvalidOperation);
    return NullValue();
}
@bors-servo
Copy link
Contributor

bors-servo commented Apr 13, 2018

💔 Test failed - linux-rel-wpt

@fnune
Copy link
Contributor Author

fnune commented Apr 16, 2018

I'll get to this in the evening, thanks :) Also I think my expectations for test failures are wrong, I should be updating more .ini files.

@nox nox removed the S-awaiting-review label Apr 16, 2018
@fnune fnune force-pushed the fnune:add-webgl-get-renderbuffer-parameter branch from 6692241 to 3cefd52 Apr 16, 2018
@fnune fnune force-pushed the fnune:add-webgl-get-renderbuffer-parameter branch from 3cefd52 to a6b6568 Apr 16, 2018
@fnune
Copy link
Contributor Author

fnune commented Apr 16, 2018

I pushed changes regarding your suggestions and removed some more "expected to fail" .ini entries. I'm not sure if I interpreted the test failures correctly though? Here they are http://build.servo.org/builders/linux-rel-wpt/builds/8500/steps/shell__4/logs/intermittents.log

@fnune fnune force-pushed the fnune:add-webgl-get-renderbuffer-parameter branch from a6b6568 to 6b166ce Apr 16, 2018
@gootorov
Copy link
Contributor

gootorov commented Apr 16, 2018

Those are known failures, don't worry about them. The relevant ones are in the filtered-wpt-errorsummary.log file.

@gootorov
Copy link
Contributor

gootorov commented Apr 16, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Apr 16, 2018

Trying commit 6b166ce with merge 6ef4b98...

bors-servo added a commit that referenced this pull request Apr 16, 2018
…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 -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 16, 2018

💔 Test failed - linux-rel-css

@nox
Copy link
Member

nox commented Apr 17, 2018

r? @nox

@highfive highfive assigned nox and unassigned pcwalton Apr 17, 2018
@bors-servo
Copy link
Contributor

bors-servo commented Apr 20, 2018

💔 Test failed - linux-rel-wpt

@@ -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.

@gootorov

gootorov Apr 20, 2018

Contributor

Looking at the last log, I guess this should be OK, then? Not sure why the script generated this to be a TIMEOUT and what's happening with this test in general.

cc @nox to the rescue.

This comment has been minimized.

@fnune

fnune Apr 20, 2018

Author Contributor

IDK, I'm pushing again without the TIMEOUT

This comment has been minimized.

@gootorov

gootorov Apr 20, 2018

Contributor

Alright, let's see. Hope it works now :).

@fnune fnune force-pushed the fnune:add-webgl-get-renderbuffer-parameter branch from 4b4c286 to ff95682 Apr 20, 2018
@gootorov
Copy link
Contributor

gootorov commented Apr 20, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Apr 20, 2018

Trying commit ff95682 with merge ed6b30f...

bors-servo added a commit that referenced this pull request Apr 20, 2018
…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 -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 20, 2018

@fnune
Copy link
Contributor Author

fnune commented Apr 21, 2018

Finally 😅

@gootorov
Copy link
Contributor

gootorov commented Apr 21, 2018

Test successful

cc @nox
This can be r+'ed

@fnune
Copy link
Contributor Author

fnune commented Apr 24, 2018

I hope I don't need to solve conflicts again x_D

@emilio
emilio approved these changes Apr 24, 2018
Copy link
Member

emilio left a comment

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.

@emilio

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.

fnune added 2 commits Apr 12, 2018
This needed a bump of gleam to version 0.4.33
Updated by running
/mach test-wpt --log-raw /tmp/servo.log ./**/*1.0.3*/conformance/state/gl-object-get-calls.html

...and then
./mach update-wpt /tmp/servo.log
@fnune fnune force-pushed the fnune:add-webgl-get-renderbuffer-parameter branch from ff95682 to a30674a Apr 24, 2018
@fnune
Copy link
Contributor Author

fnune commented Apr 24, 2018

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 target_matches and pname_matches to be assigned in order to work. I guess it's not important anyway.

@emilio
Copy link
Member

emilio commented Apr 25, 2018

@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.

@bors-servo
Copy link
Contributor

bors-servo commented Apr 25, 2018

📌 Commit a30674a has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Apr 25, 2018

Testing commit a30674a with merge f1a06e0...

bors-servo added a commit that referenced this pull request Apr 25, 2018
…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 -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 25, 2018

@bors-servo bors-servo merged commit a30674a into servo:master Apr 25, 2018
3 of 4 checks passed
3 of 4 checks passed
Taskcluster (pull_request) TaskGroup: failure
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@fnune fnune deleted the fnune:add-webgl-get-renderbuffer-parameter branch Apr 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

7 participants
You can’t perform that action at this time.