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

Move WebGL validation #20369

Merged
merged 4 commits into from Mar 21, 2018
Merged

Move WebGL validation #20369

merged 4 commits into from Mar 21, 2018

Conversation

@gootorov
Copy link
Contributor

gootorov commented Mar 20, 2018

This moves validation from canvas/webgl_thread to dom/webglrenderingcontext for consistency and speed and simplifies it where it is possible.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #__ (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because: refactoring

This change is Reviewable

@highfive
Copy link

highfive commented Mar 20, 2018

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/webglrenderingcontext.rs
  • @fitzgen: components/script/dom/webglrenderingcontext.rs
  • @KiChjang: components/script/dom/webglrenderingcontext.rs
@highfive
Copy link

highfive commented Mar 20, 2018

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@gootorov
Copy link
Contributor Author

gootorov commented Mar 20, 2018

r? @emilio

gl::TEXTURE_WRAP_S |
gl::TEXTURE_WRAP_T => {
let parameter = gl.get_tex_parameter_iv(target, pname);
if parameter == 0 {

This comment has been minimized.

Copy link
@gootorov

gootorov Mar 20, 2018

Author Contributor

Note: I didn't find in the spec that it shouldn't be 0. Can we double check that?

This comment has been minimized.

Copy link
@emilio

emilio Mar 20, 2018

Member

Can you file a separate issue for this? Let's keep this PR for the refactor I'd say, that makes it more straight-forward to land :)

This comment has been minimized.

Copy link
@gootorov

gootorov Mar 20, 2018

Author Contributor

Sure!

@emilio
emilio approved these changes Mar 20, 2018
Copy link
Member

emilio left a comment

Looks good, thanks!

gl::TEXTURE_WRAP_S |
gl::TEXTURE_WRAP_T => {
let parameter = gl.get_tex_parameter_iv(target, pname);
if parameter == 0 {

This comment has been minimized.

Copy link
@emilio

emilio Mar 20, 2018

Member

Can you file a separate issue for this? Let's keep this PR for the refactor I'd say, that makes it more straight-forward to land :)

constants::HIGH_FLOAT |
constants::LOW_INT |
constants::MEDIUM_INT |
constants::HIGH_INT => true,

This comment has been minimized.

Copy link
@emilio

emilio Mar 20, 2018

Member

For a single validation that doesn't duplicate code, I'd remove the variable entirely and do:

match precision_type {
    FOO | BAR | BAZ => {},
    _ => {
        self.webgl_error(InvalidEnum);
        return None;
    }
}

wdyt?

This comment has been minimized.

Copy link
@gootorov

gootorov Mar 20, 2018

Author Contributor

Yeah, I was thinking of that too. Let's do it this way then.

@emilio
Copy link
Member

emilio commented Mar 20, 2018

If you want to fix that nit please do, otherwise just say [at]bors-servo r=emilio when ready.

Thank you!

@bors-servo delegate+

@bors-servo
Copy link
Contributor

bors-servo commented Mar 20, 2018

✌️ @gootorov can now approve this pull request

@gootorov gootorov force-pushed the gootorov:move-validation branch from 86aa60a to bdd53f3 Mar 20, 2018
@gootorov
Copy link
Contributor Author

gootorov commented Mar 20, 2018

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

bors-servo commented Mar 20, 2018

📌 Commit bdd53f3 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Mar 20, 2018

Testing commit bdd53f3 with merge f92f080...

bors-servo added a commit that referenced this pull request Mar 20, 2018
Move WebGL validation

This moves validation from `canvas/webgl_thread` to `dom/webglrenderingcontext` for consistency and speed and simplifies it where it is possible.

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

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

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

bors-servo commented Mar 20, 2018

💔 Test failed - android

@emilio
Copy link
Member

emilio commented Mar 21, 2018

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Mar 21, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Mar 21, 2018

@bors-servo bors-servo merged commit bdd53f3 into servo:master Mar 21, 2018
1 of 3 checks passed
1 of 3 checks passed
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
homu Test successful
Details
@gootorov gootorov deleted the gootorov:move-validation branch Mar 21, 2018
@bors-servo bors-servo mentioned this pull request Mar 21, 2018
3 of 4 tasks complete
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.

None yet

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