Commit graph

107 commits

Author SHA1 Message Date
Oriol Brufau
7ce706f891 Further changes required by Servo 2023-11-04 08:17:09 +01:00
Ennui Langeweile
a6ceca6d9f
Clean up a bit of the canvas backend abstractions (#30637)
* Clean up a bit of the canvas backend abstractions

* Remove unused import
Sneaky, sneaky little hecker
2023-10-27 23:06:43 +00:00
Ennui Langeweile
2d7dfb06c0
Use IpcSharedMemory for Canvas2dMsg::DrawImage (#30544)
* Use `IpcSharedMemory` for `Canvas2DMsg::DrawImage`

* Fix `Canvas2dMsg::DrawEmptyImage` crashes

* Do not premultiply canvas image data

* Move `image_data` back to its original position
2023-10-18 13:39:58 +00:00
Oriol Brufau
105050d46d Further changes required by Servo 2023-10-02 14:37:19 +00:00
Samson
aad2dccc9c
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting

* Reformat all imports
2023-09-11 19:16:54 +00:00
Samson
711dbbd4af
remove extern crate (#30311)
* remove extern crate

* Update components/script_plugins/lib.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-09-08 12:11:31 +00:00
Martin Robinson
3230162fd0
Try to use WebRender types more
The newer versions of WebRender move types around between `webrender` and
`webrender_api` and this will reduce the churn during the upgrade.
2023-07-10 17:35:50 +02:00
Oriol Brufau
fd41056ca5 Further changes required by Servo 2023-05-24 18:32:39 +02:00
Martin Robinson
423cc34cb0 Bump euclid to 0.22
- Also updates raqote to latest with an upgrade of font-kit to 0.11
  applied on as a patch
- Update lyon_geom to the latest version

Major change:

- All matrices are now stored in row major order. This means that
  parameters to rotation functions no longer should be negated.
- `post_...()` functions are now named `then()`. `pre_transform()` is removed,
  so `then()` is used and the order of operations changed.
2023-01-26 08:59:21 +01:00
Josh Matthews
1e743a7ed6 When instantiating a CTFont, store the bytes that were used to create it. 2020-08-07 15:30:55 -04:00
Josh Matthews
8e33806b9d canvas: Bail out from font loading if no default font can be loaded. 2020-07-06 12:37:32 -04:00
Emilio Cobos Álvarez
bb8c3ee8ba
style: fix formatting. 2020-06-18 23:51:18 +02:00
Emilio Cobos Álvarez
e5484250db
style: Remove the dependency on font-kit from style.
No good reason to have this IMO, and helps remove some #[cfg] blocks.
2020-06-18 23:51:17 +02:00
bors-servo
721271dcd3
Auto merge of #26697 - utsavoza:ugo/issue-11681/22-05-2020, r=jdm
Implement CanvasRenderingContext2d.fillText

The PR consists of broadly two main changes:
- Implementation of Canvas2dRenderingContext.font
- Basic implementation of Canvas2dRenderingContext.fillText

Although I am not fully sure about the long term goals for the canvas backend in Servo, I assumed limited scope for font and text handling (should support simple text drawing with font selection) in the current implementation as I believe a more complete implementation would eventually be brought in as a part of #22957.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #11681
- [x] There are tests for these changes
2020-06-12 13:43:51 -04:00
Utsav Oza
8372cf1bd8 Derive Serialize and Deserialize traits for font styles for #[cfg_attr(feature = "servo")] 2020-06-12 18:43:09 +05:30
Utsav Oza
d1241a8d06 Fix ./mach build --release --with-layout-2020 2020-06-10 22:34:24 +05:30
Utsav Oza
34d0c313dc Enable textAlign, textBaseline and direction attributes for canvas 2020-06-10 22:34:20 +05:30
Utsav Oza
c21fde3751 Implement CanvasRenderingContext2D.font property 2020-06-10 22:11:24 +05:30
Utsav Oza
5493424d9a Revert unnecessary changes 2020-06-10 22:10:43 +05:30
Utsav Oza
f161ab8e57 Basic implementation of canvas.fillText 2020-06-10 22:10:42 +05:30
Utsav Oza
726f7d7209 Check for valid arguments before processing canvas.fillText 2020-06-10 22:10:32 +05:30
Josh Matthews
55fee1fb35 canvas: Don't panic if webrender isn't reachable. 2020-06-10 10:40:28 -04:00
Josh Matthews
75efaa95f5 Proxy all WR interactions for layout/font/script/canvas threads to the compositor
thread. There is now a single RenderApi that is used, and all transactions are serialized
through the compositor.
2020-06-09 13:05:16 -04:00
Kunal Mohan
f3fa53b849 update rust toolchain 2020-05-21 21:51:49 +05:30
Josh Matthews
eb2f7f7f0a Convert all uses of UpdateResources api to use webrender transactions. 2020-05-11 17:41:56 -04:00
Manish Goregaokar
fccfff11c5 Update euclid 2020-04-07 08:51:08 -07:00
Paul Rouget
40f6cd87d4 Revert "Add a simple implementation of CanvasRenderingContext2d.fillText"
Windows crash: https://github.com/servo/servo/issues/26015
2020-03-24 10:35:52 +01:00
kaiakz
0d0ac986b7 Add a simple implementation of CanvasRenderingContext2d.fillText 2020-03-19 15:40:14 +08:00
bors-servo
813be91926
Auto merge of #25863 - servo:synup, r=jdm
Remove syn 0.15 from our crate graph
2020-03-05 10:03:48 -05:00
Anthony Ramine
9996e48500 Remove syn 0.15 from our crate graph (fixes #24421)
This required bumps of:

* gleam
* image
* rust-webvr
* webrender
* webxr
2020-03-05 13:01:13 +01:00
pylbrecht
967fabb0d0 Make fill_rect() draw patterns correctly 2020-03-03 07:01:27 +01:00
Daniel Alley
430a65be07 Remove azure canvas backend
closes #25833
2020-02-25 00:14:24 -05:00
pylbrecht
588c09b580 Implement CanvasRenderingContext2D.getTransform() 2020-02-12 08:49:18 +01:00
pylbrecht
3c7205c99f Create new subpath with origin after drawing rect
Step 4 has been missing.
https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-rect
2020-01-19 09:23:18 +01:00
pylbrecht
ca1e780c59 Add first control point if there's no subpath 2020-01-16 21:28:21 +01:00
pylbrecht
ce48a51e99 Ensure subpath for control point in quadratic_curve_to() 2020-01-07 07:24:18 +01:00
pylbrecht
f691acd958 Ensure there's a subpath for the first control point 2020-01-06 17:42:35 +01:00
pylbrecht
a50aef6f00 Add a layer to store Pattern related information
Some information of `canvas_data::Pattern` was lost by
converting it to `raqote::Source` due to the fact that Raqote
did not store this information (e.g. linear gradient's start/end
points). We introduce another layer to keep this information for later
use (like in `is_zero_size_gradient()`).
2019-12-17 19:52:02 +01:00
pylbrecht
1aecf40922 Implement "repeat-x" and "repeat-y" for images 2019-12-17 19:52:02 +01:00
pylbrecht
b8b33788b6 Handle empty paths in PathBuilder::get_current_point()
The case of calling get_current_point() on empty paths has not been
handled and caused panics.
2019-12-17 19:51:57 +01:00
Bailey Blankenship
ec2961920b Addresses issues raised in #24465; removes redundancy in set_bitmap_dimensions
Removed passing test .ini files and moved euclid extensions to euclidext.rs to factor out redundant code
2019-11-10 18:37:14 -05:00
pylbrecht
7c81d20869 Implement create_gradient_stops() 2019-08-29 14:17:03 +02:00
Simon Sapin
98e4a53b72 Upgrade to rustc 1.39.0-nightly (f7af19c27 2019-08-15) 2019-08-23 08:23:21 +02:00
Bastien Orivel
dc78b6a989 Implement a few functions to make tests in draw-image and draw-path pass 2019-08-21 19:10:57 +02:00
Bastien Orivel
8cb8e7c627 WIP: Fix azure backend 2019-08-21 19:10:57 +02:00
Bastien Orivel
4c73e4bb3f Imlplement get_composition_op 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
9229dc4d85 Implement clear_rect 2019-08-21 19:10:56 +02:00
Bastien Orivel
ed0dbafc72 Implement need_to_draw_shadow 2019-08-21 19:08:18 +02:00
pylbrecht
398929ffef Implement fill() for raqote::DrawTarget 2019-08-21 19:08:17 +02:00