mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
canvas: Fix the build of the vello backend (#38326)
Multiple Into hoops cannot be resolved by compiler Testing: Just refactor. Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
8d5faa9bf9
commit
7761030250
1 changed files with 13 additions and 15 deletions
|
@ -320,9 +320,7 @@ impl GenericDrawTarget for VelloDrawTarget {
|
||||||
self_.scene.fill(
|
self_.scene.fill(
|
||||||
fill_rule.convert(),
|
fill_rule.convert(),
|
||||||
transform.cast().into(),
|
transform.cast().into(),
|
||||||
&style
|
&convert_to_brush(style, composition_options),
|
||||||
.convert()
|
|
||||||
.multiply_alpha(composition_options.alpha as f32),
|
|
||||||
None,
|
None,
|
||||||
&path.0,
|
&path.0,
|
||||||
);
|
);
|
||||||
|
@ -337,9 +335,7 @@ impl GenericDrawTarget for VelloDrawTarget {
|
||||||
composition_options: CompositionOptions,
|
composition_options: CompositionOptions,
|
||||||
transform: Transform2D<f32>,
|
transform: Transform2D<f32>,
|
||||||
) {
|
) {
|
||||||
let pattern = style
|
let pattern = convert_to_brush(style, composition_options);
|
||||||
.convert()
|
|
||||||
.multiply_alpha(composition_options.alpha as f32);
|
|
||||||
let transform = transform.cast().into();
|
let transform = transform.cast().into();
|
||||||
self.with_draw_options(&composition_options, |self_| {
|
self.with_draw_options(&composition_options, |self_| {
|
||||||
let mut advance = 0.;
|
let mut advance = 0.;
|
||||||
|
@ -399,9 +395,7 @@ impl GenericDrawTarget for VelloDrawTarget {
|
||||||
composition_options: CompositionOptions,
|
composition_options: CompositionOptions,
|
||||||
transform: Transform2D<f32>,
|
transform: Transform2D<f32>,
|
||||||
) {
|
) {
|
||||||
let pattern = style
|
let pattern = convert_to_brush(style, composition_options);
|
||||||
.convert()
|
|
||||||
.multiply_alpha(composition_options.alpha as f32);
|
|
||||||
let transform = transform.cast().into();
|
let transform = transform.cast().into();
|
||||||
let rect: kurbo::Rect = rect.cast().into();
|
let rect: kurbo::Rect = rect.cast().into();
|
||||||
self.with_draw_options(&composition_options, |self_| {
|
self.with_draw_options(&composition_options, |self_| {
|
||||||
|
@ -448,9 +442,7 @@ impl GenericDrawTarget for VelloDrawTarget {
|
||||||
self_.scene.stroke(
|
self_.scene.stroke(
|
||||||
&line_options.convert(),
|
&line_options.convert(),
|
||||||
transform.cast().into(),
|
transform.cast().into(),
|
||||||
&style
|
&convert_to_brush(style, composition_options),
|
||||||
.convert()
|
|
||||||
.multiply_alpha(composition_options.alpha as f32),
|
|
||||||
None,
|
None,
|
||||||
&path.0,
|
&path.0,
|
||||||
);
|
);
|
||||||
|
@ -470,9 +462,7 @@ impl GenericDrawTarget for VelloDrawTarget {
|
||||||
self_.scene.stroke(
|
self_.scene.stroke(
|
||||||
&line_options.convert(),
|
&line_options.convert(),
|
||||||
transform.cast().into(),
|
transform.cast().into(),
|
||||||
&style
|
&convert_to_brush(style, composition_options),
|
||||||
.convert()
|
|
||||||
.multiply_alpha(composition_options.alpha as f32),
|
|
||||||
None,
|
None,
|
||||||
&rect,
|
&rect,
|
||||||
);
|
);
|
||||||
|
@ -544,3 +534,11 @@ impl GenericDrawTarget for VelloDrawTarget {
|
||||||
Some(data)
|
Some(data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn convert_to_brush(
|
||||||
|
style: FillOrStrokeStyle,
|
||||||
|
composition_options: CompositionOptions,
|
||||||
|
) -> peniko::Brush {
|
||||||
|
let brush: peniko::Brush = style.convert();
|
||||||
|
brush.multiply_alpha(composition_options.alpha as f32)
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue