简体   繁体   中英

What is the Windows (and Linux?) equivalent of the Apple Java property apple.awt.graphics.UseQuartz?

For my application drawing with Graphics2D increases in speed by about 5 times when I set

System.setProperty("apple.awt.graphics.UseQuartz","true");

Is there a known equivalent for other platforms to take advantage of hardware acceleration?

Edit: I should point out that on Windows I believe it's not accelerated because it's running a lot slower than on my Mac despite the Windows machine having much much more powerful CPU and GPU.

You can turn on OpenGL optimization:

System.setProperty("sun.java2d.opengl","true");

You can see Java's full list of system properties for Java2D for more.

Note that I tried this, and it seemed to have no effect when I called System.setProperty on this. In order to have any effect, I had to use -Dsun.java2d.opengl=true as a VM argument. Even then, when I did it, it slowed down my application significantly. I did most of my testing with our most custom Swing component, which did a lot of painting directly with the Graphics2D object. It also interfered with our ability to probe the screen dimensions. So I leave this property off. You might find some other helpful properties in the link, however. This testing was done under Linux.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM