Use directx or Jogl acceleration may be less interesting than turn of them.
Has anybody noticed that the using of directx or Jogl may slow down a swing application displaying? (at least since Java 1.6.10 and later, No problem with all the previous recent version).
I have written an animation scheduler that looks like flash editor.
The animation does not currently work in full screen mode.
I have made some tests using diferent ways to animate some elements. and the results I got are quite different.
1) I have created two BufferedImages on which the elements are drawn. while the first BufferedImage is shown ,I draw onto the second one and so one (nothing special , it's the double buffering approach)
The BufferedImages are drawn to the graphics context of a JPanel.
To get the best result, I have to turn off the graphical acceleration through the parameter sun.java2d.d3d=false
2) I have created a canvas and used the bufferstrategy features with of course the DirectX acceleration turned on.
Until now I get better results with the first way above all when calculation to transform the elements are needed.
The second approach is quite similar as the first one if directx is turned off too, but where is the interest to use buffer strategy if the graphical acceleration is turned off.
The main container (JPanel or Canvas) dimensions: 700x700
The only one element is an image: dimensions: 291x 222
I have set that the animation has 103 cycles, the image appears onto the screen with a blur effect. (the main rule that the scheduler has to take care is the total time that the animation has to take to be played entirely even if for that some frames have to be skipped. (nothing special common case)
75 FPS 60 FPS 50 FPS 40 FPS 30 FPS
Number of frames
skipped: 12/103 2/103 0/103 0/103 0/103
Number of frames
36/103 22/103 5/103 2/103 0/103
Finally whatever the approach used, as soon as the d3d pipeline is turned on , the animation slow down.