mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
canvas: Respect FillRule (#38294)
We just need to pass user provided FillRule via IPC to canvas paint thread, then pass it all down to backend, which will handle it. Testing: Added WPT tests. --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
4188852963
commit
bc71fb8c0d
22 changed files with 693 additions and 32 deletions
|
@ -567,6 +567,7 @@ impl<DrawTarget: GenericDrawTarget> CanvasData<DrawTarget> {
|
|||
pub(crate) fn fill_path(
|
||||
&mut self,
|
||||
path: &Path,
|
||||
fill_rule: FillRule,
|
||||
style: FillOrStrokeStyle,
|
||||
_shadow_options: ShadowOptions,
|
||||
composition_options: CompositionOptions,
|
||||
|
@ -584,7 +585,7 @@ impl<DrawTarget: GenericDrawTarget> CanvasData<DrawTarget> {
|
|||
|self_, style| {
|
||||
self_
|
||||
.drawtarget
|
||||
.fill(path, style, composition_options, transform)
|
||||
.fill(path, fill_rule, style, composition_options, transform)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
@ -615,8 +616,13 @@ impl<DrawTarget: GenericDrawTarget> CanvasData<DrawTarget> {
|
|||
)
|
||||
}
|
||||
|
||||
pub(crate) fn clip_path(&mut self, path: &Path, transform: Transform2D<f32>) {
|
||||
self.drawtarget.push_clip(path, transform);
|
||||
pub(crate) fn clip_path(
|
||||
&mut self,
|
||||
path: &Path,
|
||||
fill_rule: FillRule,
|
||||
transform: Transform2D<f32>,
|
||||
) {
|
||||
self.drawtarget.push_clip(path, fill_rule, transform);
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#reset-the-rendering-context-to-its-default-state>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue