Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8284378: Make Metal the default Java 2D rendering pipeline for macOS
Reviewed-by: kcr, avu, prr, jdv
  • Loading branch information
aghaisas committed Apr 8, 2022
1 parent b55c32f commit 3a0ddeb
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/java.desktop/macosx/classes/sun/java2d/MacOSFlags.java
@@ -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
Expand Down Expand Up @@ -91,13 +91,12 @@ private static void initJavaFlags() {
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) {
Expand Down

1 comment on commit 3a0ddeb

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.