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

Rewrite WebGLRenderingContext to use typed array APIs #15267

Conversation

@yysung1123
Copy link
Contributor

yysung1123 commented Jan 27, 2017

Rewrite WebGLRenderingContext to use typed array APIs


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #14676

This change is Reviewable

@highfive
Copy link

highfive commented Jan 27, 2017

Heads up! This PR modifies the following files:

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

highfive commented Jan 27, 2017

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify script code, but no tests are modified. Please consider adding a test!
@yysung1123 yysung1123 force-pushed the yysung1123:Rewrite-WebGLRenderingContext-to-use-typed-array-APIs branch 3 times, most recently from 8aa74df to 366b0e6 Jan 29, 2017
@yysung1123 yysung1123 force-pushed the yysung1123:Rewrite-WebGLRenderingContext-to-use-typed-array-APIs branch from 366b0e6 to 807adc6 Feb 1, 2017
@mbrubeck
Copy link
Contributor

mbrubeck commented Feb 1, 2017

r? @jdm

@highfive highfive assigned jdm and unassigned mbrubeck Feb 1, 2017
@jdm jdm mentioned this pull request Feb 2, 2017
4 of 4 tasks complete
Copy link
Member

jdm left a comment

I'm leaving these review comments for posterity; the changes necessary to support typed arrays in the typed array/sequence conversion function were complicated enough that I had to do a bunch of experimentation.

@@ -588,10 +589,6 @@ unsafe fn typed_array_or_sequence_to_vec<T>(cx: *mut JSContext,
<T as FromJSValConvertible>::Config: Clone,
{
assert!(!sequence_or_abv.is_null());
if let Some(v) = array_buffer_view_to_vec_checked::<T>(sequence_or_abv) {
return Ok(v);
}

This comment has been minimized.

@jdm

jdm Feb 2, 2017

Member

This looks like we no longer can deal with passing typed arrays to this function.

typedarray!(in(_cx) let array_buffer: ArrayBuffer = data);
let data_vec = match array_buffer {
Ok(mut data) => data.as_slice().to_vec(),
Err(_) => try!(fallible_array_buffer_view_to_vec(_cx, data)),

This comment has been minimized.

@jdm

jdm Feb 2, 2017

Member

Rename _cx to cx since it's used now (and in all other methods that use it after these changes).

@jdm
Copy link
Member

jdm commented Feb 2, 2017

I addressed my review comments in #15352, which now needs someone else to review the latest commit.

@jdm jdm closed this Feb 2, 2017
bors-servo added a commit that referenced this pull request Feb 2, 2017
…-array-APIs, r=jdm,emilio

Rewrite WebGLRenderingContext to use typed array APIs

Rewrite WebGLRenderingContext to use typed array APIs. Based on #15267.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14676
- [X] There are tests for these changes

<!-- 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/15352)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this pull request Feb 10, 2017
…-array-APIs, r=jdm

Rewrite WebGLRenderingContext to use typed array APIs

Rewrite WebGLRenderingContext to use typed array APIs. Based on #15267.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14676
- [X] There are tests for these changes

<!-- 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/15352)
<!-- Reviewable:end -->
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.

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