Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upMake perspective and transform Option types #945
Merged
Conversation
webrender/src/frame.rs
Outdated
| stacking_context.perspective != LayoutTransform::identity() { | ||
| if stacking_context.transform.is_some() || stacking_context.perspective.is_some() { | ||
| let transform = | ||
| context.scene.properties.resolve_layout_transform(&stacking_context.transform); |
This comment has been minimized.
This comment has been minimized.
emilio
Mar 1, 2017
Member
nit: I think usually Option<&T> is preferred, given it saves an indirection and gets optimized as a null pointer for the None case (you'd need to do stacking_context.transform.as_ref() here). That being said, I don't think it matters a lot here.
This comment has been minimized.
This comment has been minimized.
mrobinson
Mar 1, 2017
Author
Member
@emilio Thanks for the tip. I think your suggestion makes a lot of sense.
63d4bc4
to
a7ec6ce
CSS makes a distinction between an identity transform and an empty transform. For instance, stacking contexts with identity transformations still create what we call reference frames, which means they serve as coordinates spaces for fixed position elements. This will also help us to properly assign ScrollLayerIds during display list construction if we want.
a7ec6ce
to
9b703d9
|
@bors-servo r+ Nice! That was a much simpler change than I expected :) |
|
|
bors-servo
added a commit
that referenced
this pull request
Mar 2, 2017
Make perspective and transform Option types CSS makes a distinction between an identity transform and an empty transform. For instance, stacking contexts with identity transformations still create what we call reference frames, which means they serve as coordinates spaces for fixed position elements. This will also help us to properly assign ScrollLayerIds during display list construction if we want. <!-- 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/945) <!-- Reviewable:end -->
|
|
This was referenced Mar 2, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
mrobinson commentedMar 1, 2017
•
edited by larsbergstrom
CSS makes a distinction between an identity transform and an empty
transform. For instance, stacking contexts with identity
transformations still create what we call reference frames, which means
they serve as coordinates spaces for fixed position elements. This will
also help us to properly assign ScrollLayerIds during display list
construction if we want.
This change is