Commit graph

532 commits

Author SHA1 Message Date
Bastien Orivel
4c73e4bb3f Imlplement get_composition_op 2019-08-21 19:10:57 +02:00
Bastien Orivel
a28d00013c Implement set_shadow_color, set_global_composition and stroke_rect 2019-08-21 19:10:57 +02:00
Bastien Orivel
a9fd26729b Match the azure backend regarding cap stuff
I think this is wrong because it won't respect cap style at all when
stroking lines but we'll cross that bridge when we get to it
2019-08-21 19:10:57 +02:00
Bastien Orivel
1dee418ff1 Set the line cap to butt when drawing a rect with a 0 width/height
Otherwise raqote will draw the cap even though it shouldn't because the
spec says so
2019-08-21 19:10:56 +02:00
Bastien Orivel
97674082d3 Pass BlendMode::Clear to the fill method of DrawTarget in clear_rect
This makes some tests regarding clearing rects pass. Otherwise the rect
wouldn't get cleared properly and it'd keep its original color but get
an alpha of 0
2019-08-21 19:10:56 +02:00
Bastien Orivel
777ef4f3e8 Implement snapshot_data_owned 2019-08-21 19:10:56 +02:00
Bastien Orivel
97364dc6af Implement get_size 2019-08-21 19:10:56 +02:00
Bastien Orivel
fda815bcbb Properly pass draw_options in fill_rect 2019-08-21 19:10:56 +02:00
Bastien Orivel
e90d1a1d8d Implement stroke_line and set_stroke_style 2019-08-21 19:10:56 +02:00
Bastien Orivel
9229dc4d85 Implement clear_rect 2019-08-21 19:10:56 +02:00
Bastien Orivel
24313a82a1 Make tidy happy 2019-08-21 19:10:56 +02:00
Bastien Orivel
14ee093a5b Implement size_from_pattern
I tried to mimic the azure implementation but raqote doesn't have a
concept of horizontal or vertical repeat so this might be
wrong/incomplete but this is the last function needed to finally have
some tests pass
2019-08-21 19:08:18 +02:00
Bastien Orivel
ed0dbafc72 Implement need_to_draw_shadow 2019-08-21 19:08:18 +02:00
Bastien Orivel
559b28ce7b Implement snapshot_data 2019-08-21 19:08:18 +02:00
Bastien Orivel
c39af71aeb Add an implementation for fill_rect
Again, this is probably incomplete but it'll do for now
2019-08-21 19:08:18 +02:00
Bastien Orivel
0a878da500 Implement Pattern::is_zero_size_gradient
There are probably other times where this would be true but I'll worry
about that later
2019-08-21 19:08:18 +02:00
Bastien Orivel
93f1053b0e Implement set_fill_style 2019-08-21 19:08:18 +02:00
Bastien Orivel
cbe385c7d7 Add a way to convert a FillOrStrokeStyle to a raqote Source
For now most of it unimplemented but it'll allow for some more testing
2019-08-21 19:08:18 +02:00
pylbrecht
7005c24e40 Implement some of GenericDrawTarget's methods for raqote 2019-08-21 19:08:17 +02:00
pylbrecht
398929ffef Implement fill() for raqote::DrawTarget 2019-08-21 19:08:17 +02:00
Josh Matthews
4e51caeb7e Deal with fallout from mutable trait method change. 2019-08-21 19:08:17 +02:00
pylbrecht
b43c5c30e3 WIP: Make GenericPathBuilder's methods take &mut self 2019-08-21 19:08:17 +02:00
pylbrecht
9f9013946a Implement provided raqote::PathBuilder's methods for GenericPathBuilder 2019-08-21 19:08:17 +02:00
pylbrecht
f9e398d9f6 Make GenericPathBuilder take &mut self 2019-08-21 19:08:17 +02:00
pylbrecht
4179f91f93 Implement StrokeOptions 2019-08-21 19:08:17 +02:00
pylbrecht
4aad4ff858 Implement DrawOptions.set_alpha() 2019-08-21 19:08:16 +02:00
Josh Matthews
25b20ebfc6
Drop webgl main thread data during shutdown. 2019-07-29 08:15:59 -04:00
Alan Jeffrey
c757a9c009 Get XR sessions to track the draw texture, so we render the XR framebuffer rather than the default canvas framebuffer 2019-07-28 10:24:38 -04:00
Alan Jeffrey
133a17e15c Replace use of callbacks in webxr by channels 2019-07-26 23:36:13 -05:00
Alan Jeffrey
0178fcae4e When using the WebGL external image API, use sync calls if we happen to be on the WebGL thread 2019-07-26 17:39:40 -05:00
Josh Matthews
a2ca3ddbd9 Remove extra webgl message pumping thread. 2019-07-25 23:07:23 -04:00
Josh Matthews
39d13d1fc8 Support running WebGL in its own thread or on the main thread. 2019-07-25 23:05:03 -04:00
Emilio Cobos Álvarez
3d57c22e9c Update euclid.
There are a few canvas2d-related dependencies that haven't updated, but they
only use euclid internally so that's not blocking landing the rest of the
changes.

Given the size of this patch, I think it's useful to get this landed as-is.
2019-07-23 23:09:55 +02:00
bors-servo
650f90b271
Auto merge of #23763 - servo:jdm-patch-40, r=Manishearth
Don't enable azure canvas feature by default.

This caused problems when I was trying to do a UWP build.

<!-- 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/23763)
<!-- Reviewable:end -->
2019-07-12 19:42:02 -04:00
Josh Matthews
dbaed5ed92 Make GL/GLES decisions based on the API in use. 2019-07-12 13:36:44 -04:00
bors-servo
812bf8d816
Auto merge of #23758 - jdm:compositing-canvas-break, r=gterzian
Remove canvas->compositing dependency

There's one tiny place in the canvas crate that depends on the compositing crate, and it's really quite backwards. If we use trait objects instead it becomes much cleaner to reason about.

---
- [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 no tests for windows-only webgl code.

<!-- 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/23758)
<!-- Reviewable:end -->
2019-07-12 10:26:55 -04:00
Josh Matthews
577eb654cf
Don't enable azure canvas feature by default. 2019-07-12 08:43:33 -04:00
Josh Matthews
f02d594094 Remove canvas->compositing dependency. 2019-07-12 08:22:26 -04:00
bors-servo
df73c71fb1
Auto merge of #23516 - pcwalton:webrenderup, r=pcwalton,jdm
Upgrade WebRender

This is against an old Servo because I can't build current Servo due to compile errors in RNG crates. I verified that it starts up.

---
<!-- 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 #23516
- [x] There are tests for these changes

<!-- 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/23516)
<!-- Reviewable:end -->
2019-07-12 08:10:31 -04:00
Manish Goregaokar
c5a0fc56ea Use separate IPC-only locking mechanism when locking from webxr 2019-07-11 11:12:59 -07:00
Patrick Walton
2f9c9cefdb WebRender units are no longer reexported. 2019-07-09 10:50:27 -04:00
Fernando Jiménez Moreno
0da87ad169 Introduce WebrenderExternalImageRegistry 2019-07-04 10:26:48 +02:00
Fernando Jiménez Moreno
ba9cf85fb3 Webrender external image handler demux 2019-07-04 10:26:47 +02:00
Fernando Jiménez Moreno
7d589ed4f5 Media crate 2019-07-04 10:25:49 +02:00
Víctor Manuel Jáquez Leal
a9ad088e70 Instanciate and use the implemented webrender::ExternalImageHandler 2019-07-04 10:25:48 +02:00
Víctor Manuel Jáquez Leal
e000c14eb2 Implement webrender::ExternalImageHandler for player
Added trait GLPlayerExternalImageApi and its implementation
Implemented webrender::ExternalImageHandler using
GLPlayerExternalImageApi
2019-07-04 10:25:48 +02:00
Víctor Manuel Jáquez Leal
38eb48441c GLPlayer thread API implementation 2019-07-04 10:25:48 +02:00
Víctor Manuel Jáquez Leal
43467b4290 Add GLPlayerThreads in canvas
This factory will launch a GLPlayerThread from the application main
thread.

And add GLPlayerThread, the multiplexor for media players' video
renderers. This thread will receive commands from htmlmedialement
and webrenderer.

This code is also inspired by webgl_threads and WebGLThread.
2019-07-04 10:25:47 +02:00
Simon Sapin
acd8454b16 Print an error message if neither Canvas 2D backend is selected 2019-07-01 15:46:36 +02:00
Simon Sapin
1df2605292 Rename {azure,raqote}_backend feature flags to canvas2d-{azure,raqote} 2019-07-01 15:46:33 +02:00