--- old/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java 2019-05-16 19:15:43.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java 2019-05-16 19:15:42.000000000 +0300 @@ -109,6 +109,8 @@ import sun.awt.SunToolkit; import sun.awt.datatransfer.DataTransferer; import sun.awt.util.ThreadGroupUtils; +import sun.java2d.macos.MacOSFlags; +import sun.java2d.metal.MTLRenderQueue; import sun.java2d.opengl.OGLRenderQueue; import sun.lwawt.LWComponentPeer; import sun.lwawt.LWCursorManager; @@ -485,7 +487,11 @@ @Override public void sync() { // flush the OGL pipeline (this is a no-op if OGL is not enabled) - OGLRenderQueue.sync(); + if (MacOSFlags.isMetalEnabled()) { + MTLRenderQueue.sync(); + } else { + OGLRenderQueue.sync(); + } // setNeedsDisplay() selector was sent to the appropriate CALayer so now // we have to flush the native selectors queue. flushNativeSelectors();