Re: Threaded drawing
Re: Threaded drawing
- Subject: Re: Threaded drawing
- From: Graham Cox <email@hidden>
- Date: Fri, 06 Dec 2013 12:38:37 +0100
On 6 Dec 2013, at 12:14 pm, Roland King <email@hidden> wrote:
> That's very ingenious. Not an OSX expert myself but it does bother me that you're not drawing into the context you are given but one you construct yourself from a piece of the window. That's not something I think iOS would even let you get at.
>
> For a start does that work layer backed?
Not tried it, but...
>
> Is there always a guaranteed correspondence between the context passed to drawrect and the window like that? Does OSX never choose to render to a bitmap and then blend to the window store later?
I don’t know, but my next step was to embed the view in a scroller. Doesn’t work, so either the scroller is buffering its content somehow and there is a discrepancy in the contexts, or else I’m not doing the right thing with the CTM. (I suspect the former, more experiments to come).
> That might be another way, by the way, render to your own tiled small bitmaps on background threads then blit them into the real context.
Yep, that was also on my list to try, but for top performance it would make sense not to do that if it can be avoided.
> Perhaps that code is fine on OSX, I'd certainly be happier if there was a create context from context call you could use to relate your small contexts to the draw rect one.
That was what I looked for at first as well, but there doesn’t appear to be such a call, such as CGContextCreateCopy. Pity, hence the veering into hackery territory. But there may be a cleaner way, I just haven’t discovered it yet.
—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