Skip to content

Commit

Permalink
Pass repeating gradients to webrender.
Browse files Browse the repository at this point in the history
  • Loading branch information
pyfisch committed Apr 27, 2017
1 parent 803bc03 commit 1c4ae53
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions components/layout/webrender_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,15 @@ impl WebRenderDisplayItemConverter for DisplayItem {
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);
let extend_mode = if item.gradient.repeating {
ExtendMode::Repeat
} else {
ExtendMode::Clamp
};
let gradient = builder.create_gradient(start_point,
end_point,
item.gradient.stops.clone(),
ExtendMode::Clamp);
extend_mode);
builder.push_gradient(rect,
clip,
gradient,
Expand All @@ -385,10 +390,15 @@ impl WebRenderDisplayItemConverter for DisplayItem {
let center = item.gradient.center.to_pointf();
let radius = item.gradient.radius.to_sizef();
let clip = item.base.clip.to_clip_region(builder);
let extend_mode = if item.gradient.repeating {
ExtendMode::Repeat
} else {
ExtendMode::Clamp
};
let gradient = builder.create_radial_gradient(center,
radius,
item.gradient.stops.clone(),
ExtendMode::Clamp);
extend_mode);
builder.push_radial_gradient(rect,
clip,
gradient,
Expand Down

0 comments on commit 1c4ae53

Please sign in to comment.