title: Java 6 Hardware Acceleration on Mac OS X
body: <p>I have a java application I wrote that loads up a TTF font and uses the <code>drawString</code> method from Graphics2D. This gets called every 50ms with the x and y positions changing each time to make the text move. When I run the program on Windows, I get 0-1% CPU usage, but on Mac I get about 75% usage. This Windows machine does have a better CPU but there's no way there should be that big of a difference. I think it has to do with Hardware Acceleration and I want to know how enable it. I found some <a href="http://developer.apple.com/mac/library/documentation/Java/Reference/Java_PropertiesRef/Articles/JavaSystemProperties.html" rel="nofollow noreferrer">Mac specific Java properties</a>, but none of them lowered my CPU usage. Any ideas how to increase Java 2D performance on OS X? Thanks.</p>
  <p>EDIT1: I thought that these properties would help but they didn't.</p>
  <p><code>System.setProperty(&quot;sun.java2d.opengl&quot;, &quot;true&quot;);</code>
  <code>System.setProperty(&quot;apple.awt.graphics.UseQuartz&quot;,&quot;true&quot;);</code>          <code>System.setProperty(&quot;apple.awt.graphics.EnableQ2DX&quot;,&quot;true&quot;);</code></p>
  <p>EDIT2: <s>You can download the project source and byte code here: <a href="http://drop.io/ExampleScreenSaver" rel="nofollow noreferrer">http://drop.io/ExampleScreenSaver</a></s></p>
  <p>EDIT3: Since drop.io no longer exists, I uploaded the project to <a href="http://code.google.com/p/example-screen-saver-java/source/checkout" rel="nofollow noreferrer">Google Code</a>. Now you can browse the code without downloading it. I still have no idea how to approach this problem so any help would be appreciated.</p>