mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Partially implement radial gradients.
Missing: repeating radial gradients and keyword sizes.
This commit is contained in:
parent
2c445169ad
commit
f4bad2d920
4 changed files with 194 additions and 83 deletions
|
@ -380,6 +380,21 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
|||
rect.size,
|
||||
webrender_traits::LayoutSize::zero());
|
||||
}
|
||||
DisplayItem::RadialGradient(ref item) => {
|
||||
let rect = item.base.bounds.to_rectf();
|
||||
let center = item.gradient.center.to_pointf();
|
||||
let radius = item.gradient.radius.to_sizef();
|
||||
let clip = item.base.clip.to_clip_region(builder);
|
||||
let gradient = builder.create_radial_gradient(center,
|
||||
radius,
|
||||
item.gradient.stops.clone(),
|
||||
ExtendMode::Clamp);
|
||||
builder.push_radial_gradient(rect,
|
||||
clip,
|
||||
gradient,
|
||||
rect.size,
|
||||
webrender_traits::LayoutSize::zero());
|
||||
}
|
||||
DisplayItem::Line(..) => {
|
||||
println!("TODO DisplayItem::Line");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue