Expand DisplayList layer bounds to whole pixels

Before passing these layers to the paint task, expand them to pixel
boundaries. This ensures that subpixel edges of the layer will not be
clipped away and helps prevent rounding issues with layer contents.

Fixes #8166.
This commit is contained in:
Martin Robinson 2015-10-27 15:57:33 -07:00
parent 9501564e01
commit a7a58e47a0
8 changed files with 106 additions and 30 deletions

View file

@ -34,7 +34,7 @@ use std::mem as std_mem;
use std::sync::Arc;
use std::sync::mpsc::{Receiver, Select, Sender, channel};
use url::Url;
use util::geometry::ZERO_POINT;
use util::geometry::{ExpandToPixelBoundaries, ZERO_POINT};
use util::opts;
use util::task::spawn_named;
use util::task::spawn_named_with_send_on_failure;
@ -85,7 +85,7 @@ impl PaintLayer {
pub fn new_with_display_list(layer_info: LayerInfo,
display_list: DisplayList)
-> PaintLayer {
let bounds = display_list.calculate_bounding_rect();
let bounds = display_list.calculate_bounding_rect().expand_to_px_boundaries();
PaintLayer {
id: layer_info.layer_id,
background_color: color::transparent(),