Welcome to the Lanai Project!
The goal of this Project is to implement a new graphics rendering pipeline for macOS.
On this wiki we should therefore see regular updates of
- Current status / achievements / where to get the code etc.
- Work in progress
- Future plans
Where does a rendering pipeline fit in ?
It is transparent to applications but here's why it matters :
Most Java SE UI applications are written using the Swing toolkit. This is a lightweight toolkit that renders using the Java 2D API.
Internally Java 2D can use software rendering plus a blit to the screen or it can use a platform-specific API, such as X11/Xrender or Direct3D, or on MacOS, OpenGL.
These platform APIs often offer much better performance of the application than software rendering and generally off-load the CPU.
Metal is the new Apple platform API for such rendering replacing OpenGL. The name has NOTHING to do with the Swing Metal L+F. That is just a coincidence.
Information on Metal here : https://developer.apple.com/metal/
Why are we doing this ?
1) OpenGL is deprecated :
2) Metal offers a promise of better performance.
- Fully functional pipeline
Feature parity (at least) with the existing OpenGL pipeline
Performance as good or better than OpenGL in real applications as well as benchmarks
No regressions or TCK failures
A clean architecture that both fits into the existing 2D design and takes advantage of Metal features such as greater support for concurrent rendering.=
Leverage this work to also support development of a Metal rendering pipeline for the OpenJFX project which is similarly impacted.
What has happened so far ?
When Apple formally deprecated OpenGL in Summer 2018, we realised we needed to begin looking into Metal ASAP.
Since then Oracle engineers have been prototyping to gain an understanding of the Metal API, motivated mainly by that announced deprecation of OpenGL.
This work was published in the openjdk sandbox as the metal-prototype-branch here : http://hg.openjdk.java.net/jdk/sandbox
Focus so far has been on mapping metal as a peer to the existing OpenGL pipeline and implementing basic geometric primitive rendering.
This is currently being followed up by prototyping text and image rendering.
Independently JetBrains were also already working on a Metal pipeline, motivated mainly by the prospect of better performance.
Their prototype is published as an OpenJDK contribution in the webrev here :http://cr.openjdk.java.net/~avu/JDK-8220154/webrev.00This was then merged with the Oracle work in the sandbox.
Now that Lanai has been instituted, as of August 22nd 2019 we have moved the code to the lanai project repositories and closed the sandbox branch so that both Oracle and JetBrain engineers can collaborate on the same repository.
Recent space activity