mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
Render gradients
This commit is contained in:
parent
f39c3ff38b
commit
632e731760
2 changed files with 348 additions and 2 deletions
|
@ -19,6 +19,7 @@ use style::values::specified::ui::CursorKind;
|
|||
use webrender_api::{self as wr, units};
|
||||
|
||||
mod background;
|
||||
mod gradient;
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct WebRenderImageInfo {
|
||||
|
@ -282,8 +283,17 @@ impl<'a> BuilderForBoxFragment<'a> {
|
|||
match layer {
|
||||
ImageLayer::None => {},
|
||||
ImageLayer::Image(image) => match image {
|
||||
Image::Gradient(_gradient) => {
|
||||
// TODO
|
||||
Image::Gradient(gradient) => {
|
||||
let intrinsic = IntrinsicSizes {
|
||||
width: None,
|
||||
height: None,
|
||||
ratio: None,
|
||||
};
|
||||
if let Some(layer) =
|
||||
&background::layout_layer(self, builder, index, intrinsic)
|
||||
{
|
||||
gradient::build(&self.fragment.style, gradient, layer, builder)
|
||||
}
|
||||
},
|
||||
Image::Url(image_url) => {
|
||||
// FIXME: images won’t always have in intrinsic width or height
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue