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
87c849c0d6
Move prepare_pixels to the canvas thread
...
Nothing else uses it in the whole crate graph.
2018-11-20 10:14:51 +01:00
Anthony Ramine
ca62b5c318
Call prepare_pixels on the WebGL thread
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
1d6fe65401
Update MPL license to https (part 4)
2018-11-19 14:47:27 +01:00
Anthony Ramine
1c89ac90b9
Send alignment info directly in TexImage2D and TexSubImage2d messages
2018-11-16 12:39:20 +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
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
Simon Sapin
2012be4a8b
cargo fix --edition-idioms
2018-11-08 09:28:00 +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
9f9bf8f6bc
Switch most crates to the 2018 edition
2018-11-06 16:12:04 +01:00
Simon Sapin
76e59a46d3
Sort use
statements
2018-11-06 15:26:02 +01:00
Simon Sapin
45f7199eee
cargo fix --edition
2018-11-06 15:26:02 +01:00
Emilio Cobos Álvarez
29f56919e2
Update remaining references to cssparser 0.24.
2018-11-05 12:33:37 +01:00
bors-servo
8aded34bf6
Auto merge of #21914 - Eijebong:canvas-cleanup, r=jdm
...
Use pixels::get_rect in CanvasData::draw_image
Those functions are the same except that get_rect isn't failible, so we
have to check that the rect we want is actually in the image.
<!-- 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/21914 )
<!-- Reviewable:end -->
2018-11-01 03:29:06 -04:00
Paul Rouget
cdf22c1493
Exit Canvas paint thread on shutdown
2018-10-29 11:06:06 +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
Bastien Orivel
c2be78b3fe
Use pixels::get_rect in CanvasData::draw_image
...
Those functions are the same except that get_rect isn't failible, so we
have to check that the rect we want is actually in the image.
2018-10-12 19:57:26 +02:00
bors-servo
7e78edcff9
Auto merge of #21725 - pyfisch:update-wr, r=jdm
...
Update Webrender
New version is
9156a4465f6ad715a0206cdd9a7e9a6f0385fbd6
---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because just updating WR
<!-- 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/21725 )
<!-- Reviewable:end -->
2018-10-12 12:49:23 -04:00
Anthony Ramine
bb2101f540
Simplify ctx.drawImage a bit
...
There is no need to swap between RGBA and BGRA twice.
2018-10-11 15:46:42 +02:00
Pyfisch
d13172845c
Update Webrender
...
New version is
9156a4465f6ad715a0206cdd9a7e9a6f0385fbd6
2018-10-09 18:23:18 -04:00
Anthony Ramine
c53db64e63
Return input as is when there is no cropping to be done
2018-10-09 14:57:04 +02:00
Anthony Ramine
2bf4fcd9bd
Remove some condition in CanvasData::write_image
...
The surface creation should never fail.
2018-10-09 14:57:04 +02:00
Anthony Ramine
6c469b90b1
Share some code between 2D canvas and WebGL
2018-10-09 14:57:02 +02:00
Anthony Ramine
77c28bdfc9
Abstract some stuff common to ctx.getImageData and ctx.putImageData
2018-10-08 11:39:09 +02:00
Anthony Ramine
e62dbabb46
Handle some transparent black cases in ctx.getImageData
2018-10-07 02:52:06 +02:00
Anthony Ramine
241dba064d
Align ctx.createImageData and ctx.getImageData with the spec
2018-10-06 11:41:48 +02:00
Anthony Ramine
f13e35b2c5
Always make sure we get a surface in CanvasData::put_image_data
2018-10-06 10:53:10 +02:00
Anthony Ramine
75e6f5dfaa
Avoid copying pixels in ctx.putImageData sometimes
2018-10-06 02:59:25 +02:00
Anthony Ramine
19f40cdf0b
Introduce ImageData::get_rect
...
We use that to send only the pixels that will be actually drawn to the
canvas thread in CanvasRenderingContext2d::PutImageData.
We also make the canvas thread byte swap and premultiply colours in-place.
2018-10-06 01:12:05 +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
82c7d71811
Improve gl.putImageData
...
This commit should allow us to send smaller blobs to the canvas thread,
I made it into its own commit just to try=wpt.
2018-10-05 17:07:58 +02:00
Anthony Ramine
3d910feb3a
Align canvas.putImageData with spec
...
The arguments are supposed to be long values, not floats.
2018-10-05 17:07:56 +02:00
Anthony Ramine
62ea3c093a
Move canvas.putImageData checks to the DOM side
2018-10-05 00:35:39 +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
Anthony Ramine
426067069c
Clean up ToAzurePattern for FillOrStrokeStyle
2018-10-02 14:21:06 +02:00
Anthony Ramine
99b6091b7a
Clean up create_webgl_context
2018-10-02 14:21:06 +02:00
bors-servo
57053e03bb
Auto merge of #21825 - jdm:backtrace-helpers, r=Manishearth
...
Optional backtraces for JS errors and WebGL errors
This adds two new build-time features to enable useful debugging tools when investigating why JS and WebGL content isn't working. They're optional because they're quite heavyweight.
---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they're optional developer features.
<!-- 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/21825 )
<!-- Reviewable:end -->
2018-10-02 06:57:38 -04:00
Josh Matthews
26e1001efd
Remove trailing whitespace.
2018-10-01 13:32:34 +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
Josh Matthews
e5892989ca
Warn when using slow WebGL code path.
2018-09-27 18:44:02 -04:00
Anthony Ramine
36c8cd229e
Remove Canvas2dMsg::DrawImageSelf
...
Now that all canvas share the same thread, it's useless to have a separate message
for that.
2018-09-17 16:24:01 +02:00
Anthony Ramine
9f7b746430
Specify capacity in CanvasData::read_pixels
2018-09-17 10:01:13 +02:00
Anthony Ramine
21e992bf40
Update azure
...
https://github.com/servo/rust-azure/pull/293
2018-09-16 20:53:38 +02:00
Anthony Ramine
f1e8eb640c
Don't create 2D canvas contexts arbitrarily
...
Sometimes, the canvas still has no rendering context, in this case it represents
a transparent black rectangle.
2018-09-16 20:44:41 +02:00
Anthony Ramine
fef04c65f6
Avoid a byte swap roundtrip
2018-09-14 14:48:39 +02:00