--- old/src/java.desktop/macosx/classes/sun/java2d/MacosxSurfaceManagerFactory.java 2019-03-05 14:31:11.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/MacosxSurfaceManagerFactory.java 2019-03-05 14:31:11.000000000 +0300 @@ -27,6 +27,8 @@ import sun.awt.image.SunVolatileImage; import sun.awt.image.VolatileSurfaceManager; +import sun.java2d.macos.MacOSFlags; +import sun.java2d.metal.MTLVolatileSurfaceManager; import sun.java2d.opengl.CGLVolatileSurfaceManager; /** @@ -49,6 +51,7 @@ public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg, Object context) { - return new CGLVolatileSurfaceManager(vImg, context); + return MacOSFlags.isMetalEnabled() ? new MTLVolatileSurfaceManager(vImg, context) : + new CGLVolatileSurfaceManager(vImg, context); } }