rweichler / cylinder

123 stars 47 forks source link

Rotating pitch/yaw of a page and its icons causes blur and performance loss #17

Open rweichler opened 10 years ago

rweichler commented 10 years ago

no idea why.

noahd commented 10 years ago

When you inspect the device with the Core Animation instrument, you can see that all icons are rendered offscreen when "3D-ish" transforms are applied to both them and the page! That presumably happens because Core Animation has to composite the icon transformations first before it renders them onto the flattened plane.

A possible workaround for this is to make the page use a CATransformLayer instead of a regular one, like in this simple Cycript hack:

@implementation SBRootIconListView (MyWorkaround)
+ (Class)layerClass { return [CATransformLayer class]; }
@end

(You'll have to get the view reloaded if you inject this when SpringBoard is already running. Not sure what exactly triggers a reload, but locking and unlocking seems to sort of work, sometimes -_-. Making a proper MS hook is surely the best way to go about this…)

This essentially removes the flattening effect of the page layer, i.e. the icons are rendered directly three-dimensionally and express their position in 3D. It fixes the blur/lagginess on my iPad, and actually looks much cooler IMO! I decided against a pull request, though, because it changes the appearance of said effects.

What do you think?

rweichler commented 10 years ago

This solution seems perfect - I'm fairly new to Core Animation, so I appreciate detailed writeup! :P

And yeah, I agree with you, it looks a lot better. I don't seem to be noticing any downsides to this - I'll implement this ASAP.

Thanks!

rweichler commented 10 years ago

This solution hides the dock in iOS 6-

rweichler commented 10 years ago

LOL JK

noahd commented 10 years ago

I was just about to write something, and then you fixed it! Didn't know GitHub could be so real-time :D

rweichler commented 10 years ago

There are a ton of people reporting that opening folders causes the background to disappear. Even one person said that only uninstalling Cylinder fixes this issue; and this solution is the only thing that stays enabled when cylinder is installed and disabled.

It seems to be a 64-bit only problem, but even then some people with 5S's don't get this. And I've had a report of a person with an iP5 with this problem. Gonna be a tough one to tackle.

rweichler commented 9 years ago

@noahd did you end up fixing this in your branch?

noahd commented 9 years ago

@rweichler Yeah, in principle, that bug I fixed early on, only other bugs surfaced (that I don't think exist in the master branch), like some icons randomly vanishing after unlocking. They're not that annoying and only seem to happen seldomly, but I kinda wanted to squash them before making a PR and eventually I Iost interest. 😐

In the summer, I actually worked on another solution that doesn't require weirdly messing with the view hierarchy: 'buffering' whatever page layer transforms the scripts want (but not actually applying them), and then applying the page transform on each icon, combined with its own respective transform. That didn't really work, probably because I got the math wrong (and then I stopped working on it because college), but it might be worth another try.

rweichler commented 9 years ago

The delegation of transformation from the page to the individual icons is an interesting idea.... but CATransformLayer would be SOOO much easier.. might look into that again as well

It's probably something really obvious