JDK-8262499 : Implement JEP 382: New macOS Rendering Pipeline
  • Type: CSR
  • Component: client-libs
  • Sub-Component: 2d
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 17
  • Submitted: 2021-02-27
  • Updated: 2021-03-10
  • Resolved: 2021-03-10
Related Reports
CSR :  
Description
Summary
-------

Provide a new implementation system property to enable the Java 2D Metal rendering pipeline for macOS.

Problem
-------

Java 2D has previously supported only OpenGL for on-screen rendering on macOS. With the delivery of the new Metal API rendering pipeline, and since Metal will be "off by default", we need a way to turn it on.

Solution
--------

Follow the established pattern used on other platforms where there are  multiple pipelines and provide an implementation system property "sun.java2d.metal" which can be used to select this new optional pipeline.

Specification
-------------

The system property name is "sun.java2d.metal" and a value specified as
-Dsun.java2d.metal = "t" | "T" |  "true" | "True" | ""
will request the Metal API pipeline to be used where it is available and supported.

In the event that metal becomes the default and an alternative pipeline is available, Metal can be disabled by specifying

-Dsun.java2d.metal= "f" | "F" |  "false" | "False" 

The options with an initial capital letter are verbose options which cause a message to be printed to System.out confirming whether the Metal pipeline was enabled.

On platforms other than macOS this system property has no effect.

Comments
Thanks for the additional context [~prr]; moving to Approved.
10-03-2021

It was implied but not explicit that "following the pattern of other cases includes the nomenclature. We have at least these : sun.java2d.xrender (Linux) sun.java2d.d3d (Windows) sun.java2d.opengl (Linux and Windows) and that last one now has relevance on macOS too as it is the alternative to metal in the event metal becomes the default so it would be REALLY weird to use different prefixes .. And all (or at least almost all) other java2d properties unrelated to rendering pipeline are sun.java2d.* (eg sun.java2d.debugfonts) so anything other than sun.java2d would be very odd.
09-03-2021

Moving to Provisional; not Approved. Should a jdk.* rather than a sun.* prefer be used for the new system property or are there already analogous sun.java2d.* system properties for platform-specific rendering pipelines?
09-03-2021