mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Add gradient border support.
This commit is contained in:
parent
cc9fb0ba59
commit
02c675204a
3 changed files with 98 additions and 31 deletions
|
@ -334,20 +334,30 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
|||
}
|
||||
}
|
||||
}
|
||||
BorderDetails::Gradient(ref gradient) => {
|
||||
webrender_traits::BorderDetails::Gradient(webrender_traits::GradientBorder {
|
||||
gradient: builder.create_gradient(
|
||||
gradient.gradient.start_point.to_pointf(),
|
||||
gradient.gradient.end_point.to_pointf(),
|
||||
gradient.gradient.stops.clone(),
|
||||
ExtendMode::Clamp),
|
||||
outset: gradient.outset,
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
builder.push_border(rect, clip, widths, details);
|
||||
}
|
||||
DisplayItem::Gradient(ref item) => {
|
||||
let rect = item.base.bounds.to_rectf();
|
||||
let start_point = item.start_point.to_pointf();
|
||||
let end_point = item.end_point.to_pointf();
|
||||
let start_point = item.gradient.start_point.to_pointf();
|
||||
let end_point = item.gradient.end_point.to_pointf();
|
||||
let clip = item.base.clip.to_clip_region(builder);
|
||||
builder.push_gradient(rect,
|
||||
clip,
|
||||
start_point,
|
||||
end_point,
|
||||
item.stops.clone(),
|
||||
item.gradient.stops.clone(),
|
||||
ExtendMode::Clamp);
|
||||
}
|
||||
DisplayItem::Line(..) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue