Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions webrender/src/display_list_flattener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2185,12 +2185,20 @@ impl<'a> DisplayListFlattener<'a> {
tile: tile_offset,
};

//HACK: round up the stretch size when comparing to the layer size,
// since the latter is snapped by Gecko before coming here.
fn includes(a: f32, b: f32) -> bool {
a >= b || (a > 1.0 && a.ceil() >= b)
}

// See if conditions are met to run through the new
// image brush shader, which supports segments.
if tile_spacing == LayerSize::zero() &&
stretch_size == info.rect.size &&
sub_rect.is_none() &&
tile_offset.is_none() {
includes(stretch_size.width, info.rect.size.width) &&
includes(stretch_size.height, info.rect.size.height) &&
sub_rect.is_none() &&
tile_offset.is_none()
{
let prim = BrushPrimitive::new(
BrushKind::Image {
request,
Expand Down