aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/task_source/media_element.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-11-26 12:31:15 -0500
committerGitHub <noreply@github.com>2019-11-26 12:31:15 -0500
commit8e0aa68aaafd96abc589f185f7f863f96c553e26 (patch)
treed8970d450821ca7c86745436a1b17310bd428771 /components/script/task_source/media_element.rs
parent7a72f8a1686cae4d710266b4ac50a646046907b0 (diff)
parent8fefa230197452347a97554307f2629b07780916 (diff)
downloadservo-8e0aa68aaafd96abc589f185f7f863f96c553e26.tar.gz
servo-8e0aa68aaafd96abc589f185f7f863f96c553e26.zip
Auto merge of #24783 - mmatyas:webgl_fns_readpixels, r=nox
Add support for WebGL2 ReadPixels functions Adds support for the new ReadPixels functions introduced with WebGL2 and the relevant PixelStorei parameters.. Reference: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.10 <!-- Please describe your changes on the following line: --> --- This is a work in progress patch, but I think it might be ready for comments. There are a few issues left: - When the target is the pixel pack buffer, the GL function expects a byte offset as a pointer. In Sparkle the `read_pixels` functions return/work on top of arrays, so for now I've made a [workaround patch](https://github.com/mmatyas/sparkle/commit/45d8bb263d87edcf6c2608fe14d717430025fdc2). I wonder if that's okay or should we do it somehow differently? - When writing to the pixel pack buffer, padding bytes on the destination are properly ignored. When writing to client buffers, Sparkle `read_pixels` returns a buffer with 1 byte alignment, which I think is fine (less stuff to move between threads), but requires positioning the rows manually (see the bottom of `read_pixels_into` vs. `ReadPixels_`). - There are some duplicated code between the array buffer and pixel pack buffer variants, eg. the detection of intersection with the framebuffer. This could be refactored, but that results in a function with `Result<Option<Rect<u32>>, WebGLError>`, which I'm not sure is readable enough to help. - There is a duplication with the WebGL1 code. WebGL2 introduces row length, skip pixels and skip rows as pixel pack parameters which affect the ReadPixels operation. The helper functions could be moved to be usable in WebGL1, but then these new modifiers would also need to be passed as a function parameter, which is somewhat ugly (but would work). What's your opinion about this? 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 - [x] `./mach test-tidy` does not report any errors - [x] There are tests for these changes <!-- 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. -->
Diffstat (limited to 'components/script/task_source/media_element.rs')
0 files changed, 0 insertions, 0 deletions