Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quickest Drawing Method



hoi matt,

maybe i don't understand what exactly you are drawing..
in my case, the 'tiny bitmap that containst all elements' looks something like this;


TIFF image

 (with dividing lines to illustrate the 'tiles')


If a small part of my window needs drawing, then every image has to be applied again

maybe you are compositing several layers with large images.
in that case using CGLayers can still speed-up drawing, as long as you re-use them (see docs).
so as long as the images (and paths and masks..) you use to composit are the same, use CGLayers.


.a

On Jul 28, 2007, at 9:52 AM, spiderlama wrote:

On 27/07/2007, at 11:38 AM, arri wrote:
my approach at this point is;

- create a tiny bitmap (CGBitmapContext) that containst all elements needed to draw the 'big image'

- from that image, create tiles (corners, borders body etc..) and cache those as CGLayers
the docs teach us that those are actually cached on the graphics- card where approreate/needed/possible..


- in the drawrect:-routine, check what needs to be drawn, and draw only that.

So if I was to apply this methodology to my app, I should:

- create a CGBitmapContext (how do I make it small/contain all the images I want to draw)
- create a CGLayer for each of the images I need to draw
- in drawRect make the path and then draw the images as needed.


I don't know if this method would increase the drawing speed. If a small part of my window needs drawing, then every image has to be applied again (as every image is applied to the full size of the window). Meaning that no steps can be skipped for different drawing rectangles. Right now I:

- create CGImages of the images
- in drawRect make the path and then draw the images.

I think the "lagginess" comes from the fact that I am continually changing the window's size.

Cheers
Matt
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Quickest Drawing Method (From: spiderlama <email@hidden>)
 >Re: Quickest Drawing Method (From: arri <email@hidden>)
 >Re: Quickest Drawing Method (From: spiderlama <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.