David,

Le 28 janv. 2010 à 00:09, David Duncan a écrit :

> Are you calling -drawLayer:inContext: yourself? if you are, don't do that - 
> just call -setNeedsDisplay on the layer, it will do the right thing.

Yes, that exactly what I do: I have set up a custom loop event, that I trigger 
each time I need to recache the content, and the handler of that custom event 
calls -setNeedsDisplay, but in the context of the tile thread.

> But at the same time, you could probably simplify this a lot by creating 
> CGImages with your content and then assign those images as the contents of 
> your layers from the main thread. This is almost certainly likely to be 
> simpler and less error prone (as well as allowing for a cleaner handoff of 
> content).

The problem is one of smoothness. One of the layers I want to display has more 
than 1,500,000 points. If I try to display it on the main thread, I get the 
wheel, because everything above 100,000 points (CGArcs) takes a few seconds to 
be rendered (the whole 1,500,000 set is redrawn in about 20 seconds, and that 
includes decoding PostGIS HexEWKT geometry format). The goal was to delegate 
display to secondary threads so that I can keep scrolling and interacting even 
while refreshing large datasets like the one I cited.

But of course, for raster tile display, I shall abide by your advice.

Thanks a lot for your ongoing help and support,
Vincent_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to