mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Implement need_to_draw_shadow
This commit is contained in:
parent
559b28ce7b
commit
ed0dbafc72
2 changed files with 12 additions and 4 deletions
|
@ -20,8 +20,8 @@ impl Backend for RaqoteBackend {
|
|||
unimplemented!()
|
||||
}
|
||||
|
||||
fn need_to_draw_shadow(&self, _color: &Color) -> bool {
|
||||
unimplemented!()
|
||||
fn need_to_draw_shadow(&self, color: &Color) -> bool {
|
||||
color.as_raqote().a != 0
|
||||
}
|
||||
|
||||
fn size_from_pattern(&self, _rect: &Rect<f32>, _pattern: &Pattern) -> Option<Size2D<f32>> {
|
||||
|
@ -84,7 +84,7 @@ impl<'a> CanvasPaintState<'a> {
|
|||
shadow_offset_x: 0.0,
|
||||
shadow_offset_y: 0.0,
|
||||
shadow_blur: 0.0,
|
||||
shadow_color: Color::Raqote(()),
|
||||
shadow_color: Color::Raqote(raqote::SolidSource { r: 0, g: 0, b: 0, a: 0 }),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -450,3 +450,11 @@ impl<'a> ToRaqoteSource<'a> for FillOrStrokeStyle {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Color {
|
||||
fn as_raqote(&self) -> &raqote::SolidSource {
|
||||
match self {
|
||||
Color::Raqote(s) => s,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue