问题
And related to that, is there a way to force Java FX to use hardware acceleration and bomb if it is unable to?
回答1:
Just found out:
You can run with -Dprism.verbose=true
which will print what graphics pipeline it uses. "sw" or "j2d" for software and "d3d" or "es2" for hardware accelerated.
回答2:
You can also try this hack
@SuppressWarnings("restriction")
static String getCurrentGraphicsPipeline() {
return com.sun.prism.GraphicsPipeline.getPipeline().getClass().getName();
}
If you get back "com.sun.prism.sw.SWPipeline"
then you're using software acceleration. All other values will mean that probably some form of hardware acceleration is being used.
回答3:
If you are using eclipse as IDE, then you need to pass these VM arguments. You can add these VM arguments in the run Configurations.
Put these arguments there:
-Dprism.verbose=true

来源:https://stackoverflow.com/questions/14566379/is-there-a-way-to-detect-if-java-fx-is-using-hardware-acceleration