Auto merge of #16860 - glennw:preserve3d, r=mbrubeck

Update WR (preserve-3d, AA improvements)

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16860)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-05-15 21:49:35 -05:00 committed by GitHub
commit 180edaab60
12 changed files with 100 additions and 104 deletions

View file

@ -39,7 +39,7 @@ use style_traits::viewport::ViewportConstraints;
use time::{precise_time_ns, precise_time_s};
use touch::{TouchHandler, TouchAction};
use webrender;
use webrender_traits::{self, ClipId, LayoutPoint, ScrollEventPhase, ScrollLocation};
use webrender_traits::{self, ClipId, LayoutPoint, ScrollEventPhase, ScrollLocation, ScrollClamping};
use windowing::{self, MouseWindowEvent, WindowEvent, WindowMethods, WindowNavigateMsg};
#[derive(Debug, PartialEq)]
@ -777,7 +777,8 @@ impl<Window: WindowMethods> IOCompositor<Window> {
}
fn scroll_fragment_to_point(&mut self, id: ClipId, point: Point2D<f32>) {
self.webrender_api.scroll_node_with_id(LayoutPoint::from_untyped(&point), id);
self.webrender_api.scroll_node_with_id(LayoutPoint::from_untyped(&point), id,
ScrollClamping::ToContentBounds);
}
fn handle_window_message(&mut self, event: WindowEvent) {

View file

@ -48,6 +48,16 @@ pub struct DisplayList {
}
impl DisplayList {
/// Return the bounds of this display list based on the dimensions of the root
/// stacking context.
pub fn bounds(&self) -> Rect<Au> {
match self.list.get(0) {
Some(&DisplayItem::PushStackingContext(ref item)) => item.stacking_context.bounds,
Some(_) => unreachable!("Root element of display list not stacking context."),
None => Rect::zero(),
}
}
// Returns the text index within a node for the point of interest.
pub fn text_index(&self,
node: OpaqueNode,

View file

@ -215,7 +215,8 @@ impl WebRenderDisplayListConverter for DisplayList {
fn convert_to_webrender(&self, pipeline_id: PipelineId) -> DisplayListBuilder {
let traversal = DisplayListTraversal::new(self);
let webrender_pipeline_id = pipeline_id.to_webrender();
let mut builder = DisplayListBuilder::new(webrender_pipeline_id);
let mut builder = DisplayListBuilder::new(webrender_pipeline_id,
self.bounds().size.to_sizef());
let mut current_scroll_root_id = ClipId::root_scroll_node(webrender_pipeline_id);
builder.push_clip_id(current_scroll_root_id);
@ -280,7 +281,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
item.text_run.font_key,
item.text_color,
item.text_run.actual_pt_size,
item.blur_radius,
item.blur_radius.to_f32_px(),
None);
}
}