On Dec 9, 2013, at 9:23 AM, Kyle Sluder <k...@ksluder.com> wrote:

>> On Dec 9, 2013, at 8:50 AM, Graham Cox <graham....@bigpond.com> wrote:
> 
>> 
>> 
>>> On 9 Dec 2013, at 5:45 pm, David Duncan <david.dun...@apple.com> wrote:
>>> 
>>> If you have a buffer to draw into, then you can easily slice that buffer to 
>>> use between multiple graphics contexts, but you will fundamentally have to 
>>> draw them all into the source context at the end.
>> 
>> 
>> I wasn’t able to figure out how to do this, so I haven’t tested to see if 
>> it’s any faster.
>> 
>> By “slice the buffer”, I assume you mean set up a context on some region of 
>> that buffer, but when I tried to do that, CGBitmapContextCreate[WithData] 
>> would not accept my bytesPerRow value because it was inconsistent with the 
>> ‘width’ value, even though I had calculated the bytesPerRow to be the 
>> correct offset anyway.
>> 
>> So if you know of a practical way to “slice the buffer”, please do share!
> 
> What if all your contexts used the same backing bitmap, but you were 
> extremely careful to set up their clipping regions such that they never 
> touched the same pixels?

That should at least mostly work. I might have some concern for effects that 
should read outside of the clipping region (antialiasing for example), but that 
may not be an issue. You’d notice immediately if it was.

As far as slicing, if CGBitmapContextCreate doesn’t let you use columns & rows, 
it should at least let you use rows, although I would have expected columns & 
rows to work.

> 
> But I'd seriously consider Mike Abdullah's suggestion. It sounds like 
> CATiledLayer does most if not all of this work already.
> 
> --Kyle Sluder

--
David Duncan

_______________________________________________

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

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

Reply via email to