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 stencil fns for WebGLRenderingContext #10670

Merged
merged 1 commit into from Apr 24, 2016

Conversation

@KiChjang
Copy link
Member

KiChjang commented Apr 17, 2016

Depends on servo/webrender#261.

Closes #10659.


This change is Reviewable

@highfive
Copy link

highfive commented Apr 17, 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
@highfive
Copy link

highfive commented Apr 17, 2016

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!

// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
fn StencilOpSeparate(&self, face: u32, fail: u32, zfail: u32, zpass: u32) {
self.ipc_renderer

This comment has been minimized.

@KiChjang

KiChjang Apr 17, 2016

Author Member

I'm not sure if these methods need to validate their parameters as described here.

This comment has been minimized.

@emilio

emilio Apr 17, 2016

Member

Yes, all parameters should be validated first taking in account the GLES2.0 spec, and later taking in account any details that the WebGL spec could specify.

@jdm
Copy link
Member

jdm commented Apr 17, 2016

r? @emilio

@highfive highfive assigned emilio and unassigned glennw Apr 17, 2016
@@ -1084,6 +1084,48 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
.unwrap()
}

// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
fn StencilFunc(&self, func: u32, ref_: i32, mask: u32) {

This comment has been minimized.

@cbrewster

cbrewster Apr 17, 2016

Member

I think these should validate the func parameter as described here

This comment has been minimized.

@KiChjang

KiChjang Apr 17, 2016

Author Member

In which case, should these functions have a [Throws] WebIDL attribute added to them?

This comment has been minimized.

@emilio

emilio Apr 17, 2016

Member

Nope! WebGL errors are tracked via gl.getError(), not via return values or exceptions.

This comment has been minimized.

@cbrewster

cbrewster Apr 17, 2016

Member

I do not think so, none of the other functions that can result in a WebGL error seem to have a [Throws] WebIDL attribute. Although I am sure @emilio would have a better answer.

@KiChjang KiChjang force-pushed the KiChjang:webgl-stencils branch 3 times, most recently from 0288fde to 8f92097 Apr 18, 2016
@KiChjang
Copy link
Member Author

KiChjang commented Apr 18, 2016

Added checks for enum values with the stencil functions.

_ => return self.webgl_error(InvalidEnum),
}

match fail {

This comment has been minimized.

@dzbarsky

dzbarsky Apr 18, 2016

Member

it might be nice if these were factored out

@KiChjang KiChjang force-pushed the KiChjang:webgl-stencils branch from 8f92097 to 2da487e Apr 18, 2016
@KiChjang
Copy link
Member Author

KiChjang commented Apr 18, 2016

Created a new function for checking stencil op parameters.

@KiChjang KiChjang force-pushed the KiChjang:webgl-stencils branch from 2da487e to 4a16619 Apr 18, 2016
@bors-servo
Copy link
Contributor

bors-servo commented Apr 18, 2016

The latest upstream changes (presumably #10667) made this pull request unmergeable. Please resolve the merge conflicts.

@KiChjang KiChjang force-pushed the KiChjang:webgl-stencils branch 2 times, most recently from 6d767db to 23eac18 Apr 18, 2016
@KiChjang
Copy link
Member Author

KiChjang commented Apr 18, 2016

Is now blocked on #10678.

@KiChjang KiChjang force-pushed the KiChjang:webgl-stencils branch 2 times, most recently from 1fe62f0 to 1107c23 Apr 19, 2016
@KiChjang
Copy link
Member Author

KiChjang commented Apr 19, 2016

Should be ok to review now.

@emilio
Copy link
Member

emilio commented Apr 19, 2016

Looks good to me, I usually prefer the early return approach instead of if else, but feel free to r=me if you think it's not worth the change.

@bors-servo: try


Reviewed 1 of 5 files at r1, 1 of 1 files at r6.
Review status: all files reviewed at latest revision, 3 unresolved discussions.


Comments from Reviewable

@bors-servo
Copy link
Contributor

bors-servo commented Apr 19, 2016

Trying commit 1107c23 with merge 1d0fc27...

bors-servo added a commit that referenced this pull request Apr 19, 2016
Implement stencil fns for WebGLRenderingContext

Depends on servo/webrender#261.

Closes #10659.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10670)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 19, 2016

💔 Test failed - mac-rel-wpt

@jdm
Copy link
Member

jdm commented Apr 22, 2016

It seems likely that #10790 is not actually intermittent and is a permanent failure exposed by the current set of changes.

@jdm
Copy link
Member

jdm commented Apr 22, 2016

Yeah, it's consistently failed on OS X every time there hasn't been a linux failure first.

@emilio
Copy link
Member

emilio commented Apr 22, 2016

That test should be fixed by #10443.

Look at this comment though, to see why new correct implementations can lead to new test failures.

@bors-servo
Copy link
Contributor

bors-servo commented Apr 22, 2016

The latest upstream changes (presumably #10443) made this pull request unmergeable. Please resolve the merge conflicts.

@KiChjang KiChjang force-pushed the KiChjang:webgl-stencils branch from 1107c23 to 2946fbe Apr 24, 2016
@KiChjang
Copy link
Member Author

KiChjang commented Apr 24, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Apr 24, 2016

Trying commit 2946fbe with merge fc1eab7...

bors-servo added a commit that referenced this pull request Apr 24, 2016
Implement stencil fns for WebGLRenderingContext

Depends on servo/webrender#261.

Closes #10659.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10670)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 24, 2016

@KiChjang
Copy link
Member Author

KiChjang commented Apr 24, 2016

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

bors-servo commented Apr 24, 2016

📌 Commit 2946fbe has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Apr 24, 2016

Testing commit 2946fbe with merge 7804173...

bors-servo added a commit that referenced this pull request Apr 24, 2016
Implement stencil fns for WebGLRenderingContext

Depends on servo/webrender#261.

Closes #10659.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10670)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 24, 2016

@bors-servo bors-servo merged commit 2946fbe into servo:master Apr 24, 2016
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@emilio
Copy link
Member

emilio commented Apr 24, 2016

I'd rather have waited for #10806 to land... But well, it landed so... :P

@emilio emilio mentioned this pull request Apr 24, 2016
@KiChjang KiChjang deleted the KiChjang:webgl-stencils branch Jul 24, 2016
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

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