Commit graph

63 commits

Author SHA1 Message Date
Anthony Ramine
77c28bdfc9 Abstract some stuff common to ctx.getImageData and ctx.putImageData 2018-10-08 11:39:09 +02:00
Anthony Ramine
241dba064d Align ctx.createImageData and ctx.getImageData with the spec 2018-10-06 11:41:48 +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
a3392610c3 Make HTMLCanvasElement::get_size return a Size2D<u32>
The changes keep trickling down.
2018-10-02 14:21:06 +02: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
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
Brody-Eastwood
f3065f3707 Moved Canvas rendering to a single thread. 2018-04-23 20:50:05 -04:00
Brody Eastwood
8a1590efc6 Add unique canvas IDs to all canvas operations. 2018-04-02 22:02:22 -04:00
Anthony Ramine
ce81420bef Use ByteBuf for the canvas messages
The type Vec<u8> is super unefficient to work with in Serde if all you want
to represent is a simple blob.
2018-03-26 20:48:02 +02:00
Glenn Watson
30bb1ccbef Update WR (accelerated webgl fix on mac, line decoration optimizations). 2018-03-23 07:58:31 +10:00
CYBAI
cde99646a6 Use specific assertion for canvas 2018-01-25 23:44:54 +08:00
tigercosmos
e915840caf remove unsued IpcReceiver 2017-12-20 22:19:25 +08:00
Josh Matthews
0e211d0d8f Revert "Send IPC receiver for canvas as part of CreateCanvasPaintThread message"
This reverts commit a504c9358b.
2017-12-18 10:51:00 -05:00
tigercosmos
9978f04563 remove unused self in canvas_paint_thread 2017-12-17 12:36:22 +08:00
tigercosmos
a504c9358b Send IPC receiver for canvas as part of CreateCanvasPaintThread message 2017-12-16 12:04:59 +08:00
Joone Hur
57e283aaab Implement Ellipse Canvas 2D API
* Update rust-azure to 0.21.0
* Mark the following test case as fail:
  tests/wpt/mozilla/tests/mozilla/css-paint-api/background-image-tiled.html
* Make the ellipse test case pass.

BUG: https://github.com/servo/servo/issues/17598
2017-09-01 16:04:06 -07:00
Bruno Bernardino
2af828485f
Implement CanvasRenderingContext2d.fillText's "unimplemented" message 2017-08-23 17:34:55 +01:00
Anthony Ramine
676f2c8acf Revert "Auto merge of #18114 - emilio:revert-webgl-refactor, r=nox"
This reverts commit 4d10d39e8f, reversing
changes made to ee94e2b7c0.
2017-08-16 23:23:18 +02:00
Emilio Cobos Álvarez
cfe22e3979
Revert "Auto merge of #17891 - MortimerGoro:webgl_move, r=glennw,emilio"
This reverts commit 90f55ea458, reversing
changes made to 2e60b27a21.
2017-08-16 16:42:13 +02:00
Imanol Fernandez
703962fe61 Improve WebGL architecture. 2017-08-15 22:14:32 +02:00
Glenn Watson
f6a9f15fed Update WR.
* CPU text run optimizations.
* Linux subpixel positioning / rasterization.
* Update debug flags API.
* Update to resource transactions API.
2017-08-09 07:05:05 +10:00
Alan Jeffrey
d101f9c945 Implemented paint worklet arguments. 2017-07-29 15:32:13 -05:00
DarkDrek
67ceebbcb0 Use AntialiasMode in CanvasPaintThread::new
Change suggested in #17661
2017-07-29 13:22:40 +02:00
Alan Jeffrey
3002c45184 Don't delete webrender image keys immediately. 2017-07-17 15:24:42 -05:00
Martin Robinson
e58e8ab42e Upgrade to the latest version of WebRender 2017-07-13 07:44:08 +10:00
Alan Jeffrey
0b7a43da6b Clear canvas thread state on recreation. 2017-07-05 13:33:21 -05:00
Glenn Watson
e7b1e041c8 Update WR (CPU text optimizations, image format renames). 2017-06-16 15:27:22 +10:00
Nicolas Silva
8617320500 Bump euclid to 0.14. 2017-06-14 16:00:59 +02:00
Alan Jeffrey
4e04daa9d0 Clear webrender image id when resizing a canvas. 2017-06-13 09:30:26 -05:00
Glenn Watson
6dd3bc29e1 Update WR (various optimizations, gradient improvements). 2017-04-03 06:48:27 +10:00
Glenn Watson
3ca0f8a9ac Update WR (opaque rect optimization, stacking context culling).
Correct viewport test references

These references were using an incorrect value for the expected
container width. Now that WebRender is no longer clipping to stacking
context boundaries the rendered width is correct (100% of viewport
width = 240px).
2017-03-27 06:14:34 +10:00
n0max
6f470e497f Fix crop_area_byte_length calculation in crop_image and add tests 2017-03-16 21:43:31 +01:00
Glenn Watson
64a9a45b2a Update WR (image tiling, inset box shadow fixes, new key api). 2017-02-27 08:54:28 +10:00
Emilio Cobos Álvarez
0c102e2350
style: Unbox a bunch of color properties.
This builds on https://github.com/servo/rust-cssparser/pull/118.
2017-02-14 20:18:31 +01:00
Glenn Watson
4cbefe82b5 Update WR (radial gradients, subpixel positioning, tiling changes). 2017-02-01 05:40:44 +10:00
Imanol Fernandez
c5705bff50 WebVR API Implementation, r=larsbergstrom 2017-01-09 12:44:39 +01:00
Roman Zaynetdinov
912d5f3547 Remove azure(canvas) dependency from canvas_traits 2016-12-25 17:41:29 +02:00
Alan Jeffrey
9be4fd56ce Removed util. 2016-12-14 18:04:37 -06:00
Emilio Cobos Álvarez
2e69143f6b
canvas: Cleanup CanvasData and layout and script messages. 2016-11-07 11:28:40 +01:00
Ms2ger
a9e3fe75b5 Remove gfx_traits::color. 2016-10-31 18:15:25 +01:00
Glenn Watson
acfdfd2fa9 Remove old rendering backend.
This removes paint threads, rust-layers dependency, and changes
optional webrender types to be required.

The use_webrender option has been removed, however I've left
the "-w" command line option in place so that wpt
runner can continue to pass that. Once it's removed from there
we can also remove the -w option.

Once this stage is complete, it should be fine to change the
display list building code to generate webrender display
lists directly and avoid the conversion step.
2016-10-18 10:21:27 +10:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
Anthony Ramine
51768844ed Update euclid to 0.10.1 2016-08-21 03:03:45 +02:00
Martin Robinson
6259df5e2d Update to euclid 0.8 2016-08-12 03:12:06 +02:00
Dirkjan Ochtman
29c7c5bec3 Remove dependency on util::opts from canvas crate 2016-07-20 07:38:18 +00:00
Emilio Cobos Álvarez
b7d45fe096
canvas: Deallocate WebRender images on canvas
Fixes #11062

Depends on: #11744, https://github.com/servo/webrender_traits/pull/57, and https://github.com/servo/webrender/pull/292
2016-07-10 19:24:15 -07:00
bors-servo
68aca87e30 Auto merge of #11744 - emilio:wr-default, r=glennw
webgl: Unlock WebRender by default by adding a readback based fallback to WebGL context creation.

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

<!-- Either: -->
- [x] These changes do not require tests because refactoring.

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

This should give us the chance to use WebRender by default in OSX.

r? @pcwalton

cc @glennw @larsbergstrom

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11744)
<!-- Reviewable:end -->
2016-07-10 17:25:29 -07:00