Commit graph

544 commits

Author SHA1 Message Date
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
Josh Matthews
df8e36aa78 webgl: Differentiate between missing colour attachments and incomplete attachments. 2018-09-10 16:31:28 -04:00
Josh Matthews
d179435eab webgl: Ensure that framebuffers have a color attachment before reading or writing. 2018-09-10 15:56:15 -04:00
Anthony Ramine
dac7740b8c Reuse input buffer for RGB/UNSIGNED_BYTE in rgba8_image_to_tex_image_data 2018-09-10 14:13:23 +02:00
Anthony Ramine
e1486f7d71 Reuse input vector for LUMINANCE_ALPHA/HALF_FLOAT 2018-09-10 12:43:38 +02:00
Anthony Ramine
7e7441749b Fix the remaining LUMINANCE* cases in rgba8_image_to_tex_image_data 2018-09-10 12:41:57 +02:00
Anthony Ramine
6d3609dbe8 Fix the UNSIGNED_SHORT_4_4_4_4 case of premultiply_pixels 2018-09-09 12:22:01 +02:00
Anthony Ramine
d8b7394fa3 Fix the UNSIGNED_SHORT_5_5_5_1 case of premultiply_pixels 2018-09-09 12:21:56 +02:00
Anthony Ramine
f726f18291 Remove some useless argument mutability
I wonder why this doesn't trigger a warning.
2018-09-09 12:21:55 +02:00
Anthony Ramine
e61c7b757f Fix the LUMINANCE of rgba8_image_to_tex_image_data
The internal format and format values match, thus the canvas or image input
must be interpreted as already in LUMINANCE format.
2018-09-09 12:21:54 +02:00
Anthony Ramine
9a362391d5 Fix the LUMINANCE_ALPHA case of rgba8_image_to_tex_image_data
The internal format and format values match, thus the canvas or image input
must be interpreted as already in LUMINANCE_ALPHA format.
2018-09-09 12:21:54 +02:00
Anthony Ramine
74e6f40abe Reuse the input vector in more cases of rgba8_image_to_tex_image_data 2018-09-08 18:21:45 +02:00
Anthony Ramine
6a692228fc Fix the ALPHA/FLOAT case of rgba8_image_to_tex_image_data
I'm pretty sure this is supposed to write the ALPHA component.
2018-09-08 18:06:51 +02:00
Anthony Ramine
e192e4d97f Reuse input of rgba8_image_to_tex_image_data in some cases 2018-09-08 13:42:07 +02:00
Anthony Ramine
27951bb7c8 Make rgba8_image_to_tex_image_data not overallocate in some case 2018-09-08 13:42:07 +02:00
Anthony Ramine
145086e150 Make rgba8_image_to_tex_image_data a free-standing function 2018-09-08 13:42:06 +02:00
Anthony Ramine
a5f9d03229 Make remove_premultiplied_alpha mutate its input 2018-09-08 13:42:06 +02:00
Anthony Ramine
1864edbb36 Make premultiply_pixels mutate its input 2018-09-08 13:42:06 +02:00
Anthony Ramine
4bd8efa49e Use byte channels to send textures to the WebGL thread 2018-09-08 13:42:06 +02:00
Anthony Ramine
408e540c55 Use ipc::bytes_channel in ReadPixels 2018-09-08 13:42:06 +02:00
Anthony Ramine
4e9281dcbf Simplify WebGLRenderingContext::get_image_data 2018-09-08 13:42:06 +02:00
Anthony Ramine
9f924013bc Use a bytes channel in BufferData
This means we don't need to copy the input ArrayBuffer at all on the DOM side.
2018-09-07 11:28:59 +02:00
Anthony Ramine
1293692ef8 Simplify WebGLBuffer::buffer_data
There is no need to pass the target to that buffer method, given the buffer
has been retrieved by looking up the one bound to that target in the context.
2018-09-07 11:28:11 +02:00
Anthony Ramine
5a206d5137 Make validate_framebuffer return a WebGLResult<()> 2018-09-06 11:25:22 +02:00