- Loading...
A working prototype of basic feature-set with Java 2D Metal rendering pipeline has been implemented for -
supported all parameters of blit operations
fixed resources leaks, added minor optimizations (in PipelineStateStorage and TexPool)
refactored MTLContext (splited into several classes)
fixed issues connected with changes of pipelineState
added minor optimizations (don’t change state when possible)
It is available in the lanai repo https://hg.openjdk.java.net/lanai/lanai/
It can be tested with J2DDemo (available at - src/demo/share/jfc/J2Ddemo) that shows working / partially working / not-working Java 2D features with Metal rendering as compared with OpenGL rendering.
VM option -Dsun.java2d.metal=True needs to be passed in to switch rendering pipeline to Metal.
Also, antialiasing needs to be turned off (which is on by default in J2DDemo)
Current focus area is - Rendering performance evaluation :
As basic blocks of rendering have been implemented, it is a good time to check on rendering performance to evaluate how Metal rendering in Java 2D fares as compared to OpenGL rendering in Java 2D. As a first step, we are using below test benchmarkings -
The performance numbers for Java 2D Metal rendering pipeline are not up to the mark as compared to the Java 2D OpenGL rendering pipeline. Multiple design level optimizations are being done to address this.
Current numbers from RenderPerfTest (OGL vs Metal):
Bench | OGL | Metal |
---|---|---|
FlatOval(AA) | 71(18) | 72(5) |
FlatBox(AA) | 87(90) | 87(6) |
Image(AA) | 91(90) | 88(88) |
RotatedBox(AA) | 88(84) | 89(6) |
RotatedOval(AA) | 77(19) | 78(8) |
LinGradRotatedOval | 28 | 74 |
WiredBubbles(AA) | 44(14) | 46(5) |
WiredBox | 85 | 88 |
Lines | 85 | 85 |
FlatQuad(AA) | 71(9) | 73(1) |
WiredQuad(AA) | 57(13) | 60(5) |
TextNoAA | 94 | 62 |
TextLCD | 81 | 57 |
TextGray | 88 | 58 |