/pixel-buffer

Tests the new PixelBuffer class in JavaFX 13

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

PixelBuffer Tests

This project tests the new PixelBuffer class proposed by the pull request javafxports/openjdk-jfx#472, "JDK-8167148: Add native rendering support by supporting WritableImages backed by NIO ByteBuffers." This enhancement is available in JavaFX 13 or later.

Licenses

The content of this project is licensed under the GNU General Public License v3.0 except as follows:

Building

This repository is a project of the Apache NetBeans IDE with the following settings:

  • the Java platform set to the default (JDK 12),
  • the source and binary format set to JDK 12, and
  • references to the JavaFX SDK built from the pull request branch.

Running

Animator

Run the Animator application with a command like the following:

$ $HOME/opt/jdk-12.0.1+12/bin/java --add-modules=javafx.graphics \
    --module-path=$HOME/lib/javafx-sdk-13-dev/lib \
    -Dprism.order=sw -Djavafx.animation.pulse=2 Animator

Change the line in the source code to select either animationOld or animationNew:

        animation = animationNew;

Viewer

Run the Viewer application with a command like the following:

$ $HOME/opt/jdk-12.0.1+12/bin/java --add-modules=javafx.graphics \
    --module-path=$HOME/lib/javafx-sdk-13-dev/lib Viewer

Change the source code to select the method used for converting the AWT image to a JavaFX image:

//        oldDraw();
//        oldCopy();
//        newDraw();
        newCopy();
        view.setImage(jfxImage);

Tester

Run the Tester application with a command like the following:

$ $HOME/opt/jdk-12.0.1+12/bin/java --add-modules=javafx.graphics \
    --module-path=$HOME/lib/javafx-sdk-13-dev/lib Tester

Click the window to cycle between the various methods for converting the AWT image to a JavaFX image.