servo/components/script
bors-servo afbcbf75ea
Auto merge of #24473 - mmatyas:webgl_fns_buffer, r=jdm
Implement the basic WebGL2 buffer data operations

Adds support for the WebGL2 calls `bufferData`, `bufferSubData`, `copyBufferSubData` and `getBufferSubData`.

Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.3

---

<!-- Please describe your changes on the following line: -->

This patch depends on https://github.com/servo/sparkle/pull/8. Some tests cause a crash for me at the moment, as they depend on other, not yet implemented buffer calls and transform feedback objects.

As for the code, there are a few parts I'm not sure about:

- To get the element byte size of a TypedArray I've wrote a simple `match`, as the relevant field is not published in `rust-mozjs`. Is that okay or there's some other way to get this already?
- The WebGL1 BufferData implementations were copied into the WebGL2 code as a workaround, due to the difference in the available buffer slots (ie. `self.bound_buffer`). An alternative could be is to pass this function and self as parameters to an internal buffer data implementation function, but personally I found that code to be quite ugly.

cc @jdm @zakorgy

---
<!-- 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 (with the sparkle patch)
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

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

<!-- 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. -->
2019-11-05 16:52:51 -05:00
..
docs
dom Auto merge of #24473 - mmatyas:webgl_fns_buffer, r=jdm 2019-11-05 16:52:51 -05:00
task_source continue messageport, transferable, postmessage options 2019-10-19 14:28:18 +08:00
body.rs
build.rs Update rand to 0.7 (fixes #24448) 2019-10-23 15:34:48 +02:00
canvas_state.rs Return false from CanvasState::IsPointInPath for NaN/infinite values 2019-10-28 17:43:24 +01:00
Cargo.toml Update rand to 0.7 (fixes #24448) 2019-10-23 15:34:48 +02:00
clipboard_provider.rs
compartments.rs
devtools.rs
document_loader.rs
fetch.rs Add simple implementation of content-security-policy on scripts / styles 2019-10-16 19:46:45 +00:00
image_listener.rs
init.rs Move items at the root of the script crate to a module 2019-10-26 12:59:17 +02:00
layout_image.rs
lib.rs Upgrade to rustc 1.40.0-nightly (246be7e1a 2019-10-25) 2019-10-26 13:03:49 +02:00
mem.rs
microtask.rs
network_listener.rs
script_runtime.rs Add StreamConsumer wrapper and ReportStreamErrorCallback fn 2019-11-03 03:41:41 -05:00
script_thread.rs continue messageport, transferable, postmessage options 2019-10-19 14:28:18 +08:00
serviceworker_manager.rs continue messageport, transferable, postmessage options 2019-10-19 14:28:18 +08:00
serviceworkerjob.rs
stylesheet_loader.rs Support CORS attributes for image elements. 2019-10-04 15:08:40 -04:00
stylesheet_set.rs
task.rs
task_manager.rs begin messageport, transferable objects, impl 2019-10-19 14:12:22 +08:00
task_queue.rs
test.rs
textinput.rs
timers.rs update timer scheduler to use crossbeam 2019-10-20 23:42:34 +08:00
unpremultiplytable.rs
webdriver_handlers.rs