8284378: Make Metal the default Java 2D rendering pipeline for macOS

Reviewed-by: kcr, avu, prr, jdv
This commit is contained in:
Ajit Ghaisas 2022-04-08 15:11:29 +00:00
parent b55c32f5fe
commit 3a0ddeba52

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -91,13 +91,12 @@ public class MacOSFlags {
PropertyState metalState = getBooleanProp("sun.java2d.metal", PropertyState.UNSPECIFIED);
// Handle invalid combinations to use the default rendering pipeline
// Current default rendering pipeline is OpenGL
// (The default can be changed to Metal in future just by toggling two states in this if condition block)
// The default rendering pipeline is Metal
if ((oglState == PropertyState.UNSPECIFIED && metalState == PropertyState.UNSPECIFIED) ||
(oglState == PropertyState.DISABLED && metalState == PropertyState.DISABLED) ||
(oglState == PropertyState.ENABLED && metalState == PropertyState.ENABLED)) {
oglState = PropertyState.ENABLED; // Enable default pipeline
metalState = PropertyState.DISABLED; // Disable non-default pipeline
metalState = PropertyState.ENABLED; // Enable default pipeline
oglState = PropertyState.DISABLED; // Disable non-default pipeline
}
if (metalState == PropertyState.UNSPECIFIED) {