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(
|
||||
fill_rule.convert(),
|
||||
transform.cast().into(),
|
||||
&style
|
||||
.convert()
|
||||
.multiply_alpha(composition_options.alpha as f32),
|
||||
&convert_to_brush(style, composition_options),
|
||||
None,
|
||||
&path.0,
|
||||
);
|
||||
|
@ -337,9 +335,7 @@ impl GenericDrawTarget for VelloDrawTarget {
|
|||
composition_options: CompositionOptions,
|
||||
transform: Transform2D<f32>,
|
||||
) {
|
||||
let pattern = style
|
||||
.convert()
|
||||
.multiply_alpha(composition_options.alpha as f32);
|
||||
let pattern = convert_to_brush(style, composition_options);
|
||||
let transform = transform.cast().into();
|
||||
self.with_draw_options(&composition_options, |self_| {
|
||||
let mut advance = 0.;
|
||||
|
@ -399,9 +395,7 @@ impl GenericDrawTarget for VelloDrawTarget {
|
|||
composition_options: CompositionOptions,
|
||||
transform: Transform2D<f32>,
|
||||
) {
|
||||
let pattern = style
|
||||
.convert()
|
||||
.multiply_alpha(composition_options.alpha as f32);
|
||||
let pattern = convert_to_brush(style, composition_options);
|
||||
let transform = transform.cast().into();
|
||||
let rect: kurbo::Rect = rect.cast().into();
|
||||
self.with_draw_options(&composition_options, |self_| {
|
||||
|
@ -448,9 +442,7 @@ impl GenericDrawTarget for VelloDrawTarget {
|
|||
self_.scene.stroke(
|
||||
&line_options.convert(),
|
||||
transform.cast().into(),
|
||||
&style
|
||||
.convert()
|
||||
.multiply_alpha(composition_options.alpha as f32),
|
||||
&convert_to_brush(style, composition_options),
|
||||
None,
|
||||
&path.0,
|
||||
);
|
||||
|
@ -470,9 +462,7 @@ impl GenericDrawTarget for VelloDrawTarget {
|
|||
self_.scene.stroke(
|
||||
&line_options.convert(),
|
||||
transform.cast().into(),
|
||||
&style
|
||||
.convert()
|
||||
.multiply_alpha(composition_options.alpha as f32),
|
||||
&convert_to_brush(style, composition_options),
|
||||
None,
|
||||
&rect,
|
||||
);
|
||||
|
@ -544,3 +534,11 @@ impl GenericDrawTarget for VelloDrawTarget {
|
|||
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