drawImage perfomance on Leopard

I have some code that scales images. It is based on code from “Filthy Rich Clients”. It runs great on Windows/Linux and Mac OS X 10.4. However, on Leopard (10.5) it slows down significantly. I have narrowed it down to the following code snippet:

	
			BufferedImage tmp = new BufferedImage( w, h, type );
			Graphics2D g2 = tmp.createGraphics();
			if( hint != null )
			{
				g2.setRenderingHint( RenderingHints.KEY_INTERPOLATION, hint );
			}
			g2.drawImage( ret, 0, 0, w, h, null );
			g2.dispose();

The call to drawImage() takes about 400ms. to complete. The initial image is 2048x3072 and the target is 50x72.

When I run the exact same code with the exact same image on Leopard, the drawImage() call takes over 2 MINUTES to complete.

Anybody have any suggestions?

Thanks,

Steve

Java-1.5.0 on Leopard switched from their quarzt-java2d-backend to a software-only java2d pipeline.
There is some switch which loads the “old” java2d pipeline, I dont know its exact name but I am sure you’ll be able to find it on the net.

Best would be if you could write a small testcase and post a description to: java-dev@lists.apple.com

lg Clemens

to enable ogl-pipeline use -Dsun.java2d.opengl=True and maybe it can solve managed images acceleration issues. for more information log at java.sun.com and look for Managed Image acceleration. Thus Leopard is faster as the previous v. because I can tell it I’m using it.
Can you write up some more of your code sample ? BufferedImage (also known as Managed Image) must be used in common with a MediaTracker to be efficient. If you find loading too slow, you may add JAI ImageIO FileChannel’s to read your pic’s. JAI was impl. in Tiger for sure but as I load this extension in my application every time, I cannot tell if it is the case for Leopard which still uses the same old JRE 5.