Skip to content

Conversation

@mrobinson
Copy link
Member

@mrobinson mrobinson commented Jan 19, 2017

This will make it easier to introduce the idea of reference frames
into WebRender. This should not change behavior.


This change is Reviewable

This will make it easier to introduce the idea of reference frames
into WebRender. This should not change behavior.
@glennw
Copy link
Member

glennw commented Jan 19, 2017

This looks good, and I've tested scrolling on a number of different sites.

@glennw
Copy link
Member

glennw commented Jan 19, 2017

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 5687f7d has been approved by glennw

@bors-servo
Copy link
Contributor

⌛ Testing commit 5687f7d with merge 412face...

bors-servo pushed a commit that referenced this pull request Jan 19, 2017
Move all layer tree operations to a ScrollTree struct

This will make it easier to introduce the idea of reference frames
into WebRender. This should not change behavior.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/754)
<!-- Reviewable:end -->
@mrobinson
Copy link
Member Author

Thanks!

@bors-servo
Copy link
Contributor

☀️ Test successful - status-travis

@bors-servo bors-servo merged commit 5687f7d into servo:master Jan 19, 2017
@mrobinson mrobinson deleted the scroll-tree branch January 19, 2017 22:19
Copy link
Member

@kvark kvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff!

}

scrolled_a_layer
self.scroll_tree.scroll(scroll_location, cursor, phase,)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra comma?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I will fix this in a followup.

&DEFAULT_SCROLLBAR_COLOR,
PrimitiveFlags::Scrollbar(self.root_scroll_layer_id.unwrap(),
4.0));
context.builder.add_solid_rectangle(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't the new formatting (see below) against the style guidelines?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, but the PrimitiveFlags::Scrollbar(self.root_scroll_layer_id.unwrap(), line wouldn't fit within the line length limit any other way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I don't know what the guidelines are for this case then

pub fn collect_layers_bouncing_back(&self)
-> HashSet<ScrollLayerId, BuildHasherDefault<FnvHasher>> {
let mut layers_bouncing_back = HashSet::with_hasher(Default::default());
for (scroll_layer_id, layer) in self.layers.iter() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit (unrelated to the PR): we could do something fancy like

self.layers.iter()
           .filter(|(_, layer)| layer.scrolling.bouncing_back)
           .map(|(id, _)| *id)
           .collect()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants