[quote]Can you explain what you mean by compatable formats?
[/quote]
The images with the same format as those returned by createCompatibleImage for one. OS X only supports a few different byte packings natively… if you aren’t using one off them horrible slow conversions will kill your performance.
But more specifically…
/me goes hunting for a message from some apple dude…
found this… doesn’t have what you want but is worth noting…
[quote] From: gerard ziemski ****@apple.com
Subject: Re: drawing fast.
Date: November 12, 2003 4:40:18 PM EST
To: Java-Dev Java <java-dev@lists.apple.com
dude,
what exactly are you trying to draw? is it really just single pixels you’re interested in drawing?
a few pointers:
- if you draw into a buffer, make sure that image is created using createCompatibleImage
- if you draw on-screen directly into Graphics object, never do that from a 3rd thread. for on-screen, only use the graphics objects that you are handed by the repaint mechanism. issuing “repaint” calls from 3rd thread is fine though.
- if the color of pixels you’re drawing is different each time, you should not use fillRect (CoreGraphics is very slow at switching colors). if that is the case you are best off setting the pixels directly in DataBuffer that you get from WritableRaster that you get from your BufferedImage (the pixel layout will be platform dependent). in this case it is critical that the image type is natively supported on Mac OS X.
- clipping will help if the drawing area is really large and you know which part changed
if you give me the access to your test case, I will hopefully be able to help more.
cheers
[/quote]
But what I’m really trying to find is…
/me keeps looking…
Can’t find the exact message…
Basically I think it said something along the lines of TYPE_INT_ARGB_PRE and TYPE_INT_ARGB are supported ‘directly’… possibly others. (RGBA and RGB I think)
The person to ask is Gerard Ziemski (author of quoted message above), I know he visits here… maybe send him a private message.
Ah, I did find this Apple tech note: http://developer.apple.com/technotes/tn/tn2014.html#Section3