Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Automatically enable layer-backing during an animation #28

Open
jspahrsummers opened this issue Dec 23, 2012 · 8 comments
Open

Automatically enable layer-backing during an animation #28

jspahrsummers opened this issue Dec 23, 2012 · 8 comments

Comments

@jspahrsummers
Copy link
Member

Animations are noticeably smoother when a view is layer-backed.

RCL could automatically enable layer-backing on NSViews when any property managed by the framework (like rcl_frame) is animated as part of a signal chain, and then disable layer-backing for all such views once the animation completes.

@jwilling
Copy link

I have a small concern with this. If this was done with views containing text fields, they would change their appearance slightly during the transition, especially on 10.7. Will this be an option, or will it be enforced?

@jspahrsummers
Copy link
Member Author

It could be a variation of the -animate… methods, maybe. But it's also worth noting that animations are generally smooth enough to where any small visual differences would go unnoticed, while a choppy animation is quite noticeable.

@jspahrsummers
Copy link
Member Author

For implementation: it looks like a call to -display is necessary immediately after enabling wantsLayer if you want the animation to begin immediately afterward (and not after one run loop iteration).

@alanjrogers
Copy link
Member

Yup, that is correct. I think we've all come across the email thread from @joshaber.

@jspahrsummers
Copy link
Member Author

@alanjrogers That's actually not what the @joshaber of old recommended, but what we do in GHfM today. I can only assume he recognized the error of his ways.

@alanjrogers
Copy link
Member

ah I was thinking of a SO question answered by @joshaber . Although I can't find it now :(

@zakdances
Copy link
Contributor

Something to consider is that in OSX 10.9, NSViews will be layer backed by default just like their iOS counterparts. (normally I'd post a source link here, but I can't find one at the moment. So take this comment as apocryphal, I suppose.)

@jwilling
Copy link

@zakdances As much as I wish that were the case, that's simply not true. That would break far too many apps to be viable. They did make layer-backed improvements under 10.9, but it's not the default.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants