Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Event handling

    • Dispatch native events on EDT, to avoid potential race conditions when the state is updated both from EDT and toolkit thread. See the full proposal here  

  • Graphics devices support

    • Onscreen/offscreen Wayland surface management

    • Adopt OGL pipeline for rendering on Wayland surfaces

    • Implement a new rendering pipeline based on Vulkan (for better performance)

  • java.awt.Robot

    • Sending input events

    • Reading screen data (at least current java application windows)

  • Client-side decorations for windows

    • Swing internal frames rendering code can be reused

  • Hardware acceleration using  Vulkan.

The prototype implementation of the pure Wayland toolkit (JDK-8281970) based on OpneJDK 21 25 source base can be found in the Wakefield repository (jdk21.0.1jdk25-wayland branch). It has two rendering pipelines:

  • Pure software loops (enabled by default)
  • Hardware-accelerated rendering using Vulkan (enabled by providing -Dsun.java2d.vulkan=True|true)

Most of the graphics primitives are supported in hardware-accelerated rendering, so it's possible to run Swing applications on top of it. 

 java -Dawt.toolkit.name=WLToolkit -Dsun.java2d.vulkan=True -jar J2DdemoSwingSet2.jar


Image RemovedImage Added


Here is an updated build instruction for building jdk21.0.1jdk25-wayland branch (on ubunu 24.04). You need to have at least JDK24 for bootstrapping:

$ sudo wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | tee /etc/apt/trusted.gpg.d/lunarg.asc

...

$ sudo apt-get -y install openjdk-21-jdk file zip unzip autoconf make build-essential libx11-dev libxext-dev libxrender-dev \

...

$ sh configure --with-vulkan

$ make images


Here are some performance resuls with RenderPerfTest:

java -Dawt.toolkit.name=WLToolkit -Dsun.java2d.vulkan=True -jar ./dist/RenderPerfTest.jar 
Vulkan rendering enabled: YES
  Presentation enabled: YES
  Accelerated surface data enabled: YES
  Devices:
    *0: AMD Radeon RX 6800 XT (RADV NAVI21)
     1: llvmpipe (LLVM 19.1.1, 256 bits)
#  Using GraphicsConfiguration(s): [0-0][WLVKGraphicsConfig[B8G8R8A8_UNORM, AMD Radeon RX 6800 XT (RADV NAVI21) (DISCRETE_GPU), LEN LEN T27p-10]]

Test NameMedian(FPS) ± Stddev(FPS) Unit
ArgbSurfaceBlitImage51.736 ± 4.660
ClipFlatBox800.932 ± 18.898
ClipFlatOval283.220 ± 26.588
FlatBox812.571 ± 24.375 FPS
FlatBoxAA811.514 ± 24.884
FlatOval130.565 ± 2.435
FlatOvalAA48.687 ± 0.452
FlatQuad78.028 ± 1.543
FlatQuadAA21.878 ± 0.158
Image48.417 ± 1.658
ImageAA48.626 ± 5.408
LargeTextGray824.941 ± 5.569
LinGrad3RotatedOval0.174 ± 0.002
LinGrad3RotatedOvalAA49.496 ± 0.769
LinGradRotatedOval213.821 ± 8.662
LinGradRotatedOvalAA48.601 ± 0.367
TextGray162.329 ± 1.553
VolImage818.628 ± 12.465
WiredBubbles105.454 ± 3.160