How to Disable or Bypass Hardware Graphics Acceleration(Prism) in Javafx

How to disable or bypass Hardware Graphics Acceleration(Prism) in JavaFX

Look at this forum: https://forums.oracle.com/message/11018975

Add this to your java execution:

-Dprism.order=j2d

That should do the trick.

What do d3d, es2, j2d, null3d, and sw in the javafx prism package represent?

Those packages represent implementations of different graphics-pipelines

  • d3d is short for Direct3D, part of DirectX
  • es2 is for OpenGL ES2.0
  • j2d represents the Java 2D API
  • null3d - not sure but probably a dummy-implementation for development/testing
  • sw - software pipeline

JavaFX 0x300b: Could not get EGL surface

Finally I figured out...
Since I'm using buildroot all raspberry pi userland (GPU) libraries are in the /usr/lib folder. However, going deep in the monocle source code, more precisely in the DispmanPlatformFactory.java, we can see the the way they match the platform is to search for the libbcm_host.so in /opt/vc/lib which does not exist in the buildroot configuration. A quick workaround for those who use buildroot is to create a symbolic link to libbcm_host.so in /opt/vc/lib

JavaFx badly displayed scene

It's an Environmental Issue

Likely JavaFX is incompatible with your video card and drivers.

Workaround

To workaround the rendering bug on your machine, explicitly disable the hardware rendering pipeline for JavaFX and only use the software rendering pipeline:

-Dprism.order=sw using a java -D property.

The behaviour you experienced seems buggy

The behavior looks like a bug. I think that, in the case of an unsupported graphics card, JavaFX is supposed to exit with an unsupported error or fall back to a software rendering pipeline rather than display garbled junk. You may wish to file a bug report at http://bugreport.java.com.

If you file a bug report so ensure that you include all information about the machine used for testing:

  • Machine make and model.
  • Video card or integrated graphics processor used.
  • Exactly what version of the video drivers are installed.
  • OS and Java version used.

You might also want to try updating your video card drivers and seeing if that fixes the issue.

Gate usage of conditional features using Platform.isSupported

Effects are conditional features, ensure you check if the the EFFECT conditional feature is enabled for your system before you try to use an effect. Use Platform.isSupported:

if (Platform.isSupported(ConditionalFeature.EFFECT)) {
// use effects
}

If this fixes your issue, it is still an issue with the underlying JavaFX system as documentation states:

Using a conditional feature on a platform that does not support it will not cause an exception. In general, the conditional feature will just be ignored. See the documentation for each feature for more detail.

which is not occurring in your case.



Related Topics



Leave a reply



Submit