Questions about unsafe usage of MarlinFX and ARM

29 views
Skip to first unread message

Никита Карпухин

unread,
Aug 27, 2018, 4:21:05 AM8/27/18
to marlin-renderer
Hi. I have some questions about using MarlinFX in my project.
I'm writing a JavaFX app that will run on JDK8u202 on Raspberry Pi. The app uses regular controls and some fade/translate animations. So here are my questions:
  1. What exactly is unsafe about building my own marlin-fx jar based on jfxrt.jar? What could go wrong and how that differs from using marlin that is already integrated (like on OpenJDK 9-11)?
  2. Do I need to use MarlinFX at all, if my app has just buttons, lists, charts and transition animations?
  3. Does MarlinFX support ARM platform in any way? I wanted to build unsafe jar from jfxrt.jar taken from embedded OpenJFX build (which is half the size of the regular one, no Media, no Swing), but it fails, well, because there's no Swing support:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.2:testCompile (default-testCompile) on project marlinfx: Compilation failure: Compilation failure:
[ERROR] /home/gray/marlin-fx/src/test/java/test/com/sun/marlin/ClipShapeTest.java:[48,26] package javafx.embed.swing does not exist

Since this error came from package with tests, is there a way to build version for ARM without it (that is, if an answer to my second question is "yes")?

Laurent Bourgès

unread,
Aug 27, 2018, 9:48:30 AM8/27/18
to marlin-...@googlegroups.com
Hi,

I'm writing a JavaFX app that will run on JDK8u202 on Raspberry Pi. The app uses regular controls and some fade/translate animations. So here are my questions:
  1. What exactly is unsafe about building my own marlin-fx jar based on jfxrt.jar? What could go wrong and how that differs from using marlin that is already integrated (like on OpenJDK 9-11)?
The main problem consists in building marlinFX Unsafe branch, the name of branch means it just uses sun.misc.Unsafe class.
As it needs javafx 8 classes, the build will only patch the given jfxrt.jar so it is not portable accross platforms (jfxrt.jar has different pipeline classes like D3D or OpenGL on win / mac).
In JDK9-10, I integrated MarlinFX but in JDK11, JavaFX has been removed from OpenJDK and OpenJFX 11 is going to provide alternate packages (maven / gradle artefacts).

In conclusion, MarlinFX can be built on jdk8 (including jfxrt.jar) but the patched jar will only work on the same platform for testing purposes, as you have to hack the bootclasspath.
  1. Do I need to use MarlinFX at all, if my app has just buttons, lists, charts and transition animations?
Not sure, MarlinFX gives better performance & better quality for graphic intensive apps (maps, charts ...) but as its memory footprint is lower, it could be important for small devices.
 
  1. Does MarlinFX support ARM platform in any way? I wanted to build unsafe jar from jfxrt.jar taken from embedded OpenJFX build (which is half the size of the regular one, no Media, no Swing), but it fails, well, because there's no Swing support:
I never tried myself, but MarlinFX is only pure java code so it should work better. As it uses sun.misc.Unsafe, MarlinFX performance may be different on ARM than on x64 architecture.
 

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.2:testCompile (default-testCompile) on project marlinfx: Compilation failure: Compilation failure:
[ERROR] /home/gray/marlin-fx/src/test/java/test/com/sun/marlin/ClipShapeTest.java:[48,26] package javafx.embed.swing does not exist

Since this error came from package with tests, is there a way to build version for ARM without it (that is, if an answer to my second question is "yes")?

You could try disabling tests:
mvn -Dmaven.test.skip=true clean install

Laurent

Никита Карпухин

unread,
Aug 27, 2018, 10:19:31 AM8/27/18
to marlin-...@googlegroups.com
The error about javafx.embed.swing was thrown when I was already building with -DskipTests=true, it still tries to compile them. I have actually decided to try and experiment with OpenJDK10 (and later 11, when it comes out), I'll post here if I have any success (and I'll see how it performs on ARM with DemoFX at least)

пн, 27 авг. 2018 г. в 18:48, Laurent Bourgès <bourges...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "marlin-renderer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to marlin-render...@googlegroups.com.
To post to this group, send email to marlin-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages