title: Java2D Performance Issues
body: <p>I'm having performance oddities with Java2D. I know of the sun.java2d.opengl VM parameter to enable 3D acceleration for 2D, but even using that has some weird issues. </p>
  
  <p>Here are results of tests I ran:</p>
  
  <p>Drawing a 25x18 map with 32x32 pixel tiles on a JComponent<br>
  Image 1 = .bmp format, Image 2 = A .png format</p>
  
  <h2>Without -Dsun.java2d.opengl=true</h2>
  
  <p>120 FPS using .BMP image 1<BR>
  13 FPS using .PNG image 2</p>
  
  <h2>With -Dsun.java2d.opengl=true</h2>
  
  <p>12 FPS using .BMP image 1<BR>
  700 FPS using .PNG image 2</p>
  
  <p>Without acceleration, I'm assuming some kind of transformation is taking place with every drawImage() I do in software, and is pulling down the FPS considerably in the case of .PNG. Why though, with acceleration, would the results switch (and PNG actually performs incredibly faster)?! Craziness!</p>
  
  <p>.BMP Image 1 is translated to an image type of TYPE_INT_RGB. .PNG Image 2 is translated to an image type of TYPE_CUSTOM. In order to get consistent speed with and without opengl acceleration, I have to create a new BufferedImage with an image type of TYPE_INT_ARGB, and draw Image 1 or Image 2 to this new image. </p>
  
  <p>Here are the results running with that:</p>
  
  <h2>Without -Dsun.java2d.opengl=true</h2>
  
  <p>120 FPS using .BMP image 1<BR>
  120 FPS using .PNG image 2</p>
  
  <h2>With -Dsun.java2d.opengl=true</h2>
  
  <p>700 FPS using .BMP image 1<BR>
  700 FPS using .PNG image 2</p>
  
  <p>My real question is, can I assume that TYPE_INT_ARGB will be the native image type for all systems and platforms? I'm assuming this value could be different. Is there some way for me to get the native value so that I can always create new BufferedImages for maximum performance? </p>
  
  <p>Thanks in advance...</p>