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


  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive
Copy link

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

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 12, 2018
@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),
Copy link
Contributor

@gootorov gootorov Apr 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@gootorov
Copy link
Contributor

@bors-servo try

@bors-servo
Copy link
Contributor

⌛ Trying commit 6692241 with merge a8818d8...

bors-servo pushed 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 {
Copy link
Contributor

@gootorov gootorov Apr 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));

Copy link
Contributor

@gootorov gootorov Apr 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following check is missing:
If the renderbuffer currently bound to target is zero, then INVALID_- OPERATION is generated.
Reference

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just this, basically :)

if self.bound_renderbuffer.get().is_none() {
    self.webgl_error(InvalidOperation);
    return NullValue();
}

@bors-servo
Copy link
Contributor

💔 Test failed - linux-rel-wpt

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Apr 13, 2018
@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 There is new code that needs to be reviewed. label Apr 16, 2018
@fnune fnune force-pushed the add-webgl-get-renderbuffer-parameter branch from 6692241 to 3cefd52 Compare April 16, 2018 16:18
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Apr 16, 2018
@fnune fnune force-pushed the add-webgl-get-renderbuffer-parameter branch from 3cefd52 to a6b6568 Compare April 16, 2018 16:19
@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 add-webgl-get-renderbuffer-parameter branch from a6b6568 to 6b166ce Compare April 16, 2018 16:28
@gootorov
Copy link
Contributor

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

@gootorov
Copy link
Contributor

@bors-servo try

@bors-servo
Copy link
Contributor

⌛ Trying commit 6b166ce with merge 6ef4b98...

bors-servo pushed 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

💔 Test failed - linux-rel-css

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Apr 16, 2018
@nox
Copy link
Contributor

nox commented Apr 17, 2018

r? @nox

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

💔 Test failed - linux-rel-wpt

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Apr 20, 2018
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK, I'm pushing again without the TIMEOUT

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@fnune fnune force-pushed the add-webgl-get-renderbuffer-parameter branch from 4b4c286 to ff95682 Compare April 20, 2018 21:44
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Apr 20, 2018
@gootorov
Copy link
Contributor

@bors-servo try

@bors-servo
Copy link
Contributor

⌛ Trying commit ff95682 with merge ed6b30f...

bors-servo pushed 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

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev
State: approved= try=True

@fnune
Copy link
Contributor Author

fnune commented Apr 21, 2018

Finally 😅

@gootorov
Copy link
Contributor

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

Copy link
Member

@emilio emilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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 add-webgl-get-renderbuffer-parameter branch from ff95682 to a30674a Compare April 24, 2018 16:17
@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

📌 Commit a30674a has been approved by emilio

@highfive highfive assigned emilio and unassigned nox Apr 25, 2018
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. S-needs-rebase There are merge conflict errors. labels Apr 25, 2018
@bors-servo
Copy link
Contributor

⌛ Testing commit a30674a with merge f1a06e0...

bors-servo pushed 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

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev
Approved by: emilio
Pushing f1a06e0 to master...

@bors-servo bors-servo merged commit a30674a into servo:master Apr 25, 2018
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 25, 2018
@fnune fnune deleted the add-webgl-get-renderbuffer-parameter branch April 25, 2018 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement WebGLRenderingContext.getRenderbufferParameter
7 participants