Re: Simulating sublayers in CATiledLayer
Re: Simulating sublayers in CATiledLayer
- Subject: Re: Simulating sublayers in CATiledLayer
- From: David Duncan <email@hidden>
- Date: Fri, 21 Mar 2014 09:28:39 -0700
On Mar 21, 2014, at 3:53 AM, Remco Poelstra <email@hidden> wrote:
> Hi,
>
> I'm working on an iOS app which needs to draw paths. Drawing is performed in layers, each layer having its own color. Some paths add (opaque) content, while some paths remove content (i.e. draw in a clear color). Content removal should only happen on a per layer basis. This model fits exactly with CALayer, with a CALayer for each drawing layer.
> The drawing layers can contain up to 30000 paths.
> Since I want to be able to zoom in, I'm using CATiledLayer. Unfortunately CATiledLayer does not allow sub layers.
Thats news. What makes you believe this?
> Now I can create a container layer which contains all the drawing layers as sublayers and call [containerLayer renderInContext:], to render it to the CATiledLayer, but it will render the complete layer for each and every tile. So performance drops considerably. I also noticed that this route only works with CAShapeLayers for each path. A custom drawInContext: does not get invoked.
> If I render all paths directly to the CATiledLayer and check the bounding boxes against the clipbox I get reasonable performance, but paths drawn in clear color will remove all content below them, not only content from the same drawing layer.
> Is there some way to render a container layer to a CATiledLayer while keeping any knowledge about the clipping path (i.e. skipping over any paths which are outside the clip bounds)?
>
> Thanks in advance.
>
> Kind regards,
>
> Remco Poelstra
>
>
> _______________________________________________
>
> 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
--
David Duncan
_______________________________________________
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