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
Anthony Ramine
0579fbe4fa
Use WebGLResult for returns of instanced draw methods
2018-09-06 10:41:58 +02:00
Anthony Ramine
900a19058e
Support unions of objects in overloads
...
Part of #20513 , implementing the parts useful for WebGL.
2018-08-30 16:15:40 +02:00
Anthony Ramine
4cf944eab8
Fix gl.isBuffer for buffers that are marked for deletion but still attached
2018-08-30 16:15:39 +02:00
Anthony Ramine
7b673de4d6
Always emit INVALID_OPERATION on null element buffers in drawElements
2018-08-30 16:15:39 +02:00
Anthony Ramine
0ba66f9f12
Fix the error for invalid arrays passed to gl.vertexAttrib*v()
2018-08-30 16:15:38 +02:00
Simon Sapin
1333b6ee45
Fix the build for NLL
...
Test with `RUSTFLAGS="-Zborrowck=mir -Ztwo-phase-borrows" cargo build`
https://internals.rust-lang.org/t/help-us-get-non-lexical-lifetimes-nll-over-the-finish-line/7807/7
2018-08-24 17:49:58 +02:00
Anthony Ramine
8b1c753c6c
Properly check limit in gl.activeTexture()
2018-08-23 15:15:33 +02:00