Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update WR (gl trait, scroll roots) #16073

Merged
merged 2 commits into from Mar 23, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Stop splitting scroll roots

Now that WebRender can handle splitting scrolling layers on its own, we
don't need to do any work to split up scroll roots. This should also
make it possible to handle overflow:scroll and containing block scroll
roots in the future.
  • Loading branch information
mrobinson authored and gw3583 committed Mar 21, 2017
commit 9d72e89ce3502cb58147375c8ecc4e9e9356b1ee
@@ -40,7 +40,7 @@ use style_traits::viewport::ViewportConstraints;
use time::{precise_time_ns, precise_time_s};
use touch::{TouchHandler, TouchAction};
use webrender;
use webrender_traits::{self, ScrollEventPhase, ServoScrollRootId, LayoutPoint, ScrollLocation};
use webrender_traits::{self, LayoutPoint, ScrollEventPhase, ScrollLayerId, ScrollLocation};
use windowing::{self, MouseWindowEvent, WindowEvent, WindowMethods, WindowNavigateMsg};

#[derive(Debug, PartialEq)]
@@ -77,9 +77,9 @@ trait ConvertScrollRootIdFromWebRender {
fn from_webrender(&self) -> ScrollRootId;
}

impl ConvertScrollRootIdFromWebRender for webrender_traits::ServoScrollRootId {
impl ConvertScrollRootIdFromWebRender for usize {
fn from_webrender(&self) -> ScrollRootId {
ScrollRootId(self.0)
ScrollRootId(*self)
}
}

@@ -791,10 +791,8 @@ impl<Window: WindowMethods> IOCompositor<Window> {
pipeline_id: PipelineId,
scroll_root_id: ScrollRootId,
point: Point2D<f32>) {
self.webrender_api.scroll_layers_with_scroll_root_id(
LayoutPoint::from_untyped(&point),
pipeline_id.to_webrender(),
ServoScrollRootId(scroll_root_id.0));
let id = ScrollLayerId::new(scroll_root_id.0, pipeline_id.to_webrender());
self.webrender_api.scroll_layer_with_id(LayoutPoint::from_untyped(&point), id);
}

fn handle_window_message(&mut self, event: WindowEvent) {
@@ -1386,13 +1384,18 @@ impl<Window: WindowMethods> IOCompositor<Window> {
fn send_viewport_rects(&self) {
let mut stacking_context_scroll_states_per_pipeline = HashMap::new();
for scroll_layer_state in self.webrender_api.get_scroll_layer_state() {
let external_id = match scroll_layer_state.id.external_id() {
Some(id) => id,
None => continue,
};

let stacking_context_scroll_state = StackingContextScrollState {
scroll_root_id: scroll_layer_state.scroll_root_id.from_webrender(),
scroll_root_id: external_id.from_webrender(),
scroll_offset: scroll_layer_state.scroll_offset.to_untyped(),
};
let pipeline_id = scroll_layer_state.pipeline_id;

stacking_context_scroll_states_per_pipeline
.entry(pipeline_id)
.entry(scroll_layer_state.id.pipeline_id())
.or_insert(vec![])
.push(stacking_context_scroll_state);
}
@@ -434,6 +434,7 @@ impl StackingContext {
pub fn to_display_list_items(self) -> (DisplayItem, DisplayItem) {
let mut base_item = BaseDisplayItem::empty();
base_item.stacking_context_id = self.id;
base_item.scroll_root_id = self.parent_scroll_id;

let pop_item = DisplayItem::PopStackingContext(Box::new(
PopStackingContextItem {
@@ -2233,10 +2233,11 @@ impl Flow for BlockFlow {

fn compute_overflow(&self) -> Overflow {
let flow_size = self.base.position.size.to_physical(self.base.writing_mode);
self.fragment.compute_overflow(&flow_size,
let overflow = self.fragment.compute_overflow(&flow_size,
&self.base
.early_absolute_position_info
.relative_containing_block_size)
.relative_containing_block_size);
overflow
}

fn iterate_through_fragment_border_boxes(&self,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.