Print this page
Added gradle and cmake project
@@ -25,10 +25,12 @@
package sun.java2d;
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;
/**
* This is a factory class with static methods for creating a
* platform-specific instance of a particular SurfaceManager. Each platform
@@ -47,8 +49,9 @@
* under which the SunVolatileImage was created.
*/
public VolatileSurfaceManager createVolatileManager(SunVolatileImage vImg,
Object context)
{
- return new CGLVolatileSurfaceManager(vImg, context);
+ return MacOSFlags.isMetalEnabled() ? new MTLVolatileSurfaceManager(vImg, context) :
+ new CGLVolatileSurfaceManager(vImg, context);
}
}