Is there a way to detect if Java FX is using hardware acceleration?

前提是你 提交于 2019-12-04 11:17:38

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.

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.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!