mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update WR (ellipse border-radius clip, preserve-3d functionality).
This commit is contained in:
parent
a51da06dd9
commit
d175986501
12 changed files with 100 additions and 104 deletions
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue