Skip to content

Conversation

@mrobinson
Copy link
Member

@mrobinson mrobinson commented Feb 2, 2017

Eventually scroll layers will create packed layers as well, so this will
help to keep things clear. This shouldn't change behavior, because
currently packed layer ids will always be equal to the stacking context
ids of their owners.


This change is Reviewable

@mrobinson
Copy link
Member Author

@glennw r?

@bors-servo
Copy link
Contributor

☔ The latest upstream changes (presumably #802) made this pull request unmergeable. Please resolve the merge conflicts.

@kvark
Copy link
Member

kvark commented Feb 2, 2017

currently packed layer ids will always be equal to the stacking context
ids of their owners

Let's hope all of the are called sc_index so that we don't miss any ;)

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.

Looks pretty straightforward and clean in terms of implementation.
For the future, I'd like to remove those xf_rect.as_ref().unwrap() calls and revise the coordinate system names.

&[]);
context.builder.push_stacking_context(layer_rect,
&ClipRegion::simple(&layer_rect),
LayerToScrollTransform::identity(),
Copy link
Member

Choose a reason for hiding this comment

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

Not directly related to this PR, but is it correct to still call it LayerToScrollTransform?
AFAIK, the SC's/items are attached to their reference frames, but the transformation we pass here is relative to the parent stacking context (not necessarily the scroll layer).

Copy link
Member Author

Choose a reason for hiding this comment

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

@kvark, I think you are right. The naming of this is off now. There is a chance that in the future StackingContexts won't have transforms at all. It depends if we decide to make all coordinates relative to reference frames or not.

Copy link
Member

Choose a reason for hiding this comment

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

Yep, I'd say let's not have the transformations in there. Since they only affect the initial placement of items, we should use it and forget about them, only keeping the reference frames in our sight.

@mrobinson
Copy link
Member Author

@kvark, thanks for looking at this. I've pushed a new rebased version with a few other minor naming changes and a new use of Default::default().

fn default() -> PackedStackingContext {
PackedStackingContext {
impl Default for PackedLayer {
fn default() -> PackedLayer {
Copy link
Member

Choose a reason for hiding this comment

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

I believe the semantics of Default is misused here. It's not a "default" layer, it's an empty one. Default is applicable where you could drop it if you don't care, and it's going to somewhat work. This is not the case here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hrm. Okay. I'm happy to change it, but does that mean that the implementation of Default::default should change.

Copy link
Member

Choose a reason for hiding this comment

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

Since there was already impl Default for PackedStackingContext, this is not something that has to be done in your PR. But for the future I think we should remove the impl Default and just have the same thing as an fn empty() -> PackedLayer constructor. No implementation change needed.

@glennw glennw closed this Feb 2, 2017
@glennw glennw reopened this Feb 2, 2017
@mrobinson
Copy link
Member Author

The build failure seems to be

Could not open dynamic library `OsMesa`

@glennw
Copy link
Member

glennw commented Feb 3, 2017

I think the build failure should be resolved now (I reverted the commit that seems to cause that) - but travis might need a rebuild?

@mrobinson
Copy link
Member Author

@bors-servo try

@bors-servo
Copy link
Contributor

⌛ Trying commit e115f89 with merge 9df10a0...

bors-servo pushed a commit that referenced this pull request Feb 3, 2017
Clarify the difference between packed layers and stacking contexts

Eventually scroll layers will create packed layers as well, so this will
help to keep things clear. This shouldn't change behavior, because
currently packed layer ids will always be equal to the stacking context
ids of their owners.

<!-- 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/824)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - status-travis
State: approved= try=True

Eventually scroll layers will create packed layers as well, so this will
help to keep things clear. This shouldn't change behavior, because
currently packed layer ids will always be equal to the stacking context
ids of their owners.
@mrobinson
Copy link
Member Author

This is related to #742, by the way.

@mrobinson
Copy link
Member Author

@bors-servo r=kvark

@bors-servo
Copy link
Contributor

📌 Commit fce5d7c has been approved by kvark

@bors-servo
Copy link
Contributor

⌛ Testing commit fce5d7c with merge a63d0a2...

bors-servo pushed a commit that referenced this pull request Feb 3, 2017
Clarify the difference between packed layers and stacking contexts

Eventually scroll layers will create packed layers as well, so this will
help to keep things clear. This shouldn't change behavior, because
currently packed layer ids will always be equal to the stacking context
ids of their owners.

<!-- 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/824)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

☀️ Test successful - status-travis
Approved by: kvark
Pushing a63d0a2 to master...

@bors-servo bors-servo merged commit fce5d7c into servo:master Feb 3, 2017
@mrobinson mrobinson deleted the packed-layer-id branch February 3, 2017 11:55
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