I took your advice and I have CATiledLayers now where the
drawInContext: method draws only if the layer only lies in a certain
range.
I want to empty the layer buffer when the layer is not in this range
anymore. Presumably this is done by calling setNeedsDisplay: on
the layer and just drawing nothing into the supplied context.
The problem now is that layers do not receive the drawinContext:
message after invoking setNeedsDisplay:, when they are not in the
visible view bounds. However, my layers are required to draw their
contents until just after they have passed through the "right" of
the view. (the ones that disspear on the left fade first, so they
are in visible range and emptied when faded out)
The result is that CA keeps the layer buffers of every layer that
moves off to the right, and I have no way of emptying them (except
for emptying them when still visible, which is no solution either).
Overriding display: to always call drawinContext: seems hard too
given the threaded workings of CATiledLayer. Is there any
workaround to this?
Is there any way you can take your non-work to the next level. That
is to say, keep track of the position of the images through your own
structures, then only create layers for those that are actually in the
view? That way you could delete the layer (or recycle it in a Layer
Pool) when it moves out of the view.
It would require you to take more of the burden for keeping track of
things on your own, but it might help.
Alternatively, as each layer moves out of frame, perhaps you could set
it's opacity to transparent, move it back onto the view, ask it to
redraw itself (which would run the imaging mechanism, but not change
the display).
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartz-dev/email@hidden