-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Ensure an ASM enabled node applies its pending layout when enters preload state #706
Ensure an ASM enabled node applies its pending layout when enters preload state #706
Conversation
…load state This makes sure subnodes are inserted and start preloading right away, instead of waiting until the next layout pass of the supernode. Fixes TextureGroup#693.
33943c5
to
e5ca7f6
Compare
@@ -2,8 +2,6 @@ | |||
// ASDisplayNodeImplicitHierarchyTests.m | |||
// Texture | |||
// | |||
// Created by Levi McCallum on 2/1/16. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry Levi, Danger forces me to do this :)
// (see __layout and _u_measureNodeWithBoundsIfNecessary:). | ||
// This scenario should be uncommon, and running a measurement pass here is a fine trade-off because preloading | ||
// any time after this point would be late. | ||
[self layoutIfNeeded]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work in the case of a node that doesn't have self.isNodeLoaded yet?
Ideally, we would be able to flush the layout / ASM process without relying on a CoreAnimation call at all. For example, a codepath that could call __layout without relying on -layoutSubviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…rs preload state (#751) - After #706, a layout pass is forced on an ASM-enabled node that enters preload state to make sure that its subnodes can start preloading as well. However, when the node is visible, a (coalesced, thus more efficient) layout pass will be triggered by CA soon anyways, so rely on it instead.
…load state (TextureGroup#706) This makes sure subnodes are inserted and start preloading right away, instead of waiting until the next layout pass of the supernode. Fixes TextureGroup#693.
…rs preload state (TextureGroup#751) - After TextureGroup#706, a layout pass is forced on an ASM-enabled node that enters preload state to make sure that its subnodes can start preloading as well. However, when the node is visible, a (coalesced, thus more efficient) layout pass will be triggered by CA soon anyways, so rely on it instead.
This makes sure subnodes are inserted and start preloading right away, instead of waiting until the next layout pass of the supernode. Fixes #693.