Commit graph

417 commits

Author SHA1 Message Date
Manish Goregaokar
cfa539751c Link to relevant issues 2019-01-03 23:53:50 -08:00
Manish Goregaokar
7e043a33f1 Support fetching viewport info 2018-12-21 14:43:41 -08:00
Anthony Ramine
9a8d03a0f3 Make HTMLCanvasElement::fetch_all_data return a shared memory blob 2018-11-21 12:53:50 +01:00
Anthony Ramine
804d964b7d Send an IpcSharedMemory in tex_image_2d and tex_sub_image_2d
This avoids a copy in the case of textures coming from HTMLImageElement.
2018-11-20 10:14:52 +01:00
Anthony Ramine
cfca906ee2 Call rgba8_byte_swap_colors_inplace on the WebGL thread 2018-11-20 10:14:52 +01:00
Anthony Ramine
2c0acf6b9b Move PixelFormat to the pixels crate 2018-11-20 10:14:52 +01:00
Anthony Ramine
ca62b5c318 Call prepare_pixels on the WebGL thread 2018-11-20 10:14:50 +01:00
Anthony Ramine
5f9e3d8bb9 Move prepare_pixels to canvas_traits::webgl 2018-11-20 10:14:50 +01:00
Anthony Ramine
2a5539caef Use Size2D in TexImage2D and TexSubImage2D messages 2018-11-20 10:14:49 +01:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
bors-servo
34bf312e0c
Auto merge of #22214 - jabedude:validate-argument, r=jdm
Add GetShaderPrecisionFormat argument validation

This patch adds a check on the shader_type argument. If it is not one either
FRAGMENT_SHADER or VERTEX_SHADER, we return INVALID_ENUM.

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

---
<!-- 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] These changes fix  #22080
<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because @jdm wants to wait until the PR is open to test.

<!-- 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. -->

<!-- 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/22214)
<!-- Reviewable:end -->
2018-11-17 16:47:14 -05:00
Josh Abraham
4b5b3c3adb Add GetShaderPrecisionFormat argument validation
This patch adds a check on the shader_type argument. If it is not one either
FRAGMENT_SHADER or VERTEX_SHADER, we return INVALID_ENUM.
2018-11-17 08:18:12 -05:00
Anthony Ramine
af2b4dbc21 Pass a TexPixels value to tex_image_2d and tex_sub_image_2d 2018-11-16 12:43:19 +01:00
Anthony Ramine
947e5afa0c Remove some boolean flags in tex_image_2d and tex_sub_image_2d 2018-11-16 12:42:57 +01:00
Anthony Ramine
1c89ac90b9 Send alignment info directly in TexImage2D and TexSubImage2d messages 2018-11-16 12:39:20 +01:00
Anthony Ramine
1675991b12 Fix the data type sent in tex_sub_image_2d 2018-11-16 12:38:33 +01:00
Anthony Ramine
65d1b11929 Make TexImage2D and TexSubImage2D struct variants 2018-11-16 12:38:07 +01:00
Anthony Ramine
a5779ad372 Prefix some pixels functions with rgba8_ 2018-11-16 12:37:34 +01:00
Anthony Ramine
adf363a208 Move prepare_pixels helper functions to canvas_traits 2018-11-16 12:37:31 +01:00
Anthony Ramine
86987ed75d Introduce TexPixels 2018-11-16 12:18:22 +01:00
Anthony Ramine
1e2a72abfe Call prepare_pixels in tex_image_2d and tex_sub_image_2d 2018-11-16 12:17:07 +01:00
Simon Sapin
9f977c5287 Remove useless use crate_name; imports.
A `crate_name::foo` path always works in 2018
2018-11-08 09:29:52 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Pyfisch
cb07debcb6 Format remaining files 2018-11-06 22:30:31 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
Josh Matthews
e31462c37c Implement WEBGL_color_buffer_float and EXT_color_buffer_half_float (fixes #22113) 2018-11-05 14:13:46 +01:00
Anthony Ramine
8828925f4f Properly support gl_PointSize and gl_PointCoord
Fixes #21719.
Fixes #20993.
Fixes #20992.
Fixes #21007.
Fixes #20979.
2018-10-18 20:15:23 +02:00
bors-servo
7a88a2e28a
Auto merge of #21877 - servo:webgl, r=jdm
Improve some byte-swap and premultiply operations

<!-- 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/21877)
<!-- Reviewable:end -->
2018-10-09 20:15:40 -04:00
Anthony Ramine
6c469b90b1 Share some code between 2D canvas and WebGL 2018-10-09 14:57:02 +02:00
bors-servo
552af0043a
Auto merge of #21785 - sumit0190:new_markasdirty, r=jdm
Add framebuffer check for mark_as_dirty, #21691

<!-- Please describe your changes on the following line: -->
Check `bound_framebuffer` in each `mark_as_dirty` call, so that we don't dirty the canvas if we don't have a bound framebuffer.

---
<!-- 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] These changes fix #21691  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because there isn't a direct way to test it (yet).

<!-- 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. -->

<!-- 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/21785)
<!-- Reviewable:end -->
2018-10-08 21:45:55 -04:00
Anthony Ramine
75e6f5dfaa Avoid copying pixels in ctx.putImageData sometimes 2018-10-06 02:59:25 +02:00
Anthony Ramine
784fbb2bc1 Merge some byte swap/premultiply functions in their own crate 2018-10-06 01:11:55 +02:00
Anthony Ramine
a3392610c3 Make HTMLCanvasElement::get_size return a Size2D<u32>
The changes keep trickling down.
2018-10-02 14:21:06 +02:00
Josh Matthews
5dc80dd07a webgl: Add feature to store backtraces for each WebGL API call for easier debugging. 2018-10-01 10:43:13 +02:00
sumit0190
8148b1b46f Add framebuffer check for mark_as_dirty, #21691 2018-09-24 08:59:00 -04:00
Josh Matthews
46f4b18722
webgl: Restore active texture if it's changed while deleting a texture. 2018-09-21 15:22:12 -04:00
Anthony Ramine
60c93cfabe Validate GLSL names (fixes #21287) 2018-09-20 15:00:47 +02:00
Anthony Ramine
943f95fe47 Remove some misplaced framebuffer validations 2018-09-20 11:31:54 +02:00
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
bors-servo
b1c6281d3c
Auto merge of #21353 - DanxiongLei:damonlei_fix, r=jdm
fix(webgl): fix issue https://github.com/servo/servo/issues/21352

If we have a bounded framebuffer previously, which is not the one to delete.
we would not change the !binding, but we would change the GLSide with Command::BindFramebuffer(Default).

change it to:

check the id before sending the Command

---

- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [x] These changes fix #21352

- [ ] There are tests for these changes OR
- [x] These changes do not require tests because `it's obviously simple.`

<!-- 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/21353)
<!-- Reviewable:end -->
2018-09-19 13:36:24 -04:00
Anthony Ramine
900c3cc6b5 Implement gl.getParameter(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL) 2018-09-18 11:48:34 +02:00
Anthony Ramine
fe6f53ffb4 Fix a small texSubImage2D bug 2018-09-18 10:49:31 +02:00
Anthony Ramine
8c100b23b1 Implement proper origin checks for WebGL textures (fixes #21522) 2018-09-18 10:33:42 +02:00
Anthony Ramine
70a0174b0a Remove a panic due to missing video support 2018-09-14 14:48:41 +02:00
Anthony Ramine
ac822ee2fc Remove erroneous check from CopyTexImage2D
The internal format of the bound texture doesn't matter, what matters is
which components can be found in the framebuffer.
2018-09-13 22:04:29 +02:00
Anthony Ramine
d5f3b211ba Properly support PACK_ALIGNMENT in WebGL 1 2018-09-12 23:45:49 +02:00
Anthony Ramine
452d85005a Simplify WebGLRenderingContext::PixelStorei 2018-09-12 23:45:49 +02:00
bors-servo
26745b2741
Auto merge of #21461 - jdm:webgltmp2, r=nox
Various webgl fixes for framebuffer attachment test

These changes resolve all panics on macOS when running framebuffer-object-attachment.html in headless and headful testing.

---
- [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 OR
- [x] Fixes #13710. Fixes #20570.

<!-- 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/21461)
<!-- Reviewable:end -->
2018-09-12 16:36:08 -04:00
Josh Matthews
bb8d9ba74c webgl: Ensure that depth and stencil attachments are rebound after messing with DEPTH_STENCIL attachments. 2018-09-10 16:31:30 -04:00
Josh Matthews
1b08dd5232 webgl: Move framebuffer initialization logic to WebGL thread. 2018-09-10 16:31:29 -04:00