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

Issue #8738: bufferSubData and texImage2D argument sanity checks. #8948

Merged
merged 1 commit into from Dec 29, 2015

Conversation

@simartin
Copy link
Contributor

simartin commented Dec 12, 2015

Fixes #8738

Review on Reviewable

@frewsxcv
Copy link
Member

frewsxcv commented Dec 12, 2015

components/script/dom/webglrenderingcontext.rs, line 931 [r1] (raw file):
could this just be if self.bound_texture_for(target).is_none() { ?


Comments from the review on Reviewable.io

@simartin
Copy link
Contributor Author

simartin commented Dec 12, 2015

components/script/dom/webglrenderingcontext.rs, line 931 [r1] (raw file):
You're right, it's more readable. PR update coming up.


Comments from the review on Reviewable.io

@simartin simartin force-pushed the simartin:issue_8738 branch 3 times, most recently from f34d18c to 6346356 Dec 12, 2015
@simartin simartin changed the title Issue #8378: bufferSubData and texImage2D argument sanity checks. Issue #8738: bufferSubData and texImage2D argument sanity checks. Dec 12, 2015
@simartin simartin force-pushed the simartin:issue_8738 branch from 6346356 to 63dd422 Dec 12, 2015
@nox nox assigned frewsxcv and unassigned frewsxcv Dec 13, 2015
@bors-servo
Copy link
Contributor

bors-servo commented Dec 14, 2015

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

@emilio
Copy link
Member

emilio commented Dec 14, 2015

Review status: 0 of 4 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed.


components/script/dom/webglrenderingcontext.rs, line 931 [r1] (raw file):
Good catch here :)


components/script/dom/webglrenderingcontext.rs, line 84 [r2] (raw file):
I think the allocated size should be part of the WebGLBuffer object itself, something similar to what we do with the target field.
What would happen if you re-bind a buffer with data already allocated?


components/script/dom/webglrenderingcontext.rs, line 401 [r2] (raw file):
We probably should move almost all this logic to webglbuffer.rs, to a function with a signature like:

pub fn buffer_data(&self, target: u32, data: Vec<u8>, usage: u32) -> WebGLResult<()>;

Where the new size size should be updated.

And leave this function with just the validations and something like:

handle_potential_webgl_error!(self.buffer_data(target, data, usage));

components/script/dom/webglrenderingcontext.rs, line 460 [r2] (raw file):
Same as above, this logic should be moved to the WebGLBuffer object.


Comments from the review on Reviewable.io

@simartin simartin force-pushed the simartin:issue_8738 branch from 63dd422 to e602a3f Dec 26, 2015
@simartin
Copy link
Contributor Author

simartin commented Dec 26, 2015

Thanks for the review! I've taken your comments into account and rebased.


Comments from the review on Reviewable.io

@simartin simartin force-pushed the simartin:issue_8738 branch 2 times, most recently from e65c90b to 45cbb18 Dec 26, 2015
@emilio
Copy link
Member

emilio commented Dec 26, 2015

Looks good to me, modulo those little changes :)

-S-awaiting-review +S-needs-code-changes


Review status: 0 of 6 files reviewed at latest revision, 6 unresolved discussions.


components/script/dom/webglbuffer.rs, line 21 [r3] (raw file):
I'd prefer this to be called allocated_size or capacity, it looks clearer to me, but it's a matter of taste so if you think it's fine, it can remain this way.


components/script/dom/webglbuffer.rs, line 79 [r3] (raw file):
Please send the message to the renderer here instead of doing it in BufferData.


components/script/dom/webglrenderingcontext.rs, line 186 [r3] (raw file):
There's a PR to handle this a bit more cleanly (#8970) and avoid repeating us too much, but I'll rebase it if this lands before so no problem :)


components/script/dom/webglrenderingcontext.rs, line 492 [r3] (raw file):
This should be InvalidOperation instead of InvalidValue.


components/script/dom/webglrenderingcontext.rs, line 501 [r3] (raw file):
Maybe this could use the byte_array_to_slice function?


Comments from the review on Reviewable.io

@simartin
Copy link
Contributor Author

simartin commented Dec 26, 2015

@simartin
Copy link
Contributor Author

simartin commented Dec 26, 2015

@simartin
Copy link
Contributor Author

simartin commented Dec 26, 2015

Thanks for the review. Update is coming up.


Comments from the review on Reviewable.io

@simartin simartin force-pushed the simartin:issue_8738 branch from 45cbb18 to f2fe401 Dec 26, 2015
@jdm
Copy link
Member

jdm commented Dec 27, 2015

@bors-servo: delegate=ecoal95

@bors-servo
Copy link
Contributor

bors-servo commented Dec 27, 2015

✌️ @ecoal95 can now approve this pull request

@emilio
Copy link
Member

emilio commented Dec 29, 2015

@bors-servo: r+

Nice work, thanks @simartin!

-S-awaiting-review +S-awaiting-merge


Reviewed 1 of 2 files at r2, 2 of 5 files at r3, 1 of 1 files at r4, 2 of 2 files at r5.
Review status: all files reviewed at latest revision, 3 unresolved discussions.


Comments from the review on Reviewable.io

@bors-servo
Copy link
Contributor

bors-servo commented Dec 29, 2015

📌 Commit f2fe401 has been approved by ecoal95

@bors-servo
Copy link
Contributor

bors-servo commented Dec 29, 2015

Testing commit f2fe401 with merge c1cb940...

bors-servo added a commit that referenced this pull request Dec 29, 2015
Issue #8738: bufferSubData and texImage2D argument sanity checks.

Fixes #8738

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8948)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Dec 29, 2015

@bors-servo bors-servo merged commit f2fe401 into servo:master Dec 29, 2015
2 of 3 checks passed
2 of 3 checks passed
code-review/reviewable Review in progress: all files reviewed, 3 unresolved discussions
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@simartin simartin deleted the simartin:issue_8738 branch Dec 29, 2015
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

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