< prev index next >
src/java.desktop/macosx/classes/sun/java2d/MacosxSurfaceManagerFactory.java
Print this page
rev 55352 : JB_base_webrev
@@ -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);
}
}
< prev index next >