Re: Pure Quartz vs. Cocoa-Objects ... why is Quartz slower?
Re: Pure Quartz vs. Cocoa-Objects ... why is Quartz slower?
- Subject: Re: Pure Quartz vs. Cocoa-Objects ... why is Quartz slower?
- From: Michael Becker <email@hidden>
- Date: Sun, 13 Feb 2005 02:46:01 +0100
The way I got good performance from beginning to end is to use a
mutable dictionary to store the NSBitmapReps. In my drawRect: method I
only ever draw images that are currently visible in the my clipView.
Drawing as little as possible is always a good thing, and sometimes
easy to overlook.
I am doing the same right now, and it works great when I am scrolling
the view, because only the images that appear at the top or bottom are
being redrawn. What bothers me, though, is the fact that when I zoom
out far enough to make the images very small, performance is going down
because I have to draw, say, 50 BitmapImageReps and no matter how small
they are, they're still being resized and drawn.
My idea now is to specify certain thresholds where the images get
recached in different sizes. So if you zoom them smaller than 100
pixels wide, the image gets recached in a 40 pixels wide format... I am
not sure.
The one thing that I don't yet fully understand is, how iPhoto creates
this "delayed quality improvement" thing. That means, if you zoom the
images, their quality is fairly bad, but gets automatically updated
after a couple of moments.
Besides: I noticed why my Quartz was slower. I didn't cache the images,
so the JPEG data was being decoded on each redraw. I fixed that with
the help of the Quartz-dev mailinglist.
Cheers,
Michael
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden