Re: -magnifyWithEvent: changed in Yosemite?
Re: -magnifyWithEvent: changed in Yosemite?
- Subject: Re: -magnifyWithEvent: changed in Yosemite?
- From: Graham Cox <email@hidden>
- Date: Mon, 17 Nov 2014 09:58:29 +1100
> On 17 Nov 2014, at 9:29 am, Kyle Sluder <email@hidden> wrote:
>
> Can you listen for NSScrollViewWillStartLiveMagnifyNotification to
> freeze a snapshot of your existing drawing?
The problem with this approach is that the time to capture the entire drawing (which is necessary because I don't know in advance where the zoom might end up - if I zoom out it could end up being the whole thing) can become really significant, even a second or two. While we do what we can to avoid drawing things we don't need to, the "drawing" is vector cartography consisting of potentially tens of thousands of objects. When you have to display the whole thing, there's just no way around it, you have to draw the lot.
Currently, zooming using other means is fine, because the image in the view is captured, and only parts that are revealed redrawn. This is usually a tiny subset of the entire drawing, so it's fast. But the stream of events in Yosemite is taxing even this approach (my measurements show this is sending about 90 events per second, which is crazy; no animation can benefit from going that fast with displays maxed at 60fps)
> Is your view layer-backed? If not, perhaps you could consider doing
> that, which would give you the opportunity to use the existing GPU cache
> of your drawing.
>
It's not currently layer-backed. I have spent a lot of time trying to make that work, (about a year ago there was a lengthy thread about some of my efforts in that direction). To do this requires some major rearchitecting. We'll likely do that for the next major release cycle, but for now we have to keep the existing app working as the OS is revved.
I've tried throtlling the events down so that those that arrive too quickly are discarded. This seems to work, my zooming is still smooth and no longer lags even when I handle only at about 1/10s. This might be a reasonable solution, but if there is a better one, it'd be nice to know.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden