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 WebGLRenderingContext::isEnabled #13337

Merged
merged 1 commit into from Sep 22, 2016

Conversation

@ofekd
Copy link
Contributor

ofekd commented Sep 20, 2016

Implemented WebGLRenderingContext::isEnabled

  • Please note the return value of the implementation, not sure about returning false on InvalidEnum.
  • the webgl/conformance-1.0.3/conformance/state/gl-enable-enum-test.html wpt test is disabled on linux but was enabled on my machine and run to validate expectations.
  • the /webgl/conformance-1.0.3/conformance/context/methods.html test is disabled everywhere. Enabling and running on my machine showed incorrect expectations beyond isEnabled. The test was temporarily edited to test just for isEnabled and it ran successfully.

  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #13040
  • There are tests for these changes (please read details above)
  • These changes do not require tests because _____

This change is Reviewable

@highfive
Copy link

highfive commented Sep 20, 2016

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @emilio (or someone else) soon.

@highfive
Copy link

highfive commented Sep 20, 2016

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/webglrenderingcontext.rs, components/script/dom/webidls/WebGLRenderingContext.webidl
  • @emilio: components/script/dom/webglrenderingcontext.rs
@ofekd ofekd force-pushed the ofekd:implement-webgl-isEnabled branch from a6580eb to d379683 Sep 20, 2016
@jdm
Copy link
Member

jdm commented Sep 20, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Sep 20, 2016

Trying commit d379683 with merge bcc9508...

bors-servo added a commit that referenced this pull request Sep 20, 2016
Implement WebGLRenderingContext::isEnabled

Implemented WebGLRenderingContext::isEnabled

- Please note the return value of the implementation, not sure about returning `false` on `InvalidEnum`.
- the `webgl/conformance-1.0.3/conformance/state/gl-enable-enum-test.html` wpt test is disabled on linux but was enabled on my machine and run to validate expectations.
- the `/webgl/conformance-1.0.3/conformance/context/methods.html` test is disabled everywhere. Enabling and running on my machine showed incorrect expectations beyond `isEnabled`. The test was temporarily edited to test just for `isEnabled` and it ran successfully.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13040

- [X] There are tests for these changes (please read details above)
- [ ] These changes do not require tests because _____

<!-- 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/13337)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 20, 2016

💔 Test failed - mac-rel-wpt

@highfive
Copy link

highfive commented Sep 20, 2016

  ▶ TIMEOUT [expected OK] /webgl/conformance-1.0.3/conformance/textures/origin-clean-conformance.html
@jdm
Copy link
Member

jdm commented Sep 20, 2016

@bors-servo: retry

@bors-servo
Copy link
Contributor

bors-servo commented Sep 20, 2016

Trying commit d379683 with merge bc4189f...

bors-servo added a commit that referenced this pull request Sep 20, 2016
Implement WebGLRenderingContext::isEnabled

Implemented WebGLRenderingContext::isEnabled

- Please note the return value of the implementation, not sure about returning `false` on `InvalidEnum`.
- the `webgl/conformance-1.0.3/conformance/state/gl-enable-enum-test.html` wpt test is disabled on linux but was enabled on my machine and run to validate expectations.
- the `/webgl/conformance-1.0.3/conformance/context/methods.html` test is disabled everywhere. Enabling and running on my machine showed incorrect expectations beyond `isEnabled`. The test was temporarily edited to test just for `isEnabled` and it ran successfully.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13040

- [X] There are tests for these changes (please read details above)
- [ ] These changes do not require tests because _____

<!-- 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/13337)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 20, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Sep 20, 2016

Trying commit d379683 with merge 0891ab1...

bors-servo added a commit that referenced this pull request Sep 20, 2016
Implement WebGLRenderingContext::isEnabled

Implemented WebGLRenderingContext::isEnabled

- Please note the return value of the implementation, not sure about returning `false` on `InvalidEnum`.
- the `webgl/conformance-1.0.3/conformance/state/gl-enable-enum-test.html` wpt test is disabled on linux but was enabled on my machine and run to validate expectations.
- the `/webgl/conformance-1.0.3/conformance/context/methods.html` test is disabled everywhere. Enabling and running on my machine showed incorrect expectations beyond `isEnabled`. The test was temporarily edited to test just for `isEnabled` and it ran successfully.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13040

- [X] There are tests for these changes (please read details above)
- [ ] These changes do not require tests because _____

<!-- 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/13337)
<!-- Reviewable:end -->
@jdm jdm removed the S-tests-failed label Sep 20, 2016
@bors-servo
Copy link
Contributor

bors-servo commented Sep 20, 2016

💔 Test failed - linux-rel

@jdm
Copy link
Member

jdm commented Sep 21, 2016

Filed #13342 for that crash.

@emilio
emilio approved these changes Sep 21, 2016
constants::BLEND | constants::CULL_FACE | constants::DEPTH_TEST | constants::DITHER |
constants::POLYGON_OFFSET_FILL | constants::SAMPLE_ALPHA_TO_COVERAGE | constants::SAMPLE_COVERAGE |
constants::SAMPLE_COVERAGE_INVERT | constants::SCISSOR_TEST => {
let (sender, receiver) = ipc::channel().unwrap();

This comment has been minimized.

Copy link
@emilio

emilio Sep 21, 2016

Member

Can you write a comment here in the lines of:

// TODO: We could write this without the need of IPC if needed, recording the calls to `enable` and `disable`.

This is more than fine for now though, thanks for doing this!

r=me with that.

This comment has been minimized.

Copy link
@emilio

emilio Sep 21, 2016

Member

Oh, also, bonus points would be factoring out the constants with enable and disable, but that can also be a later refactoring :)

This comment has been minimized.

Copy link
@ofekd

ofekd Sep 21, 2016

Author Contributor

Hi @emilio, Can you elaborate a bit more about factoring out the constants? I'll try and do that.

Thanks

@emilio
Copy link
Member

emilio commented Sep 21, 2016

It would be something like making a method called validate_feature_enum,
for example, that checks the enum and returns true if the constant is one
of the valid ones, or false (setting an invalid enum error) in case it's
not.

You would call this function from the three sites instead of doing the
match in all three.

Thank you! :)

On Sep 21, 2016 1:58 PM, "ofekd" notifications@github.com wrote:

@ofekd commented on this pull request.

In components/script/dom/webglrenderingcontext.rs
#13337:

@@ -1399,6 +1399,25 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
buffer.map_or(false, |buf| buf.target().is_some() && !buf.is_deleted())
}

  • // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
  • fn IsEnabled(&self, cap: u32) -> bool {
  •    match cap {
    
  •        constants::BLEND | constants::CULL_FACE | constants::DEPTH_TEST | constants::DITHER |
    
  •        constants::POLYGON_OFFSET_FILL | constants::SAMPLE_ALPHA_TO_COVERAGE | constants::SAMPLE_COVERAGE |
    
  •        constants::SAMPLE_COVERAGE_INVERT | constants::SCISSOR_TEST => {
    
  •            let (sender, receiver) = ipc::channel().unwrap();
    

Hi @emilio https://github.com/emilio, Can you elaborate a bit more
about factoring the the constants? I'll try and do that.

Thanks


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#13337, or mute the thread
https://github.com/notifications/unsubscribe-auth/ABQwulwAckV-P4DhVC15VI3CKWKD9JWEks5qsRvdgaJpZM4KB3Lh
.

@ofekd ofekd force-pushed the ofekd:implement-webgl-isEnabled branch from d379683 to ee149cd Sep 22, 2016
@ofekd
Copy link
Contributor Author

ofekd commented Sep 22, 2016

@bors-servo r=emilio

@KiChjang
Copy link
Member

KiChjang commented Sep 22, 2016

@ofekd Sorry, bors-servo only listens to reviewers.

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

bors-servo commented Sep 22, 2016

📌 Commit ee149cd has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Sep 22, 2016

Testing commit ee149cd with merge f09595e...

bors-servo added a commit that referenced this pull request Sep 22, 2016
Implement WebGLRenderingContext::isEnabled

Implemented WebGLRenderingContext::isEnabled

- Please note the return value of the implementation, not sure about returning `false` on `InvalidEnum`.
- the `webgl/conformance-1.0.3/conformance/state/gl-enable-enum-test.html` wpt test is disabled on linux but was enabled on my machine and run to validate expectations.
- the `/webgl/conformance-1.0.3/conformance/context/methods.html` test is disabled everywhere. Enabling and running on my machine showed incorrect expectations beyond `isEnabled`. The test was temporarily edited to test just for `isEnabled` and it ran successfully.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13040

- [X] There are tests for these changes (please read details above)
- [ ] These changes do not require tests because _____

<!-- 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/13337)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 22, 2016

@bors-servo bors-servo merged commit ee149cd into servo:master Sep 22, 2016
1 of 3 checks passed
1 of 3 checks passed
continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr AppVeyor build failed
Details
homu Test successful
Details
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.

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