Re: [OT] Quartz Extreme in developer previews?
Re: [OT] Quartz Extreme in developer previews?
- Subject: Re: [OT] Quartz Extreme in developer previews?
- From: Pierre-Olivier Latour <email@hidden>
- Date: Sat, 13 Jul 2002 22:24:46 +0200
>
> FYI if I do a memcpy() directly from RAM to VRAM then I can copy 190
>
> MB/s. If I instead redraw the contents of an NSView at 800x600 simply
>
> using NSFillRect with a white colour and add a timer to repeat this 60
>
> times pr. second (which amounts to erasing 109 MB/s) then my view
>
> actually only gets redrawn ~40 times pr. second (and the number
>
> increase/decrease if I change the size of my view).
I forgot to add a very important thing: under OS X, windows are
double-buffered. In OS 9, this is not the case.
This simple OS 9 code:
SetPortWindowPort(window);
EraseRect(&(window->portRect));
Will be way faster than its OS X counterpart: since EraseRect draws directly
in VRAM, it can be patched by the graphic card driver to be replaced by a
hardware accelerated function. However, in OS X, NSFillRect has to draw into
the window's back buffer in RAM (where no hw acceleration can occur), then
the result has to be copied to RAM (there is hw acceleration here).
That's problably another reason of the performance problem you are
observing. When you draw into a window, the window back buffer is marked as
"updated", but it's not copied to screen yet. You need to flush it
explicitly if you want the screen to be updated immediately, otherwise, I
believe it will be at the end of the current event processing.
If you want to do a real test, you'd rather do (pseudo-code):
#define count 1000
startime = time();
for(i = 0; i < count; ++i) {
NSFillRect();
FlushWindow();
}
endtime = time();
fps = count / (endtime - startime);
Once again, Quartz Engine is way more powerful and much higher quality than
QuickDraw. You cannot really compare.
_____________________________________________________________
Pierre-Olivier Latour email@hidden
Lausanne, Switzerland
http://www.pol-online.net
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.