--- old/make/lib/Awt2dLibraries.gmk 2019-05-16 19:15:29.000000000 +0300 +++ new/make/lib/Awt2dLibraries.gmk 2019-05-16 19:15:29.000000000 +0300 @@ -246,6 +246,8 @@ LIBS_macosx := -lmlib_image \ -framework Cocoa \ -framework OpenGL \ + -framework Metal \ + -framework MetalKit \ -framework JavaNativeFoundation \ -framework JavaRuntimeSupport \ -framework ApplicationServices \ @@ -825,6 +827,8 @@ -framework ApplicationServices \ -framework Foundation \ -framework Cocoa \ + -framework Metal \ + -framework MetalKit \ -framework JavaNativeFoundation else ifeq ($(call isTargetOs, windows), true) LIBSPLASHSCREEN_LIBS += kernel32.lib user32.lib gdi32.lib delayimp.lib $(WIN_JAVA_LIB) jvm.lib @@ -887,6 +891,7 @@ libawt_lwawt/awt \ libawt_lwawt/font \ libawt_lwawt/java2d/opengl \ + libawt_lwawt/java2d/metal \ include \ common/awt/debug \ common/java2d/opengl \ @@ -922,6 +927,8 @@ -framework AudioToolbox \ -framework Carbon \ -framework Cocoa \ + -framework Metal \ + -framework MetalKit \ -framework Security \ -framework ExceptionHandling \ -framework JavaNativeFoundation \ @@ -945,6 +952,11 @@ ################################################################################ ifeq ($(call isTargetOs, macosx), true) + XCODE_PATH := $(shell /usr/bin/xcode-select -p) + CompileMetalShaders : + $(XCODE_PATH)/Platforms/MacOSX.platform/usr/bin/metal -O2 -std=osx-metal1.1 -o $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosxui/shaders.air $(TOPDIR)/src/java.desktop/macosx/native/libawt_lwawt/awt/shaders.metal + $(XCODE_PATH)/Platforms/MacOSX.platform/usr/bin/metal-ar r $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosxui/shaders.metal-ar $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosxui/shaders.air + $(XCODE_PATH)/Platforms/MacOSX.platform/usr/bin/metallib -o $(INSTALL_LIBRARIES_HERE)/shaders.metallib $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libosxui/shaders.metal-ar $(eval $(call SetupJdkLibrary, BUILD_LIBOSXUI, \ NAME := osxui, \ @@ -960,6 +972,9 @@ -L$(INSTALL_LIBRARIES_HERE), \ LIBS := -lawt -losxapp -lawt_lwawt \ -framework Cocoa \ + -framework Metal \ + -framework MetalKit \ + -framework OpenGL \ -framework Carbon \ -framework ApplicationServices \ -framework JavaNativeFoundation \ @@ -968,6 +983,7 @@ )) TARGETS += $(BUILD_LIBOSXUI) + $(BUILD_LIBOSXUI): CompileMetalShaders $(BUILD_LIBOSXUI): $(BUILD_LIBAWT) --- old/src/java.base/share/classes/jdk/internal/module/jdk8_packages.dat 2019-05-16 19:15:30.000000000 +0300 +++ new/src/java.base/share/classes/jdk/internal/module/jdk8_packages.dat 2019-05-16 19:15:30.000000000 +0300 @@ -1162,6 +1162,7 @@ sun.java2d.jules sun.java2d.loops sun.java2d.opengl +sun.java2d.metal sun.java2d.pipe sun.java2d.pipe.hw sun.java2d.pisces --- old/src/java.desktop/macosx/classes/sun/awt/CGraphicsConfig.java 2019-05-16 19:15:32.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/awt/CGraphicsConfig.java 2019-05-16 19:15:31.000000000 +0300 @@ -34,6 +34,7 @@ import sun.java2d.SurfaceData; import sun.java2d.opengl.CGLLayer; import sun.lwawt.LWGraphicsConfig; +import sun.lwawt.macosx.CFRetainedResource; import sun.lwawt.macosx.CPlatformView; public abstract class CGraphicsConfig extends GraphicsConfiguration @@ -87,7 +88,7 @@ * Creates a new SurfaceData that will be associated with the given * CGLLayer. */ - public abstract SurfaceData createSurfaceData(CGLLayer layer); + public abstract SurfaceData createSurfaceData(CFRetainedResource layer); @Override public final boolean isTranslucencyCapable() { --- old/src/java.desktop/macosx/classes/sun/awt/CGraphicsDevice.java 2019-05-16 19:15:33.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/awt/CGraphicsDevice.java 2019-05-16 19:15:33.000000000 +0300 @@ -36,6 +36,8 @@ import java.util.Objects; import sun.java2d.SunGraphicsEnvironment; +import sun.java2d.macos.MacOSFlags; +import sun.java2d.metal.MTLGraphicsConfig; import sun.java2d.opengl.CGLGraphicsConfig; public final class CGraphicsDevice extends GraphicsDevice @@ -60,7 +62,9 @@ public CGraphicsDevice(final int displayID) { this.displayID = displayID; - config = CGLGraphicsConfig.getConfig(this, displayID, 0); + config = MacOSFlags.isMetalEnabled() ? + MTLGraphicsConfig.getConfig(this, displayID, 0) : + CGLGraphicsConfig.getConfig(this, displayID, 0); } /** --- old/src/java.desktop/macosx/classes/sun/java2d/MacosxSurfaceManagerFactory.java 2019-05-16 19:15:34.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/MacosxSurfaceManagerFactory.java 2019-05-16 19:15:34.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); } } --- old/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java 2019-05-16 19:15:35.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java 2019-05-16 19:15:35.000000000 +0300 @@ -55,6 +55,7 @@ import sun.java2d.pipe.hw.AccelTypedVolatileImage; import sun.java2d.pipe.hw.ContextCapabilities; import sun.lwawt.LWComponentPeer; +import sun.lwawt.macosx.CFRetainedResource; import sun.lwawt.macosx.CPlatformView; import static sun.java2d.opengl.OGLContext.OGLContextCaps.CAPS_DOUBLEBUFFERED; @@ -264,8 +265,8 @@ } @Override - public SurfaceData createSurfaceData(CGLLayer layer) { - return CGLSurfaceData.createData(layer); + public SurfaceData createSurfaceData(CFRetainedResource layer) { + return CGLSurfaceData.createData((CGLLayer) layer); } @Override --- old/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java 2019-05-16 19:15:36.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java 2019-05-16 19:15:36.000000000 +0300 @@ -249,7 +249,7 @@ } @Override - boolean isOnScreen() { + public boolean isOnScreen() { return true; } --- old/src/java.desktop/macosx/classes/sun/lwawt/LWComponentPeer.java 2019-05-16 19:15:38.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/lwawt/LWComponentPeer.java 2019-05-16 19:15:37.000000000 +0300 @@ -77,8 +77,11 @@ import sun.awt.image.SunVolatileImage; import sun.awt.image.ToolkitImage; import sun.java2d.SunGraphics2D; +import sun.java2d.macos.MacOSFlags; +import sun.java2d.metal.MTLRenderQueue; import sun.java2d.opengl.OGLRenderQueue; import sun.java2d.pipe.Region; +import sun.java2d.pipe.RenderQueue; import sun.util.logging.PlatformLogger; public abstract class LWComponentPeer @@ -1434,7 +1437,8 @@ } protected static final void flushOnscreenGraphics(){ - final OGLRenderQueue rq = OGLRenderQueue.getInstance(); + RenderQueue rq = MacOSFlags.isMetalEnabled() ? + MTLRenderQueue.getInstance() : OGLRenderQueue.getInstance(); rq.lock(); try { rq.flushNow(); --- old/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformView.java 2019-05-16 19:15:39.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformView.java 2019-05-16 19:15:39.000000000 +0300 @@ -33,6 +33,9 @@ import sun.awt.CGraphicsConfig; import sun.awt.CGraphicsEnvironment; +import sun.java2d.macos.MacOSFlags; +import sun.java2d.metal.MTLLayer; +import sun.java2d.metal.MTLSurfaceData; import sun.lwawt.LWWindowPeer; import sun.java2d.SurfaceData; @@ -48,7 +51,7 @@ private LWWindowPeer peer; private SurfaceData surfaceData; - private CGLLayer windowLayer; + private CFRetainedResource windowLayer; private CPlatformResponder responder; public CPlatformView() { @@ -59,7 +62,7 @@ initializeBase(peer, responder); if (!LWCToolkit.getSunAwtDisableCALayers()) { - this.windowLayer = createCGLayer(); + this.windowLayer = MacOSFlags.isMetalEnabled()? createMTLLayer() : createCGLayer(); } setPtr(nativeCreateView(0, 0, 0, 0, getWindowLayerPtr())); } @@ -68,6 +71,11 @@ return new CGLLayer(peer); } + public MTLLayer createMTLLayer() { + return new MTLLayer(peer); + } + + protected void initializeBase(LWWindowPeer peer, CPlatformResponder responder) { this.peer = peer; this.responder = responder; @@ -107,7 +115,10 @@ // ---------------------------------------------------------------------- public SurfaceData replaceSurfaceData() { if (!LWCToolkit.getSunAwtDisableCALayers()) { - surfaceData = windowLayer.replaceSurfaceData(); + surfaceData = (MacOSFlags.isMetalEnabled()) ? + ((MTLLayer)windowLayer).replaceSurfaceData() : + ((CGLLayer)windowLayer).replaceSurfaceData() + ; } else { if (surfaceData == null) { CGraphicsConfig graphicsConfig = (CGraphicsConfig)getGraphicsConfiguration(); @@ -121,7 +132,11 @@ private void validateSurface() { if (surfaceData != null) { - ((CGLSurfaceData)surfaceData).validate(); + if (MacOSFlags.isMetalEnabled()) { + ((MTLSurfaceData) surfaceData).validate(); + } else { + ((CGLSurfaceData) surfaceData).validate(); + } } } @@ -143,7 +158,9 @@ public long getWindowLayerPtr() { if (!LWCToolkit.getSunAwtDisableCALayers()) { - return windowLayer.getPointer(); + return MacOSFlags.isMetalEnabled() ? + ((MTLLayer)windowLayer).getPointer() : + ((CGLLayer)windowLayer).getPointer(); } else { return 0; } --- old/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java 2019-05-16 19:15:40.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java 2019-05-16 19:15:40.000000000 +0300 @@ -62,6 +62,7 @@ import sun.awt.AWTAccessor.ComponentAccessor; import sun.awt.AWTAccessor.WindowAccessor; import sun.java2d.SurfaceData; +import sun.java2d.metal.MTLSurfaceData; import sun.java2d.opengl.CGLSurfaceData; import sun.lwawt.LWLightweightFramePeer; import sun.lwawt.LWToolkit; @@ -1056,6 +1057,8 @@ SurfaceData surfaceData = getSurfaceData(); if (surfaceData instanceof CGLSurfaceData) { ((CGLSurfaceData)surfaceData).validate(); + } else if (surfaceData instanceof MTLSurfaceData) { + ((MTLSurfaceData)surfaceData).validate(); } } --- old/src/java.desktop/macosx/classes/sun/lwawt/macosx/CWarningWindow.java 2019-05-16 19:15:41.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/lwawt/macosx/CWarningWindow.java 2019-05-16 19:15:41.000000000 +0300 @@ -29,6 +29,7 @@ import sun.awt.IconInfo; import sun.java2d.SunGraphics2D; import sun.java2d.SurfaceData; +import sun.java2d.metal.MTLLayer; import sun.java2d.opengl.CGLLayer; import sun.lwawt.LWWindowPeer; import sun.lwawt.PlatformEventNotifier; @@ -300,6 +301,23 @@ } }; } + public MTLLayer createMTLLayer() { + return new MTLLayer(null) { + public Rectangle getBounds() { + return CWarningWindow.this.getBounds(); + } + + public GraphicsConfiguration getGraphicsConfiguration() { + LWWindowPeer peer = ownerPeer.get(); + return peer.getGraphicsConfiguration(); + } + + public boolean isOpaque() { + return false; + } + }; + } + }; } --- 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(); --- old/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.h 2019-05-16 19:15:44.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.h 2019-05-16 19:15:44.000000000 +0300 @@ -24,7 +24,8 @@ */ #import - +#import +#import #import "CDragSource.h" #import "CDropTarget.h" --- old/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m 2019-05-16 19:15:45.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m 2019-05-16 19:15:45.000000000 +0300 @@ -37,6 +37,8 @@ #import #import +jboolean metalEnabled = JNI_FALSE; + @interface AWTView() @property (retain) CDropTarget *_dropTarget; @property (retain) CDragSource *_dragSource; @@ -52,6 +54,8 @@ //#define IM_DEBUG TRUE //#define EXTRA_DEBUG +#define METAL_DEBUG + static BOOL shouldUsePressAndHold() { static int shouldUsePressAndHold = -1; if (shouldUsePressAndHold != -1) return shouldUsePressAndHold; @@ -1477,3 +1481,19 @@ return underMouse; } + +jboolean GetStaticBoolean(JNIEnv *env, jclass fClass, const char *fieldName) +{ + jfieldID fieldID = (*env)->GetStaticFieldID(env, fClass, fieldName, "Z"); + return (*env)->GetStaticBooleanField(env, fClass, fieldID); +} + +JNIEXPORT void JNICALL +Java_sun_java2d_macos_MacOSFlags_initNativeFlags(JNIEnv *env, + jclass flagsClass) +{ + metalEnabled = GetStaticBoolean(env, flagsClass, "metalEnabled"); +#ifdef METAL_DEBUG + fprintf(stderr, "metalEnabled=%d\n", metalEnabled); +#endif +} --- old/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m 2019-05-16 19:15:46.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m 2019-05-16 19:15:46.000000000 +0300 @@ -1171,6 +1171,8 @@ JNF_COCOA_EXIT(env); } +extern jboolean metalEnabled; + /* * Class: sun_lwawt_macosx_CPlatformWindow * Method: nativeGetNSWindowInsets @@ -1197,6 +1199,10 @@ jint left = (jint)(contentRect.origin.x - frame.origin.x); jint bottom = (jint)(contentRect.origin.y - frame.origin.y); jint right = (jint)(frame.size.width - (contentRect.size.width + left)); + if (metalEnabled == JNI_TRUE) { + bottom -= top; + top = 0; + } static JNF_CLASS_CACHE(jc_Insets, "java/awt/Insets"); static JNF_CTOR_CACHE(jc_Insets_ctor, jc_Insets, "(IIII)V"); --- old/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsDevice.m 2019-05-16 19:15:48.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsDevice.m 2019-05-16 19:15:47.000000000 +0300 @@ -26,6 +26,8 @@ #import "LWCToolkit.h" #import "ThreadUtilities.h" #include "GeomUtilities.h" +#import +#import #import @@ -383,4 +385,4 @@ JNF_COCOA_EXIT(env); return ret; -} +} \ No newline at end of file --- old/src/java.desktop/share/classes/sun/java2d/loops/Blit.java 2019-05-16 19:15:49.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/loops/Blit.java 2019-05-16 19:15:49.000000000 +0300 @@ -324,9 +324,13 @@ int srcx, int srcy, int dstx, int dsty, int width, int height) { - tracePrimitive(target); + if ((traceflags & TRACEPTIME) == 0) { + tracePrimitive(target); + } + long time = System.nanoTime(); target.Blit(src, dst, comp, clip, srcx, srcy, dstx, dsty, width, height); + tracePrimitiveTime(target, System.nanoTime() - time); } } } --- old/src/java.desktop/share/classes/sun/java2d/loops/BlitBg.java 2019-05-16 19:15:50.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/loops/BlitBg.java 2019-05-16 19:15:50.000000000 +0300 @@ -209,9 +209,13 @@ int srcx, int srcy, int dstx, int dsty, int width, int height) { - tracePrimitive(target); + if ((traceflags & TRACEPTIME) == 0) { + tracePrimitive(target); + } + long time = System.nanoTime(); target.BlitBg(src, dst, comp, clip, bgColor, srcx, srcy, dstx, dsty, width, height); + tracePrimitiveTime(target, System.nanoTime() - time); } } } --- old/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListAA.java 2019-05-16 19:15:51.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListAA.java 2019-05-16 19:15:51.000000000 +0300 @@ -152,8 +152,12 @@ public void DrawGlyphListAA(SunGraphics2D sg2d, SurfaceData dest, GlyphList glyphs) { - tracePrimitive(target); + if ((traceflags & TRACEPTIME) == 0) { + tracePrimitive(target); + } + long time = System.nanoTime(); target.DrawGlyphListAA(sg2d, dest, glyphs); + tracePrimitiveTime(target, System.nanoTime() - time); } } } --- old/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListLCD.java 2019-05-16 19:15:52.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/loops/DrawGlyphListLCD.java 2019-05-16 19:15:52.000000000 +0300 @@ -109,8 +109,12 @@ public void DrawGlyphListLCD(SunGraphics2D sg2d, SurfaceData dest, GlyphList glyphs) { - tracePrimitive(target); + if ((traceflags & TRACEPTIME) == 0) { + tracePrimitive(target); + } + long time = System.nanoTime(); target.DrawGlyphListLCD(sg2d, dest, glyphs); + tracePrimitiveTime(target, System.nanoTime() - time); } } } --- old/src/java.desktop/share/classes/sun/java2d/loops/DrawLine.java 2019-05-16 19:15:54.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/loops/DrawLine.java 2019-05-16 19:15:53.000000000 +0300 @@ -104,8 +104,12 @@ public void DrawLine(SunGraphics2D sg2d, SurfaceData dest, int x1, int y1, int x2, int y2) { - tracePrimitive(target); + if ((traceflags & TRACEPTIME) == 0) { + tracePrimitive(target); + } + long time = System.nanoTime(); target.DrawLine(sg2d, dest, x1, y1, x2, y2); + tracePrimitiveTime(target, System.nanoTime() - time); } } } --- old/src/java.desktop/share/classes/sun/java2d/loops/FillParallelogram.java 2019-05-16 19:15:55.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/loops/FillParallelogram.java 2019-05-16 19:15:55.000000000 +0300 @@ -111,8 +111,12 @@ double dx1, double dy1, double dx2, double dy2) { - tracePrimitive(target); + if ((traceflags & TRACEPTIME) == 0) { + tracePrimitive(target); + } + long time = System.nanoTime(); target.FillParallelogram(sg2d, dest, x0, y0, dx1, dy1, dx2, dy2); + tracePrimitiveTime(target, System.nanoTime() - time); } } } --- old/src/java.desktop/share/classes/sun/java2d/loops/FillRect.java 2019-05-16 19:15:56.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/loops/FillRect.java 2019-05-16 19:15:56.000000000 +0300 @@ -125,8 +125,12 @@ public void FillRect(SunGraphics2D sg2d, SurfaceData dest, int x, int y, int w, int h) { - tracePrimitive(target); + if ((traceflags & TRACEPTIME) == 0) { + tracePrimitive(target); + } + long time = System.nanoTime(); target.FillRect(sg2d, dest, x, y, w, h); + tracePrimitiveTime(target, System.nanoTime() - time); } } } --- old/src/java.desktop/share/classes/sun/java2d/loops/FillSpans.java 2019-05-16 19:15:57.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/loops/FillSpans.java 2019-05-16 19:15:57.000000000 +0300 @@ -112,8 +112,12 @@ public void FillSpans(SunGraphics2D sg2d, SurfaceData dest, SpanIterator si) { - tracePrimitive(target); + if ((traceflags & TRACEPTIME) == 0) { + tracePrimitive(target); + } + long time = System.nanoTime(); target.FillSpans(sg2d, dest, si); + tracePrimitiveTime(target, System.nanoTime() - time); } } } --- old/src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitive.java 2019-05-16 19:15:58.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitive.java 2019-05-16 19:15:58.000000000 +0300 @@ -40,6 +40,7 @@ import java.util.StringTokenizer; import java.util.Iterator; import java.util.HashMap; +import java.util.HashSet; import java.util.Map; import java.io.PrintStream; import java.io.OutputStream; @@ -322,17 +323,28 @@ public static int traceflags; public static String tracefile; + public static String pname; public static PrintStream traceout; + public static long treshold = 0; + public static boolean verbose = false; public static final int TRACELOG = 1; public static final int TRACETIMESTAMP = 2; public static final int TRACECOUNTS = 4; + public static final int TRACEPTIME = 8; + public static final int TRACEPNAME = 16; + public static final int TRACEPIMPL = 32; + + static void showTraceUsage() { + System.err.println("usage: -Dsun.java2d.trace="+ + "[log[,timestamp]],[count],[ptime],[pimpl],[name:],"+ + "[out:],[td=],[help],[verbose]"); + } static { GetPropertyAction gpa = new GetPropertyAction("sun.java2d.trace"); String trace = AccessController.doPrivileged(gpa); if (trace != null) { - boolean verbose = false; int traceflags = 0; StringTokenizer st = new StringTokenizer(trace, ","); while (st.hasMoreTokens()) { @@ -343,19 +355,33 @@ traceflags |= GraphicsPrimitive.TRACELOG; } else if (tok.equalsIgnoreCase("timestamp")) { traceflags |= GraphicsPrimitive.TRACETIMESTAMP; + } else if (tok.equalsIgnoreCase("ptime")) { + traceflags |=GraphicsPrimitive.TRACEPTIME; + } else if (tok.equalsIgnoreCase("pimpl")) { + traceflags |=GraphicsPrimitive.TRACEPIMPL; + } else if (tok.regionMatches(true, 0, "name:", 0, 5)) { + traceflags |=GraphicsPrimitive.TRACEPNAME; + pname = tok.substring(6); } else if (tok.equalsIgnoreCase("verbose")) { verbose = true; } else if (tok.regionMatches(true, 0, "out:", 0, 4)) { tracefile = tok.substring(4); + } else if (tok.regionMatches(true, 0, "td=", 0, 3)) { + try { + treshold = Long.parseLong(tok.substring(3)); + } catch (NumberFormatException e) { + showTraceUsage(); + } } else { if (!tok.equalsIgnoreCase("help")) { System.err.println("unrecognized token: "+tok); } - System.err.println("usage: -Dsun.java2d.trace="+ - "[log[,timestamp]],[count],"+ - "[out:],[help],[verbose]"); + showTraceUsage(); } } + + GraphicsPrimitiveMgr.setTraceFlags(traceflags); + if (verbose) { System.err.print("GraphicsPrimitive logging "); if ((traceflags & GraphicsPrimitive.TRACELOG) != 0) { @@ -416,7 +442,12 @@ } public static class TraceReporter implements Runnable { - public static void setShutdownHook() { + private static boolean hookEnabled = false; + + public static synchronized void setShutdownHook() { + if (hookEnabled) return; + hookEnabled = true; + AccessController.doPrivileged((PrivilegedAction) () -> { TraceReporter t = new TraceReporter(); Thread thread = new Thread( @@ -430,33 +461,39 @@ public void run() { PrintStream ps = getTraceOutputFile(); - Iterator> iterator = - traceMap.entrySet().iterator(); - long total = 0; - int numprims = 0; - while (iterator.hasNext()) { - Map.Entry me = iterator.next(); - Object prim = me.getKey(); - int[] count = me.getValue(); - if (count[0] == 1) { - ps.print("1 call to "); - } else { - ps.print(count[0]+" calls to "); + if (traceMap != null) { + Iterator> iterator = + traceMap.entrySet().iterator(); + long total = 0; + int numprims = 0; + while (iterator.hasNext()) { + Map.Entry me = iterator.next(); + Object prim = me.getKey(); + int[] count = me.getValue(); + if (count[0] == 1) { + ps.print("1 call to "); + } else { + ps.print(count[0] + " calls to "); + } + ps.println(prim); + numprims++; + total += count[0]; + } + if (numprims == 0) { + ps.println("No graphics primitives executed"); + } else if (numprims > 1) { + ps.println(total + " total calls to " + + numprims + " different primitives"); } - ps.println(prim); - numprims++; - total += count[0]; - } - if (numprims == 0) { - ps.println("No graphics primitives executed"); - } else if (numprims > 1) { - ps.println(total+" total calls to "+ - numprims+" different primitives"); } } } - public static synchronized void tracePrimitive(Object prim) { + public synchronized static void tracePrimitive(Object prim) { + if ((traceflags & TRACEPNAME) != 0) { + if (!prim.toString().contains(pname)) return; + } + if ((traceflags & TRACECOUNTS) != 0) { if (traceMap == null) { traceMap = new HashMap<>(); @@ -478,6 +515,40 @@ } } + public synchronized static void traceImplPrimitive(Object prim, Object msg) { + if ((traceflags & TRACEPNAME) != 0) { + if (!prim.toString().contains(pname)) return; + } + + if ((traceflags & TRACEPIMPL) != 0) { + PrintStream ps = getTraceOutputFile(); + if ((traceflags & TRACETIMESTAMP) != 0) { + ps.print(System.currentTimeMillis()); + } + ps.println(prim + " : " + msg); + } + } + + + public synchronized static void tracePrimitiveTime(Object prim, long time) { + if ((traceflags & TRACEPNAME) != 0) { + if (!prim.toString().contains(pname)) return; + } + if (time > treshold && (traceflags & TRACEPTIME) != 0 && (traceflags & TRACELOG) != 0) { + PrintStream ps = getTraceOutputFile(); + ps.println(prim + " time: " + time); + if (verbose) { + final StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); + if (stackTrace.length > 3) { + for (int i = 3; i < stackTrace.length; i++) { + ps.println(" " + stackTrace[i].toString()); + } + } + ps.println(); + } + } + } + protected void setupGeneralBinaryOp(GeneralBinaryOp gbo) { int primID = gbo.getPrimTypeID(); String methodSignature = gbo.getSignature(); --- old/src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitiveMgr.java 2019-05-16 19:16:00.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/loops/GraphicsPrimitiveMgr.java 2019-05-16 19:15:59.000000000 +0300 @@ -51,6 +51,7 @@ Class Path2D, Class Path2DFloat, Class SHints); private static native void registerNativeLoops(); + static native void setTraceFlags(int traceflags); static { initIDs(GraphicsPrimitive.class, --- old/src/java.desktop/share/classes/sun/java2d/loops/MaskBlit.java 2019-05-16 19:16:01.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/loops/MaskBlit.java 2019-05-16 19:16:01.000000000 +0300 @@ -255,10 +255,14 @@ int width, int height, byte[] mask, int maskoff, int maskscan) { - tracePrimitive(target); + if ((traceflags & TRACEPTIME) == 0) { + tracePrimitive(target); + } + long time = System.nanoTime(); target.MaskBlit(src, dst, comp, clip, srcx, srcy, dstx, dsty, width, height, mask, maskoff, maskscan); + tracePrimitiveTime(target, System.nanoTime() - time); } } } --- old/src/java.desktop/share/classes/sun/java2d/loops/MaskFill.java 2019-05-16 19:16:02.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/loops/MaskFill.java 2019-05-16 19:16:02.000000000 +0300 @@ -237,9 +237,13 @@ int x, int y, int w, int h, byte[] mask, int maskoff, int maskscan) { - tracePrimitive(target); + if ((traceflags & TRACEPTIME) == 0) { + tracePrimitive(target); + } + long time = System.nanoTime(); target.MaskFill(sg2d, sData, comp, x, y, w, h, mask, maskoff, maskscan); + tracePrimitiveTime(target, System.nanoTime() - time); } public void FillAAPgram(SunGraphics2D sg2d, SurfaceData sData, @@ -248,9 +252,13 @@ double dx1, double dy1, double dx2, double dy2) { - tracePrimitive(fillPgramTarget); + if ((traceflags & TRACEPTIME) == 0) { + tracePrimitive(fillPgramTarget); + } + long time = System.nanoTime(); target.FillAAPgram(sg2d, sData, comp, x, y, dx1, dy1, dx2, dy2); + tracePrimitiveTime(fillPgramTarget, System.nanoTime() - time); } public void DrawAAPgram(SunGraphics2D sg2d, SurfaceData sData, @@ -260,9 +268,13 @@ double dx2, double dy2, double lw1, double lw2) { - tracePrimitive(drawPgramTarget); + if ((traceflags & TRACEPTIME) == 0) { + tracePrimitive(drawPgramTarget); + } + long time = System.nanoTime(); target.DrawAAPgram(sg2d, sData, comp, x, y, dx1, dy1, dx2, dy2, lw1, lw2); + tracePrimitiveTime(drawPgramTarget, System.nanoTime() - time); } public boolean canDoParallelograms() { --- old/src/java.desktop/share/classes/sun/java2d/loops/ScaledBlit.java 2019-05-16 19:16:03.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/loops/ScaledBlit.java 2019-05-16 19:16:03.000000000 +0300 @@ -146,10 +146,14 @@ double dx1, double dy1, double dx2, double dy2) { - tracePrimitive(target); + if ((traceflags & TRACEPTIME) == 0) { + tracePrimitive(target); + } + long time = System.nanoTime(); target.Scale(src, dst, comp, clip, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); + tracePrimitiveTime(target, System.nanoTime() - time); } } } --- old/src/java.desktop/share/classes/sun/java2d/loops/TransformHelper.java 2019-05-16 19:16:04.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/loops/TransformHelper.java 2019-05-16 19:16:04.000000000 +0300 @@ -129,11 +129,15 @@ int dx1, int dy1, int dx2, int dy2, int[] edges, int dxoff, int dyoff) { - tracePrimitive(target); + if ((traceflags & TRACEPTIME) == 0) { + tracePrimitive(target); + } + long time = System.nanoTime(); target.Transform(output, src, dst, comp, clip, itx, txtype, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2, edges, dxoff, dyoff); + tracePrimitiveTime(target, System.nanoTime() - time); } } } --- old/src/java.desktop/share/classes/sun/java2d/opengl/OGLContext.java 2019-05-16 19:16:06.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/opengl/OGLContext.java 2019-05-16 19:16:05.000000000 +0300 @@ -42,7 +42,7 @@ private final OGLGraphicsConfig config; - OGLContext(RenderQueue rq, OGLGraphicsConfig config) { + public OGLContext(RenderQueue rq, OGLGraphicsConfig config) { super(rq); this.config = config; } @@ -71,7 +71,7 @@ * situations where we may not otherwise have a current context (e.g. * when disposing a texture-based surface). */ - static void setScratchSurface(long pConfigInfo) { + public static void setScratchSurface(long pConfigInfo) { // assert OGLRenderQueue.getInstance().lock.isHeldByCurrentThread(); // invalidate the current context @@ -92,7 +92,7 @@ * that affect the current context state (e.g. disposing a context or * surface). */ - static void invalidateCurrentContext() { + public static void invalidateCurrentContext() { // assert OGLRenderQueue.getInstance().lock.isHeldByCurrentThread(); // invalidate the current Java-level context so that we @@ -121,7 +121,7 @@ * * @return an id string for the adapter */ - static final native String getOGLIdString(); + public static final native String getOGLIdString(); @Override public void saveState() { @@ -155,18 +155,18 @@ rq.flushNow(); } - static class OGLContextCaps extends ContextCapabilities { + public static class OGLContextCaps extends ContextCapabilities { /** * Indicates the presence of the GL_EXT_framebuffer_object extension. * This cap will only be set if the fbobject system property has been * enabled and we are able to create an FBO with depth buffer. */ @Native - static final int CAPS_EXT_FBOBJECT = + public static final int CAPS_EXT_FBOBJECT = (CAPS_RT_TEXTURE_ALPHA | CAPS_RT_TEXTURE_OPAQUE); /** Indicates that the context is doublebuffered. */ @Native - static final int CAPS_DOUBLEBUFFERED = (FIRST_PRIVATE_CAP << 0); + public static final int CAPS_DOUBLEBUFFERED = (FIRST_PRIVATE_CAP << 0); /** * Indicates the presence of the GL_ARB_fragment_shader extension. * This cap will only be set if the lcdshader system property has been @@ -196,7 +196,7 @@ static final int CAPS_EXT_TEXBARRIER = (FIRST_PRIVATE_CAP << 5); - OGLContextCaps(int caps, String adapterId) { + public OGLContextCaps(int caps, String adapterId) { super(caps, adapterId); } --- old/src/java.desktop/share/classes/sun/java2d/opengl/OGLGraphicsConfig.java 2019-05-16 19:16:07.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/opengl/OGLGraphicsConfig.java 2019-05-16 19:16:07.000000000 +0300 @@ -34,7 +34,7 @@ * GLXGraphicsConfig and WGLGraphicsConfig, making it easier to invoke these * methods directly from OGLSurfaceData. */ -interface OGLGraphicsConfig extends +public interface OGLGraphicsConfig extends AccelGraphicsConfig, SurfaceManager.ProxiedGraphicsConfig { OGLContext getContext(); --- old/src/java.desktop/share/classes/sun/java2d/opengl/OGLTextRenderer.java 2019-05-16 19:16:08.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/opengl/OGLTextRenderer.java 2019-05-16 19:16:08.000000000 +0300 @@ -64,8 +64,13 @@ super(ogltr.rq); } protected void drawGlyphList(SunGraphics2D sg2d, GlyphList gl) { - GraphicsPrimitive.tracePrimitive("OGLDrawGlyphs"); + final String prim = "OGLDrawGlyphs" + (gl.isRGBOrder() ? "LCD" : "Gray"); + if ((GraphicsPrimitive.traceflags & GraphicsPrimitive.TRACEPTIME) == 0) { + GraphicsPrimitive.tracePrimitive(prim); + } + long time = System.nanoTime(); super.drawGlyphList(sg2d, gl); + GraphicsPrimitive.tracePrimitiveTime(prim, System.nanoTime() - time); } } } --- old/src/java.desktop/share/classes/sun/java2d/pipe/GlyphListPipe.java 2019-05-16 19:16:09.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/java2d/pipe/GlyphListPipe.java 2019-05-16 19:16:09.000000000 +0300 @@ -140,4 +140,8 @@ int aaHint) { drawGlyphList(sg2d, gl); } + + public String toString() { + return getClass().getSimpleName(); + } } --- old/src/java.desktop/share/native/libawt/java2d/Trace.h 2019-05-16 19:16:11.000000000 +0300 +++ new/src/java.desktop/share/native/libawt/java2d/Trace.h 2019-05-16 19:16:10.000000000 +0300 @@ -27,11 +27,14 @@ #define _Included_Trace #include +#include "jni_util.h" #include "debug_trace.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ +extern JavaVM *jvm; +extern jint graphicsPrimitive_traceflags; /** * J2dTrace @@ -175,6 +178,59 @@ J2dTraceImpl(level, JNI_TRUE, string, arg1, arg2, arg3, arg4, arg5); \ } +#define J2dTracePrimitive(string) { \ + if (graphicsPrimitive_traceflags && jvm) { \ + JNIEnv *env; \ + jstring jstr; \ + (*jvm)->AttachCurrentThreadAsDaemon(jvm, &env, NULL); \ + jstr = (*env)->NewStringUTF(env, string); \ + JNU_CallStaticMethodByName(env, NULL, "sun/java2d/loops/GraphicsPrimitive", \ + "tracePrimitive", "(Ljava/lang/Object;)V", jstr); \ + (*env)->DeleteLocalRef(env, jstr); \ + } \ + } + +#define J2dTraceNotImplPrimitive(prim) { \ + if (graphicsPrimitive_traceflags && jvm) { \ + char cbuf[255]; \ + JNIEnv *env; \ + jstring jprim; \ + jstring jmsg; \ + snprintf(cbuf, 255, "[NOT IMPL] at %s:%d", __FILE__, __LINE__); \ + (*jvm)->AttachCurrentThreadAsDaemon(jvm, &env, NULL); \ + jprim = (*env)->NewStringUTF(env, prim); \ + jmsg = (*env)->NewStringUTF(env, cbuf); \ + JNU_CallStaticMethodByName(env, NULL, \ + "sun/java2d/loops/GraphicsPrimitive", \ + "traceImplPrimitive", \ + "(Ljava/lang/Object;Ljava/lang/Object;)V", \ + jprim, jmsg); \ + (*env)->DeleteLocalRef(env, jprim); \ + (*env)->DeleteLocalRef(env, jmsg); \ + } \ + } + +#define J2dTraceImplPrimitive(prim, msg) { \ + if (graphicsPrimitive_traceflags && jvm) { \ + char cbuf[255]; \ + JNIEnv *env; \ + jstring jprim; \ + jstring jmsg; \ + snprintf(cbuf, 255, "%s at %s:%d", msg, __FILE__, __LINE__); \ + (*jvm)->AttachCurrentThreadAsDaemon(jvm, &env, NULL); \ + jprim = (*env)->NewStringUTF(env, prim); \ + jmsg = (*env)->NewStringUTF(env, cbuf); \ + JNU_CallStaticMethodByName(env, NULL, \ + "sun/java2d/loops/GraphicsPrimitive", \ + "traceImplPrimitive", \ + "(Ljava/lang/Object;Ljava/lang/Object;)V", \ + jprim, jmsg); \ + (*env)->DeleteLocalRef(env, jprim); \ + (*env)->DeleteLocalRef(env, jmsg); \ + } \ + } + + #ifdef __cplusplus }; #endif /* __cplusplus */ --- old/src/java.desktop/share/native/libawt/java2d/loops/FillParallelogram.c 2019-05-16 19:16:12.000000000 +0300 +++ new/src/java.desktop/share/native/libawt/java2d/loops/FillParallelogram.c 2019-05-16 19:16:12.000000000 +0300 @@ -48,7 +48,6 @@ CompositeInfo compInfo; jint pixel; jint ix1, iy1, ix2, iy2; - if ((dy1 == 0 && dx1 == 0) || (dy2 == 0 && dx2 == 0)) { return; } --- old/src/java.desktop/share/native/libawt/java2d/loops/GraphicsPrimitiveMgr.c 2019-05-16 19:16:13.000000000 +0300 +++ new/src/java.desktop/share/native/libawt/java2d/loops/GraphicsPrimitiveMgr.c 2019-05-16 19:16:13.000000000 +0300 @@ -75,6 +75,7 @@ JNIEXPORT jfieldID path2DFloatCoordsID; JNIEXPORT jfieldID sg2dStrokeHintID; JNIEXPORT jint sunHints_INTVAL_STROKE_PURE; +JNIEXPORT jint graphicsPrimitive_traceflags = 0; /* * Class: sun_java2d_loops_GraphicsPrimitiveMgr @@ -148,6 +149,13 @@ sunHints_INTVAL_STROKE_PURE = (*env)->GetStaticIntField(env, SHints, fid); } +JNIEXPORT void JNICALL +Java_sun_java2d_loops_GraphicsPrimitiveMgr_setTraceFlags + (JNIEnv *env, jclass GPMgr, jint traceflags) +{ + graphicsPrimitive_traceflags = traceflags; +} + void GrPrim_RefineBounds(SurfaceDataBounds *bounds, jint transX, jint transY, jfloat *coords, jint maxCoords) { --- old/src/java.desktop/share/native/libawt/java2d/loops/GraphicsPrimitiveMgr.h 2019-05-16 19:16:14.000000000 +0300 +++ new/src/java.desktop/share/native/libawt/java2d/loops/GraphicsPrimitiveMgr.h 2019-05-16 19:16:14.000000000 +0300 @@ -558,6 +558,7 @@ JNIEXPORT extern jfieldID path2DFloatCoordsID; JNIEXPORT extern jfieldID sg2dStrokeHintID; JNIEXPORT extern jint sunHints_INTVAL_STROKE_PURE; +JNIEXPORT extern jint graphicsPrimitive_traceflags; /* * Macros for using jlong variables as 32bits.32bits fractional values --- old/src/java.desktop/windows/native/libawt/windows/awt.h 2019-05-16 19:16:15.000000000 +0300 +++ new/src/java.desktop/windows/native/libawt/windows/awt.h 2019-05-16 19:16:15.000000000 +0300 @@ -191,7 +191,7 @@ #define LO_INT(l) ((int)(short)(l)) #define HI_INT(l) ((int)(short)(((DWORD)(l) >> 16) & 0xFFFF)) -extern JavaVM *jvm; +extern "C" JavaVM *jvm; // Platform encoding is Unicode (UTF-16), re-define JNU_ functions // to proper JNI functions. --- /dev/null 2019-05-16 19:16:17.000000000 +0300 +++ new/jb/project/hotspot-cmake/CMakeLists.txt 2019-05-16 19:16:16.000000000 +0300 @@ -0,0 +1,2966 @@ +cmake_minimum_required(VERSION 3.9) +project(hotspot) + +include(../java-common.cmake) + +include_directories( +../../../src/hotspot/cpu/aarch64 +../../../src/hotspot/cpu/aarch64/gc/g1 +../../../src/hotspot/cpu/aarch64/gc/shared +../../../src/hotspot/cpu/arm +../../../src/hotspot/cpu/arm/gc/g1 +../../../src/hotspot/cpu/arm/gc/shared +../../../src/hotspot/cpu/ppc +../../../src/hotspot/cpu/ppc/gc/g1 +../../../src/hotspot/cpu/ppc/gc/shared +../../../src/hotspot/cpu/s390 +../../../src/hotspot/cpu/s390/gc/g1 +../../../src/hotspot/cpu/s390/gc/shared +../../../src/hotspot/cpu/sparc +../../../src/hotspot/cpu/sparc/gc/g1 +../../../src/hotspot/cpu/sparc/gc/shared +../../../src/hotspot/cpu/x86 +../../../src/hotspot/cpu/x86/gc/g1 +../../../src/hotspot/cpu/x86/gc/shared +../../../src/hotspot/cpu/x86/gc/z +../../../src/hotspot/cpu/zero +../../../src/hotspot/cpu/zero/gc/g1 +../../../src/hotspot/cpu/zero/gc/shared +../../../src/hotspot/os/aix +../../../src/hotspot/os/bsd +../../../src/hotspot/os/linux +../../../src/hotspot/os/posix +../../../src/hotspot/os/solaris +../../../src/hotspot/os/windows +../../../src/hotspot/os_cpu/aix_ppc +../../../src/hotspot/os_cpu/bsd_x86 +../../../src/hotspot/os_cpu/bsd_zero +../../../src/hotspot/os_cpu/linux_aarch64 +../../../src/hotspot/os_cpu/linux_arm +../../../src/hotspot/os_cpu/linux_ppc +../../../src/hotspot/os_cpu/linux_s390 +../../../src/hotspot/os_cpu/linux_sparc +../../../src/hotspot/os_cpu/linux_x86 +../../../src/hotspot/os_cpu/linux_x86/gc/z +../../../src/hotspot/os_cpu/linux_zero +../../../src/hotspot/os_cpu/solaris_sparc +../../../src/hotspot/os_cpu/solaris_x86 +../../../src/hotspot/os_cpu/windows_x86 +../../../src/hotspot/share +) + +set(SOURCE_FILES +../../../src/hotspot/cpu/ppc/depChecker_ppc.hpp +../../../src/hotspot/cpu/ppc/assembler_ppc.inline.hpp +../../../src/hotspot/cpu/ppc/icache_ppc.cpp +../../../src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.hpp +../../../src/hotspot/cpu/ppc/vmreg_ppc.cpp +../../../src/hotspot/cpu/ppc/macroAssembler_ppc.inline.hpp +../../../src/hotspot/cpu/ppc/compiledIC_ppc.cpp +../../../src/hotspot/cpu/ppc/frame_ppc.cpp +../../../src/hotspot/cpu/ppc/c1_globals_ppc.hpp +../../../src/hotspot/cpu/ppc/relocInfo_ppc.hpp +../../../src/hotspot/cpu/ppc/icBuffer_ppc.cpp +../../../src/hotspot/cpu/ppc/register_ppc.cpp +../../../src/hotspot/cpu/ppc/c1_FrameMap_ppc.cpp +../../../src/hotspot/cpu/ppc/c1_LinearScan_ppc.cpp +../../../src/hotspot/cpu/ppc/jvmciCodeInstaller_ppc.cpp +../../../src/hotspot/cpu/ppc/assembler_ppc.cpp +../../../src/hotspot/cpu/ppc/methodHandles_ppc.hpp +../../../src/hotspot/cpu/ppc/codeBuffer_ppc.hpp +../../../src/hotspot/cpu/ppc/templateTable_ppc_64.cpp +../../../src/hotspot/cpu/ppc/interpreterRT_ppc.cpp +../../../src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp +../../../src/hotspot/cpu/ppc/abstractInterpreter_ppc.cpp +../../../src/hotspot/cpu/ppc/stubRoutines_ppc.hpp +../../../src/hotspot/cpu/ppc/vtableStubs_ppc_64.cpp +../../../src/hotspot/cpu/ppc/c1_LIRGenerator_ppc.cpp +../../../src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp +../../../src/hotspot/cpu/ppc/macroAssembler_ppc.cpp +../../../src/hotspot/cpu/ppc/globals_ppc.hpp +../../../src/hotspot/cpu/ppc/vmreg_ppc.inline.hpp +../../../src/hotspot/cpu/ppc/frame_ppc.inline.hpp +../../../src/hotspot/cpu/ppc/globalDefinitions_ppc.hpp +../../../src/hotspot/cpu/ppc/macroAssembler_ppc_sha.cpp +../../../src/hotspot/cpu/ppc/jniTypes_ppc.hpp +../../../src/hotspot/cpu/ppc/nativeInst_ppc.hpp +../../../src/hotspot/cpu/ppc/bytes_ppc.hpp +../../../src/hotspot/cpu/ppc/vm_version_ext_ppc.cpp +../../../src/hotspot/cpu/ppc/copy_ppc.hpp +../../../src/hotspot/cpu/ppc/vm_version_ppc.hpp +../../../src/hotspot/cpu/ppc/runtime_ppc.cpp +../../../src/hotspot/cpu/ppc/macroAssembler_ppc.hpp +../../../src/hotspot/cpu/ppc/register_definitions_ppc.cpp +../../../src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.hpp +../../../src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp +../../../src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp +../../../src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp +../../../src/hotspot/cpu/ppc/stubRoutines_ppc_64.cpp +../../../src/hotspot/cpu/ppc/nativeInst_ppc.cpp +../../../src/hotspot/cpu/ppc/templateTable_ppc.hpp +../../../src/hotspot/cpu/ppc/c1_LIR_ppc.cpp +../../../src/hotspot/cpu/ppc/vm_version_ext_ppc.hpp +../../../src/hotspot/cpu/ppc/c2_globals_ppc.hpp +../../../src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.hpp +../../../src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp +../../../src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.hpp +../../../src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.hpp +../../../src/hotspot/cpu/ppc/gc/shared/modRefBarrierSetAssembler_ppc.cpp +../../../src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp +../../../src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.cpp +../../../src/hotspot/cpu/ppc/gc/shared/modRefBarrierSetAssembler_ppc.hpp +../../../src/hotspot/cpu/ppc/c2_init_ppc.cpp +../../../src/hotspot/cpu/ppc/vm_version_ppc.cpp +../../../src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp +../../../src/hotspot/cpu/ppc/icache_ppc.hpp +../../../src/hotspot/cpu/ppc/c1_Defs_ppc.hpp +../../../src/hotspot/cpu/ppc/vmreg_ppc.hpp +../../../src/hotspot/cpu/ppc/vmStructs_ppc.hpp +../../../src/hotspot/cpu/ppc/c1_FpuStackSim_ppc.hpp +../../../src/hotspot/cpu/ppc/frame_ppc.hpp +../../../src/hotspot/cpu/ppc/registerMap_ppc.hpp +../../../src/hotspot/cpu/ppc/relocInfo_ppc.cpp +../../../src/hotspot/cpu/ppc/register_ppc.hpp +../../../src/hotspot/cpu/ppc/c1_FrameMap_ppc.hpp +../../../src/hotspot/cpu/ppc/javaFrameAnchor_ppc.hpp +../../../src/hotspot/cpu/ppc/c1_LinearScan_ppc.hpp +../../../src/hotspot/cpu/ppc/assembler_ppc.hpp +../../../src/hotspot/cpu/ppc/methodHandles_ppc.cpp +../../../src/hotspot/cpu/ppc/disassembler_ppc.hpp +../../../src/hotspot/cpu/ppc/interp_masm_ppc.hpp +../../../src/hotspot/cpu/ppc/interpreterRT_ppc.hpp +../../../src/hotspot/cpu/ppc/jniFastGetField_ppc.cpp +../../../src/hotspot/cpu/ppc/c1_CodeStubs_ppc.cpp +../../../src/hotspot/cpu/ppc/stubGenerator_ppc.cpp +../../../src/hotspot/cpu/s390/stubRoutines_s390.hpp +../../../src/hotspot/cpu/s390/frame_s390.hpp +../../../src/hotspot/cpu/s390/compiledIC_s390.cpp +../../../src/hotspot/cpu/s390/interp_masm_s390.cpp +../../../src/hotspot/cpu/s390/nativeInst_s390.cpp +../../../src/hotspot/cpu/s390/interpreterRT_s390.hpp +../../../src/hotspot/cpu/s390/c1_LinearScan_s390.hpp +../../../src/hotspot/cpu/s390/c1_LIR_s390.cpp +../../../src/hotspot/cpu/s390/relocInfo_s390.cpp +../../../src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp +../../../src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp +../../../src/hotspot/cpu/s390/c1_LIRGenerator_s390.cpp +../../../src/hotspot/cpu/s390/stubGenerator_s390.cpp +../../../src/hotspot/cpu/s390/vmreg_s390.cpp +../../../src/hotspot/cpu/s390/macroAssembler_s390.cpp +../../../src/hotspot/cpu/s390/c2_init_s390.cpp +../../../src/hotspot/cpu/s390/runtime_s390.cpp +../../../src/hotspot/cpu/s390/c1_FpuStackSim_s390.hpp +../../../src/hotspot/cpu/s390/icBuffer_s390.cpp +../../../src/hotspot/cpu/s390/vmreg_s390.inline.hpp +../../../src/hotspot/cpu/s390/vm_version_ext_s390.hpp +../../../src/hotspot/cpu/s390/javaFrameAnchor_s390.hpp +../../../src/hotspot/cpu/s390/c1_globals_s390.hpp +../../../src/hotspot/cpu/s390/assembler_s390.hpp +../../../src/hotspot/cpu/s390/vmStructs_s390.hpp +../../../src/hotspot/cpu/s390/sharedRuntime_s390.cpp +../../../src/hotspot/cpu/s390/templateTable_s390.hpp +../../../src/hotspot/cpu/s390/methodHandles_s390.hpp +../../../src/hotspot/cpu/s390/globals_s390.hpp +../../../src/hotspot/cpu/s390/c1_FrameMap_s390.hpp +../../../src/hotspot/cpu/s390/register_s390.hpp +../../../src/hotspot/cpu/s390/register_definitions_s390.cpp +../../../src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp +../../../src/hotspot/cpu/s390/icache_s390.cpp +../../../src/hotspot/cpu/s390/registerSaver_s390.hpp +../../../src/hotspot/cpu/s390/codeBuffer_s390.hpp +../../../src/hotspot/cpu/s390/vm_version_s390.hpp +../../../src/hotspot/cpu/s390/c1_Defs_s390.hpp +../../../src/hotspot/cpu/s390/templateTable_s390.cpp +../../../src/hotspot/cpu/s390/globalDefinitions_s390.hpp +../../../src/hotspot/cpu/s390/methodHandles_s390.cpp +../../../src/hotspot/cpu/s390/register_s390.cpp +../../../src/hotspot/cpu/s390/c1_FrameMap_s390.cpp +../../../src/hotspot/cpu/s390/copy_s390.hpp +../../../src/hotspot/cpu/s390/frame_s390.inline.hpp +../../../src/hotspot/cpu/s390/abstractInterpreter_s390.cpp +../../../src/hotspot/cpu/s390/icache_s390.hpp +../../../src/hotspot/cpu/s390/jvmciCodeInstaller_s390.cpp +../../../src/hotspot/cpu/s390/bytes_s390.hpp +../../../src/hotspot/cpu/s390/c1_CodeStubs_s390.cpp +../../../src/hotspot/cpu/s390/jniTypes_s390.hpp +../../../src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.hpp +../../../src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp +../../../src/hotspot/cpu/s390/gc/shared/modRefBarrierSetAssembler_s390.cpp +../../../src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.cpp +../../../src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.hpp +../../../src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.hpp +../../../src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp +../../../src/hotspot/cpu/s390/gc/shared/modRefBarrierSetAssembler_s390.hpp +../../../src/hotspot/cpu/s390/vm_version_s390.cpp +../../../src/hotspot/cpu/s390/frame_s390.cpp +../../../src/hotspot/cpu/s390/stubRoutines_s390.cpp +../../../src/hotspot/cpu/s390/interp_masm_s390.hpp +../../../src/hotspot/cpu/s390/disassembler_s390.hpp +../../../src/hotspot/cpu/s390/c1_LinearScan_s390.cpp +../../../src/hotspot/cpu/s390/interpreterRT_s390.cpp +../../../src/hotspot/cpu/s390/macroAssembler_s390.inline.hpp +../../../src/hotspot/cpu/s390/nativeInst_s390.hpp +../../../src/hotspot/cpu/s390/vtableStubs_s390.cpp +../../../src/hotspot/cpu/s390/relocInfo_s390.hpp +../../../src/hotspot/cpu/s390/c1_LIRAssembler_s390.hpp +../../../src/hotspot/cpu/s390/c1_MacroAssembler_s390.hpp +../../../src/hotspot/cpu/s390/vmreg_s390.hpp +../../../src/hotspot/cpu/s390/depChecker_s390.hpp +../../../src/hotspot/cpu/s390/macroAssembler_s390.hpp +../../../src/hotspot/cpu/s390/jniFastGetField_s390.cpp +../../../src/hotspot/cpu/s390/c2_globals_s390.hpp +../../../src/hotspot/cpu/s390/c1_Runtime1_s390.cpp +../../../src/hotspot/cpu/s390/registerMap_s390.hpp +../../../src/hotspot/cpu/s390/vm_version_ext_s390.cpp +../../../src/hotspot/cpu/s390/assembler_s390.inline.hpp +../../../src/hotspot/cpu/s390/assembler_s390.cpp +../../../src/hotspot/cpu/zero/disassembler_zero.cpp +../../../src/hotspot/cpu/zero/frame_zero.hpp +../../../src/hotspot/cpu/zero/compiledIC_zero.cpp +../../../src/hotspot/cpu/zero/stubRoutines_zero.hpp +../../../src/hotspot/cpu/zero/vmreg_zero.cpp +../../../src/hotspot/cpu/zero/stubGenerator_zero.cpp +../../../src/hotspot/cpu/zero/interpreterRT_zero.hpp +../../../src/hotspot/cpu/zero/nativeInst_zero.cpp +../../../src/hotspot/cpu/zero/relocInfo_zero.cpp +../../../src/hotspot/cpu/zero/icBuffer_zero.cpp +../../../src/hotspot/cpu/zero/depChecker_zero.cpp +../../../src/hotspot/cpu/zero/vmStructs_zero.hpp +../../../src/hotspot/cpu/zero/javaFrameAnchor_zero.hpp +../../../src/hotspot/cpu/zero/stack_zero.hpp +../../../src/hotspot/cpu/zero/assembler_zero.hpp +../../../src/hotspot/cpu/zero/vm_version_ext_zero.hpp +../../../src/hotspot/cpu/zero/frame_zero.inline.hpp +../../../src/hotspot/cpu/zero/sharedRuntime_zero.cpp +../../../src/hotspot/cpu/zero/cppInterpreter_zero.cpp +../../../src/hotspot/cpu/zero/macroAssembler_zero.inline.hpp +../../../src/hotspot/cpu/zero/globals_zero.hpp +../../../src/hotspot/cpu/zero/methodHandles_zero.hpp +../../../src/hotspot/cpu/zero/bytecodeInterpreter_zero.hpp +../../../src/hotspot/cpu/zero/register_zero.hpp +../../../src/hotspot/cpu/zero/assembler_zero.inline.hpp +../../../src/hotspot/cpu/zero/icache_zero.cpp +../../../src/hotspot/cpu/zero/vm_version_zero.hpp +../../../src/hotspot/cpu/zero/codeBuffer_zero.hpp +../../../src/hotspot/cpu/zero/stack_zero.inline.hpp +../../../src/hotspot/cpu/zero/globalDefinitions_zero.hpp +../../../src/hotspot/cpu/zero/cppInterpreter_zero.hpp +../../../src/hotspot/cpu/zero/fakeStubFrame_zero.hpp +../../../src/hotspot/cpu/zero/entry_zero.hpp +../../../src/hotspot/cpu/zero/copy_zero.hpp +../../../src/hotspot/cpu/zero/methodHandles_zero.cpp +../../../src/hotspot/cpu/zero/bytecodeInterpreter_zero.cpp +../../../src/hotspot/cpu/zero/register_zero.cpp +../../../src/hotspot/cpu/zero/interpreterFrame_zero.hpp +../../../src/hotspot/cpu/zero/icache_zero.hpp +../../../src/hotspot/cpu/zero/abstractInterpreter_zero.cpp +../../../src/hotspot/cpu/zero/vmreg_zero.inline.hpp +../../../src/hotspot/cpu/zero/bytecodeInterpreter_zero.inline.hpp +../../../src/hotspot/cpu/zero/vm_version_zero.cpp +../../../src/hotspot/cpu/zero/bytes_zero.hpp +../../../src/hotspot/cpu/zero/gc/g1/g1BarrierSetAssembler_zero.hpp +../../../src/hotspot/cpu/zero/gc/shared/barrierSetAssembler_zero.hpp +../../../src/hotspot/cpu/zero/gc/shared/cardTableBarrierSetAssembler_zero.hpp +../../../src/hotspot/cpu/zero/gc/shared/modRefBarrierSetAssembler_zero.hpp +../../../src/hotspot/cpu/zero/jniTypes_zero.hpp +../../../src/hotspot/cpu/zero/disassembler_zero.hpp +../../../src/hotspot/cpu/zero/stubRoutines_zero.cpp +../../../src/hotspot/cpu/zero/frame_zero.cpp +../../../src/hotspot/cpu/zero/interp_masm_zero.hpp +../../../src/hotspot/cpu/zero/vmreg_zero.hpp +../../../src/hotspot/cpu/zero/nativeInst_zero.hpp +../../../src/hotspot/cpu/zero/vtableStubs_zero.cpp +../../../src/hotspot/cpu/zero/interpreterRT_zero.cpp +../../../src/hotspot/cpu/zero/relocInfo_zero.hpp +../../../src/hotspot/cpu/zero/cppInterpreterGenerator_zero.cpp +../../../src/hotspot/cpu/zero/jniFastGetField_zero.cpp +../../../src/hotspot/cpu/zero/entryFrame_zero.hpp +../../../src/hotspot/cpu/zero/macroAssembler_zero.hpp +../../../src/hotspot/cpu/zero/depChecker_zero.hpp +../../../src/hotspot/cpu/zero/stack_zero.cpp +../../../src/hotspot/cpu/zero/assembler_zero.cpp +../../../src/hotspot/cpu/zero/vm_version_ext_zero.cpp +../../../src/hotspot/cpu/zero/registerMap_zero.hpp +../../../src/hotspot/cpu/x86/macroAssembler_x86.inline.hpp +../../../src/hotspot/cpu/x86/stubRoutines_x86_64.cpp +../../../src/hotspot/cpu/x86/assembler_x86.inline.hpp +../../../src/hotspot/cpu/x86/stubGenerator_x86_64.cpp +../../../src/hotspot/cpu/x86/stubRoutines_x86.cpp +../../../src/hotspot/cpu/x86/sharedRuntime_x86.cpp +../../../src/hotspot/cpu/x86/macroAssembler_x86_log10.cpp +../../../src/hotspot/cpu/x86/c1_MacroAssembler_x86.hpp +../../../src/hotspot/cpu/x86/macroAssembler_x86.hpp +../../../src/hotspot/cpu/x86/register_definitions_x86.cpp +../../../src/hotspot/cpu/x86/c1_Runtime1_x86.cpp +../../../src/hotspot/cpu/x86/jniFastGetField_x86_32.cpp +../../../src/hotspot/cpu/x86/templateTable_x86.hpp +../../../src/hotspot/cpu/x86/nativeInst_x86.cpp +../../../src/hotspot/cpu/x86/c2_globals_x86.hpp +../../../src/hotspot/cpu/x86/vm_version_x86.cpp +../../../src/hotspot/cpu/x86/macroAssembler_x86_cos.cpp +../../../src/hotspot/cpu/x86/rdtsc_x86.hpp +../../../src/hotspot/cpu/x86/c2_init_x86.cpp +../../../src/hotspot/cpu/x86/c1_LIR_x86.cpp +../../../src/hotspot/cpu/x86/macroAssembler_x86_sin.cpp +../../../src/hotspot/cpu/x86/vm_version_ext_x86.hpp +../../../src/hotspot/cpu/x86/vmreg_x86.hpp +../../../src/hotspot/cpu/x86/depChecker_x86.cpp +../../../src/hotspot/cpu/x86/c1_Defs_x86.hpp +../../../src/hotspot/cpu/x86/icache_x86.hpp +../../../src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp +../../../src/hotspot/cpu/x86/frame_x86.inline.hpp +../../../src/hotspot/cpu/x86/register_x86.hpp +../../../src/hotspot/cpu/x86/vmreg_x86.inline.hpp +../../../src/hotspot/cpu/x86/c1_FpuStackSim_x86.hpp +../../../src/hotspot/cpu/x86/frame_x86.hpp +../../../src/hotspot/cpu/x86/vmStructs_x86.hpp +../../../src/hotspot/cpu/x86/registerMap_x86.hpp +../../../src/hotspot/cpu/x86/relocInfo_x86.cpp +../../../src/hotspot/cpu/x86/assembler_x86.hpp +../../../src/hotspot/cpu/x86/vtableStubs_x86_32.cpp +../../../src/hotspot/cpu/x86/methodHandles_x86.cpp +../../../src/hotspot/cpu/x86/interpreterRT_x86_32.cpp +../../../src/hotspot/cpu/x86/javaFrameAnchor_x86.hpp +../../../src/hotspot/cpu/x86/c1_FrameMap_x86.hpp +../../../src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp +../../../src/hotspot/cpu/x86/c1_LinearScan_x86.hpp +../../../src/hotspot/cpu/x86/interpreterRT_x86.hpp +../../../src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp +../../../src/hotspot/cpu/x86/runtime_x86_32.cpp +../../../src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp +../../../src/hotspot/cpu/x86/disassembler_x86.hpp +../../../src/hotspot/cpu/x86/interp_masm_x86.hpp +../../../src/hotspot/cpu/x86/vmreg_x86.cpp +../../../src/hotspot/cpu/x86/stubRoutines_x86_32.cpp +../../../src/hotspot/cpu/x86/compiledIC_x86.cpp +../../../src/hotspot/cpu/x86/depChecker_x86.hpp +../../../src/hotspot/cpu/x86/c1_LIRAssembler_x86.hpp +../../../src/hotspot/cpu/x86/icache_x86.cpp +../../../src/hotspot/cpu/x86/stubGenerator_x86_32.cpp +../../../src/hotspot/cpu/x86/register_x86.cpp +../../../src/hotspot/cpu/x86/macroAssembler_x86_log.cpp +../../../src/hotspot/cpu/x86/c1_FpuStackSim_x86.cpp +../../../src/hotspot/cpu/x86/frame_x86.cpp +../../../src/hotspot/cpu/x86/icBuffer_x86.cpp +../../../src/hotspot/cpu/x86/c1_globals_x86.hpp +../../../src/hotspot/cpu/x86/relocInfo_x86.hpp +../../../src/hotspot/cpu/x86/jniFastGetField_x86_64.cpp +../../../src/hotspot/cpu/x86/registerMap_x86.cpp +../../../src/hotspot/cpu/x86/assembler_x86.cpp +../../../src/hotspot/cpu/x86/methodHandles_x86.hpp +../../../src/hotspot/cpu/x86/jvmciCodeInstaller_x86.cpp +../../../src/hotspot/cpu/x86/codeBuffer_x86.hpp +../../../src/hotspot/cpu/x86/c1_FrameMap_x86.cpp +../../../src/hotspot/cpu/x86/c1_LinearScan_x86.cpp +../../../src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp +../../../src/hotspot/cpu/x86/interp_masm_x86.cpp +../../../src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp +../../../src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.hpp +../../../src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.hpp +../../../src/hotspot/cpu/x86/gc/z/zBarrierSetAssembler_x86.cpp +../../../src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp +../../../src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp +../../../src/hotspot/cpu/x86/gc/shared/modRefBarrierSetAssembler_x86.hpp +../../../src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.hpp +../../../src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp +../../../src/hotspot/cpu/x86/gc/shared/modRefBarrierSetAssembler_x86.cpp +../../../src/hotspot/cpu/x86/crc32c.h +../../../src/hotspot/cpu/x86/macroAssembler_x86_exp.cpp +../../../src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp +../../../src/hotspot/cpu/x86/macroAssembler_x86_tan.cpp +../../../src/hotspot/cpu/x86/compiledIC_aot_x86_64.cpp +../../../src/hotspot/cpu/x86/abstractInterpreter_x86.cpp +../../../src/hotspot/cpu/x86/stubRoutines_x86.hpp +../../../src/hotspot/cpu/x86/macroAssembler_x86_pow.cpp +../../../src/hotspot/cpu/x86/macroAssembler_x86.cpp +../../../src/hotspot/cpu/x86/globals_x86.hpp +../../../src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp +../../../src/hotspot/cpu/x86/vtableStubs_x86_64.cpp +../../../src/hotspot/cpu/x86/interpreterRT_x86_64.cpp +../../../src/hotspot/cpu/x86/nativeInst_x86.hpp +../../../src/hotspot/cpu/x86/macroAssembler_x86_sha.cpp +../../../src/hotspot/cpu/x86/bytes_x86.hpp +../../../src/hotspot/cpu/x86/templateTable_x86.cpp +../../../src/hotspot/cpu/x86/jniTypes_x86.hpp +../../../src/hotspot/cpu/x86/globalDefinitions_x86.hpp +../../../src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp +../../../src/hotspot/cpu/x86/rdtsc_x86.cpp +../../../src/hotspot/cpu/x86/vm_version_x86.hpp +../../../src/hotspot/cpu/x86/runtime_x86_64.cpp +../../../src/hotspot/cpu/x86/templateInterpreterGenerator_x86_32.cpp +../../../src/hotspot/cpu/x86/vm_version_ext_x86.cpp +../../../src/hotspot/cpu/x86/copy_x86.hpp +../../../src/hotspot/cpu/arm/interpreterRT_arm.hpp +../../../src/hotspot/cpu/arm/assembler_arm_32.cpp +../../../src/hotspot/cpu/arm/jniFastGetField_arm.cpp +../../../src/hotspot/cpu/arm/c1_CodeStubs_arm.cpp +../../../src/hotspot/cpu/arm/stubGenerator_arm.cpp +../../../src/hotspot/cpu/arm/nativeInst_arm_64.hpp +../../../src/hotspot/cpu/arm/disassembler_arm.hpp +../../../src/hotspot/cpu/arm/interp_masm_arm.hpp +../../../src/hotspot/cpu/arm/methodHandles_arm.cpp +../../../src/hotspot/cpu/arm/assembler_arm.hpp +../../../src/hotspot/cpu/arm/c1_FrameMap_arm.hpp +../../../src/hotspot/cpu/arm/javaFrameAnchor_arm.hpp +../../../src/hotspot/cpu/arm/c1_LinearScan_arm.hpp +../../../src/hotspot/cpu/arm/register_arm.hpp +../../../src/hotspot/cpu/arm/vmStructs_arm.hpp +../../../src/hotspot/cpu/arm/c1_FpuStackSim_arm.hpp +../../../src/hotspot/cpu/arm/frame_arm.hpp +../../../src/hotspot/cpu/arm/relocInfo_arm.cpp +../../../src/hotspot/cpu/arm/registerMap_arm.hpp +../../../src/hotspot/cpu/arm/vmreg_arm.hpp +../../../src/hotspot/cpu/arm/vm_version_arm_32.cpp +../../../src/hotspot/cpu/arm/depChecker_arm.cpp +../../../src/hotspot/cpu/arm/icache_arm.hpp +../../../src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp +../../../src/hotspot/cpu/arm/c1_Defs_arm.hpp +../../../src/hotspot/cpu/arm/c2_globals_arm.hpp +../../../src/hotspot/cpu/arm/assembler_arm_64.hpp +../../../src/hotspot/cpu/arm/nativeInst_arm_32.cpp +../../../src/hotspot/cpu/arm/vtableStubs_arm.cpp +../../../src/hotspot/cpu/arm/c1_LIR_arm.cpp +../../../src/hotspot/cpu/arm/vm_version_ext_arm.hpp +../../../src/hotspot/cpu/arm/templateTable_arm.hpp +../../../src/hotspot/cpu/arm/sharedRuntime_arm.cpp +../../../src/hotspot/cpu/arm/register_definitions_arm.cpp +../../../src/hotspot/cpu/arm/macroAssembler_arm.hpp +../../../src/hotspot/cpu/arm/c1_MacroAssembler_arm.hpp +../../../src/hotspot/cpu/arm/stubRoutinesCrypto_arm.cpp +../../../src/hotspot/cpu/arm/c1_Runtime1_arm.cpp +../../../src/hotspot/cpu/arm/c1_LIRGenerator_arm.hpp +../../../src/hotspot/cpu/arm/stubRoutines_arm.cpp +../../../src/hotspot/cpu/arm/runtime_arm.cpp +../../../src/hotspot/cpu/arm/assembler_arm_64.cpp +../../../src/hotspot/cpu/arm/vm_version_arm.hpp +../../../src/hotspot/cpu/arm/nativeInst_arm_32.hpp +../../../src/hotspot/cpu/arm/copy_arm.hpp +../../../src/hotspot/cpu/arm/vm_version_ext_arm.cpp +../../../src/hotspot/cpu/arm/macroAssembler_arm.inline.hpp +../../../src/hotspot/cpu/arm/jniTypes_arm.hpp +../../../src/hotspot/cpu/arm/templateTable_arm.cpp +../../../src/hotspot/cpu/arm/bytes_arm.hpp +../../../src/hotspot/cpu/arm/nativeInst_arm.hpp +../../../src/hotspot/cpu/arm/globalDefinitions_arm.hpp +../../../src/hotspot/cpu/arm/assembler_arm.inline.hpp +../../../src/hotspot/cpu/arm/c1_MacroAssembler_arm.cpp +../../../src/hotspot/cpu/arm/globals_arm.hpp +../../../src/hotspot/cpu/arm/macroAssembler_arm.cpp +../../../src/hotspot/cpu/arm/vm_version_arm_64.cpp +../../../src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp +../../../src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp +../../../src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.hpp +../../../src/hotspot/cpu/arm/gc/shared/modRefBarrierSetAssembler_arm.hpp +../../../src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp +../../../src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.cpp +../../../src/hotspot/cpu/arm/gc/shared/modRefBarrierSetAssembler_arm.cpp +../../../src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.hpp +../../../src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.hpp +../../../src/hotspot/cpu/arm/abstractInterpreter_arm.cpp +../../../src/hotspot/cpu/arm/stubRoutines_arm.hpp +../../../src/hotspot/cpu/arm/frame_arm.inline.hpp +../../../src/hotspot/cpu/arm/interpreterRT_arm.cpp +../../../src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp +../../../src/hotspot/cpu/arm/assembler_arm_32.hpp +../../../src/hotspot/cpu/arm/nativeInst_arm_64.cpp +../../../src/hotspot/cpu/arm/vmreg_arm.inline.hpp +../../../src/hotspot/cpu/arm/interp_masm_arm.cpp +../../../src/hotspot/cpu/arm/jvmciCodeInstaller_arm.cpp +../../../src/hotspot/cpu/arm/methodHandles_arm.hpp +../../../src/hotspot/cpu/arm/assembler_arm.cpp +../../../src/hotspot/cpu/arm/codeBuffer_arm.hpp +../../../src/hotspot/cpu/arm/c1_FrameMap_arm.cpp +../../../src/hotspot/cpu/arm/c1_LinearScan_arm.cpp +../../../src/hotspot/cpu/arm/register_arm.cpp +../../../src/hotspot/cpu/arm/c1_FpuStackSim_arm.cpp +../../../src/hotspot/cpu/arm/frame_arm.cpp +../../../src/hotspot/cpu/arm/c1_globals_arm.hpp +../../../src/hotspot/cpu/arm/relocInfo_arm.hpp +../../../src/hotspot/cpu/arm/icBuffer_arm.cpp +../../../src/hotspot/cpu/arm/vmreg_arm.cpp +../../../src/hotspot/cpu/arm/compiledIC_arm.cpp +../../../src/hotspot/cpu/arm/depChecker_arm.hpp +../../../src/hotspot/cpu/arm/c1_LIRAssembler_arm.hpp +../../../src/hotspot/cpu/arm/icache_arm.cpp +../../../src/hotspot/cpu/aarch64/copy_aarch64.hpp +../../../src/hotspot/cpu/aarch64/assembler_aarch64.inline.hpp +../../../src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp +../../../src/hotspot/cpu/aarch64/globals_aarch64.hpp +../../../src/hotspot/cpu/aarch64/bytes_aarch64.hpp +../../../src/hotspot/cpu/aarch64/interpreterRT_aarch64.cpp +../../../src/hotspot/cpu/aarch64/icache_aarch64.hpp +../../../src/hotspot/cpu/aarch64/javaFrameAnchor_aarch64.hpp +../../../src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp +../../../src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp +../../../src/hotspot/cpu/aarch64/vtableStubs_aarch64.cpp +../../../src/hotspot/cpu/aarch64/relocInfo_aarch64.hpp +../../../src/hotspot/cpu/aarch64/vm_version_aarch64.hpp +../../../src/hotspot/cpu/aarch64/cpustate_aarch64.hpp +../../../src/hotspot/cpu/aarch64/immediate_aarch64.cpp +../../../src/hotspot/cpu/aarch64/vmreg_aarch64.cpp +../../../src/hotspot/cpu/aarch64/jniFastGetField_aarch64.cpp +../../../src/hotspot/cpu/aarch64/c1_LIR_aarch64.cpp +../../../src/hotspot/cpu/aarch64/c2_init_aarch64.cpp +../../../src/hotspot/cpu/aarch64/register_aarch64.hpp +../../../src/hotspot/cpu/aarch64/assembler_aarch64.hpp +../../../src/hotspot/cpu/aarch64/jvmciCodeInstaller_aarch64.cpp +../../../src/hotspot/cpu/aarch64/vm_version_ext_aarch64.hpp +../../../src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp +../../../src/hotspot/cpu/aarch64/bytecodes_aarch64.cpp +../../../src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp +../../../src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp +../../../src/hotspot/cpu/aarch64/depChecker_aarch64.hpp +../../../src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp +../../../src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp +../../../src/hotspot/cpu/aarch64/frame_aarch64.hpp +../../../src/hotspot/cpu/aarch64/frame_aarch64.inline.hpp +../../../src/hotspot/cpu/aarch64/methodHandles_aarch64.cpp +../../../src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp +../../../src/hotspot/cpu/aarch64/c1_FpuStackSim_aarch64.hpp +../../../src/hotspot/cpu/aarch64/c1_FrameMap_aarch64.hpp +../../../src/hotspot/cpu/aarch64/templateTable_aarch64.cpp +../../../src/hotspot/cpu/aarch64/vmStructs_aarch64.hpp +../../../src/hotspot/cpu/aarch64/decode_aarch64.hpp +../../../src/hotspot/cpu/aarch64/c1_CodeStubs_aarch64.cpp +../../../src/hotspot/cpu/aarch64/nativeInst_aarch64.hpp +../../../src/hotspot/cpu/aarch64/codeBuffer_aarch64.hpp +../../../src/hotspot/cpu/aarch64/c1_LinearScan_aarch64.cpp +../../../src/hotspot/cpu/aarch64/vmreg_aarch64.hpp +../../../src/hotspot/cpu/aarch64/assembler_aarch64.cpp +../../../src/hotspot/cpu/aarch64/register_aarch64.cpp +../../../src/hotspot/cpu/aarch64/vm_version_ext_aarch64.cpp +../../../src/hotspot/cpu/aarch64/aarch64_call.cpp +../../../src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp +../../../src/hotspot/cpu/aarch64/bytecodes_aarch64.hpp +../../../src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.hpp +../../../src/hotspot/cpu/aarch64/depChecker_aarch64.cpp +../../../src/hotspot/cpu/aarch64/frame_aarch64.cpp +../../../src/hotspot/cpu/aarch64/vmreg_aarch64.inline.hpp +../../../src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp +../../../src/hotspot/cpu/aarch64/register_definitions_aarch64.cpp +../../../src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp +../../../src/hotspot/cpu/aarch64/interp_masm_aarch64.hpp +../../../src/hotspot/cpu/aarch64/methodHandles_aarch64.hpp +../../../src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.hpp +../../../src/hotspot/cpu/aarch64/jniTypes_aarch64.hpp +../../../src/hotspot/cpu/aarch64/macroAssembler_aarch64_log.cpp +../../../src/hotspot/cpu/aarch64/c1_FpuStackSim_aarch64.cpp +../../../src/hotspot/cpu/aarch64/templateTable_aarch64.hpp +../../../src/hotspot/cpu/aarch64/c1_FrameMap_aarch64.cpp +../../../src/hotspot/cpu/aarch64/runtime_aarch64.cpp +../../../src/hotspot/cpu/aarch64/c1_LinearScan_aarch64.hpp +../../../src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp +../../../src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.hpp +../../../src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp +../../../src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp +../../../src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.cpp +../../../src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.cpp +../../../src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.hpp +../../../src/hotspot/cpu/aarch64/gc/shared/modRefBarrierSetAssembler_aarch64.hpp +../../../src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp +../../../src/hotspot/cpu/aarch64/icBuffer_aarch64.cpp +../../../src/hotspot/cpu/aarch64/disassembler_aarch64.hpp +../../../src/hotspot/cpu/aarch64/c1_Defs_aarch64.hpp +../../../src/hotspot/cpu/aarch64/icache_aarch64.cpp +../../../src/hotspot/cpu/aarch64/interpreterRT_aarch64.hpp +../../../src/hotspot/cpu/aarch64/macroAssembler_aarch64.inline.hpp +../../../src/hotspot/cpu/aarch64/macroAssembler_aarch64_trig.cpp +../../../src/hotspot/cpu/aarch64/compiledIC_aot_aarch64.cpp +../../../src/hotspot/cpu/aarch64/abstractInterpreter_aarch64.cpp +../../../src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp +../../../src/hotspot/cpu/aarch64/c1_globals_aarch64.hpp +../../../src/hotspot/cpu/aarch64/registerMap_aarch64.hpp +../../../src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp +../../../src/hotspot/cpu/aarch64/relocInfo_aarch64.cpp +../../../src/hotspot/cpu/aarch64/aarch64Test.cpp +../../../src/hotspot/cpu/aarch64/immediate_aarch64.hpp +../../../src/hotspot/cpu/aarch64/vm_version_aarch64.cpp +../../../src/hotspot/cpu/aarch64/c2_globals_aarch64.hpp +../../../src/hotspot/cpu/sparc/vmStructs_sparc.hpp +../../../src/hotspot/cpu/sparc/nativeInst_sparc.hpp +../../../src/hotspot/cpu/sparc/c1_LinearScan_sparc.hpp +../../../src/hotspot/cpu/sparc/copy_sparc.hpp +../../../src/hotspot/cpu/sparc/c1_globals_sparc.hpp +../../../src/hotspot/cpu/sparc/codeBuffer_sparc.hpp +../../../src/hotspot/cpu/sparc/stubGenerator_sparc.cpp +../../../src/hotspot/cpu/sparc/c1_FpuStackSim_sparc.cpp +../../../src/hotspot/cpu/sparc/disassembler_sparc.hpp +../../../src/hotspot/cpu/sparc/jniFastGetField_sparc.cpp +../../../src/hotspot/cpu/sparc/c2_init_sparc.cpp +../../../src/hotspot/cpu/sparc/assembler_sparc.inline.hpp +../../../src/hotspot/cpu/sparc/vmreg_sparc.hpp +../../../src/hotspot/cpu/sparc/vm_version_sparc.cpp +../../../src/hotspot/cpu/sparc/templateTable_sparc.hpp +../../../src/hotspot/cpu/sparc/macroAssembler_sparc.cpp +../../../src/hotspot/cpu/sparc/c1_Defs_sparc.hpp +../../../src/hotspot/cpu/sparc/interp_masm_sparc.cpp +../../../src/hotspot/cpu/sparc/c1_LIRGenerator_sparc.cpp +../../../src/hotspot/cpu/sparc/vm_version_ext_sparc.cpp +../../../src/hotspot/cpu/sparc/c1_MacroAssembler_sparc.cpp +../../../src/hotspot/cpu/sparc/macroAssembler_sparc.inline.hpp +../../../src/hotspot/cpu/sparc/memset_with_concurrent_readers_sparc.cpp +../../../src/hotspot/cpu/sparc/assembler_sparc.cpp +../../../src/hotspot/cpu/sparc/frame_sparc.inline.hpp +../../../src/hotspot/cpu/sparc/frame_sparc.hpp +../../../src/hotspot/cpu/sparc/stubRoutines_sparc.hpp +../../../src/hotspot/cpu/sparc/c1_LIR_sparc.cpp +../../../src/hotspot/cpu/sparc/abstractInterpreter_sparc.cpp +../../../src/hotspot/cpu/sparc/methodHandles_sparc.hpp +../../../src/hotspot/cpu/sparc/register_definitions_sparc.cpp +../../../src/hotspot/cpu/sparc/relocInfo_sparc.cpp +../../../src/hotspot/cpu/sparc/icache_sparc.hpp +../../../src/hotspot/cpu/sparc/interpreterRT_sparc.cpp +../../../src/hotspot/cpu/sparc/templateInterpreterGenerator_sparc.cpp +../../../src/hotspot/cpu/sparc/depChecker_sparc.cpp +../../../src/hotspot/cpu/sparc/runtime_sparc.cpp +../../../src/hotspot/cpu/sparc/register_sparc.cpp +../../../src/hotspot/cpu/sparc/c1_LIRAssembler_sparc.hpp +../../../src/hotspot/cpu/sparc/c2_globals_sparc.hpp +../../../src/hotspot/cpu/sparc/c1_FrameMap_sparc.cpp +../../../src/hotspot/cpu/sparc/bytes_sparc.hpp +../../../src/hotspot/cpu/sparc/interp_masm_sparc.hpp +../../../src/hotspot/cpu/sparc/vm_version_ext_sparc.hpp +../../../src/hotspot/cpu/sparc/jvmciCodeInstaller_sparc.cpp +../../../src/hotspot/cpu/sparc/c1_MacroAssembler_sparc.hpp +../../../src/hotspot/cpu/sparc/globalDefinitions_sparc.hpp +../../../src/hotspot/cpu/sparc/stubRoutines_sparc.cpp +../../../src/hotspot/cpu/sparc/frame_sparc.cpp +../../../src/hotspot/cpu/sparc/assembler_sparc.hpp +../../../src/hotspot/cpu/sparc/c1_CodeStubs_sparc.cpp +../../../src/hotspot/cpu/sparc/methodHandles_sparc.cpp +../../../src/hotspot/cpu/sparc/relocInfo_sparc.hpp +../../../src/hotspot/cpu/sparc/icache_sparc.cpp +../../../src/hotspot/cpu/sparc/interpreterRT_sparc.hpp +../../../src/hotspot/cpu/sparc/globals_sparc.hpp +../../../src/hotspot/cpu/sparc/vmreg_sparc.inline.hpp +../../../src/hotspot/cpu/sparc/depChecker_sparc.hpp +../../../src/hotspot/cpu/sparc/registerMap_sparc.hpp +../../../src/hotspot/cpu/sparc/c1_LIRAssembler_sparc.cpp +../../../src/hotspot/cpu/sparc/register_sparc.hpp +../../../src/hotspot/cpu/sparc/gc/g1/g1BarrierSetAssembler_sparc.cpp +../../../src/hotspot/cpu/sparc/gc/g1/g1BarrierSetAssembler_sparc.hpp +../../../src/hotspot/cpu/sparc/gc/shared/cardTableBarrierSetAssembler_sparc.cpp +../../../src/hotspot/cpu/sparc/gc/shared/modRefBarrierSetAssembler_sparc.hpp +../../../src/hotspot/cpu/sparc/gc/shared/barrierSetAssembler_sparc.cpp +../../../src/hotspot/cpu/sparc/gc/shared/modRefBarrierSetAssembler_sparc.cpp +../../../src/hotspot/cpu/sparc/gc/shared/barrierSetAssembler_sparc.hpp +../../../src/hotspot/cpu/sparc/gc/shared/cardTableBarrierSetAssembler_sparc.hpp +../../../src/hotspot/cpu/sparc/c1_FrameMap_sparc.hpp +../../../src/hotspot/cpu/sparc/compiledIC_sparc.cpp +../../../src/hotspot/cpu/sparc/icBuffer_sparc.cpp +../../../src/hotspot/cpu/sparc/nativeInst_sparc.cpp +../../../src/hotspot/cpu/sparc/c1_LinearScan_sparc.cpp +../../../src/hotspot/cpu/sparc/c1_Runtime1_sparc.cpp +../../../src/hotspot/cpu/sparc/c1_FpuStackSim_sparc.hpp +../../../src/hotspot/cpu/sparc/jniTypes_sparc.hpp +../../../src/hotspot/cpu/sparc/vtableStubs_sparc.cpp +../../../src/hotspot/cpu/sparc/javaFrameAnchor_sparc.hpp +../../../src/hotspot/cpu/sparc/sharedRuntime_sparc.cpp +../../../src/hotspot/cpu/sparc/vmreg_sparc.cpp +../../../src/hotspot/cpu/sparc/vm_version_sparc.hpp +../../../src/hotspot/cpu/sparc/templateTable_sparc.cpp +../../../src/hotspot/cpu/sparc/macroAssembler_sparc.hpp +../../../src/hotspot/os_cpu/aix_ppc/thread_aix_ppc.hpp +../../../src/hotspot/os_cpu/aix_ppc/atomic_aix_ppc.hpp +../../../src/hotspot/os_cpu/aix_ppc/globals_aix_ppc.hpp +../../../src/hotspot/os_cpu/aix_ppc/os_aix_ppc.hpp +../../../src/hotspot/os_cpu/aix_ppc/vmStructs_aix_ppc.hpp +../../../src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp +../../../src/hotspot/os_cpu/aix_ppc/orderAccess_aix_ppc.hpp +../../../src/hotspot/os_cpu/aix_ppc/thread_aix_ppc.cpp +../../../src/hotspot/os_cpu/aix_ppc/bytes_aix_ppc.inline.hpp +../../../src/hotspot/os_cpu/aix_ppc/prefetch_aix_ppc.inline.hpp +../../../src/hotspot/os_cpu/linux_arm/copy_linux_arm.inline.hpp +../../../src/hotspot/os_cpu/linux_arm/globals_linux_arm.hpp +../../../src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp +../../../src/hotspot/os_cpu/linux_arm/thread_linux_arm.hpp +../../../src/hotspot/os_cpu/linux_arm/atomic_linux_arm.hpp +../../../src/hotspot/os_cpu/linux_arm/vmStructs_linux_arm.hpp +../../../src/hotspot/os_cpu/linux_arm/orderAccess_linux_arm.hpp +../../../src/hotspot/os_cpu/linux_arm/prefetch_linux_arm.inline.hpp +../../../src/hotspot/os_cpu/linux_arm/thread_linux_arm.cpp +../../../src/hotspot/os_cpu/linux_arm/vm_version_linux_arm_32.cpp +../../../src/hotspot/os_cpu/linux_arm/bytes_linux_arm.inline.hpp +../../../src/hotspot/os_cpu/linux_arm/macroAssembler_linux_arm_32.cpp +../../../src/hotspot/os_cpu/linux_arm/os_linux_arm.hpp +../../../src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp +../../../src/hotspot/os_cpu/linux_zero/atomic_linux_zero.hpp +../../../src/hotspot/os_cpu/linux_zero/thread_linux_zero.cpp +../../../src/hotspot/os_cpu/linux_zero/assembler_linux_zero.cpp +../../../src/hotspot/os_cpu/linux_zero/vm_version_linux_zero.cpp +../../../src/hotspot/os_cpu/linux_zero/globals_linux_zero.hpp +../../../src/hotspot/os_cpu/linux_zero/thread_linux_zero.hpp +../../../src/hotspot/os_cpu/linux_zero/orderAccess_linux_zero.hpp +../../../src/hotspot/os_cpu/linux_zero/prefetch_linux_zero.inline.hpp +../../../src/hotspot/os_cpu/linux_zero/vmStructs_linux_zero.hpp +../../../src/hotspot/os_cpu/linux_zero/bytes_linux_zero.inline.hpp +../../../src/hotspot/os_cpu/linux_zero/os_linux_zero.hpp +../../../src/hotspot/os_cpu/linux_x86/orderAccess_linux_x86.hpp +../../../src/hotspot/os_cpu/linux_x86/thread_linux_x86.hpp +../../../src/hotspot/os_cpu/linux_x86/atomic_linux_x86.hpp +../../../src/hotspot/os_cpu/linux_x86/prefetch_linux_x86.inline.hpp +../../../src/hotspot/os_cpu/linux_x86/vmStructs_linux_x86.hpp +../../../src/hotspot/os_cpu/linux_x86/bytes_linux_x86.inline.hpp +../../../src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp +../../../src/hotspot/os_cpu/linux_x86/globals_linux_x86.hpp +../../../src/hotspot/os_cpu/linux_x86/assembler_linux_x86.cpp +../../../src/hotspot/os_cpu/linux_x86/os_linux_x86.inline.hpp +../../../src/hotspot/os_cpu/linux_x86/os_linux_x86.hpp +../../../src/hotspot/os_cpu/linux_x86/copy_linux_x86.inline.hpp +../../../src/hotspot/os_cpu/linux_x86/gc/z/zVirtualMemory_linux_x86.cpp +../../../src/hotspot/os_cpu/linux_x86/gc/z/zNUMA_linux_x86.cpp +../../../src/hotspot/os_cpu/linux_x86/gc/z/zBackingFile_linux_x86.hpp +../../../src/hotspot/os_cpu/linux_x86/gc/z/zAddress_linux_x86.inline.hpp +../../../src/hotspot/os_cpu/linux_x86/gc/z/zPhysicalMemoryBacking_linux_x86.cpp +../../../src/hotspot/os_cpu/linux_x86/gc/z/zGlobals_linux_x86.hpp +../../../src/hotspot/os_cpu/linux_x86/gc/z/zBackingPath_linux_x86.hpp +../../../src/hotspot/os_cpu/linux_x86/gc/z/zPhysicalMemoryBacking_linux_x86.hpp +../../../src/hotspot/os_cpu/linux_x86/gc/z/zGlobals_linux_x86.cpp +../../../src/hotspot/os_cpu/linux_x86/gc/z/zBackingPath_linux_x86.cpp +../../../src/hotspot/os_cpu/linux_x86/gc/z/zLargePages_linux_x86.cpp +../../../src/hotspot/os_cpu/linux_x86/gc/z/zBackingFile_linux_x86.cpp +../../../src/hotspot/os_cpu/linux_x86/thread_linux_x86.cpp +../../../src/hotspot/os_cpu/linux_x86/vm_version_linux_x86.cpp +../../../src/hotspot/os_cpu/linux_aarch64/atomic_linux_aarch64.hpp +../../../src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp +../../../src/hotspot/os_cpu/linux_aarch64/bytes_linux_aarch64.inline.hpp +../../../src/hotspot/os_cpu/linux_aarch64/assembler_linux_aarch64.cpp +../../../src/hotspot/os_cpu/linux_aarch64/thread_linux_aarch64.cpp +../../../src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.hpp +../../../src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.inline.hpp +../../../src/hotspot/os_cpu/linux_aarch64/vmStructs_linux_aarch64.hpp +../../../src/hotspot/os_cpu/linux_aarch64/prefetch_linux_aarch64.inline.hpp +../../../src/hotspot/os_cpu/linux_aarch64/globals_linux_aarch64.hpp +../../../src/hotspot/os_cpu/linux_aarch64/orderAccess_linux_aarch64.hpp +../../../src/hotspot/os_cpu/linux_aarch64/thread_linux_aarch64.hpp +../../../src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp +../../../src/hotspot/os_cpu/linux_aarch64/copy_linux_aarch64.inline.hpp +../../../src/hotspot/os_cpu/solaris_sparc/thread_solaris_sparc.cpp +../../../src/hotspot/os_cpu/solaris_sparc/os_solaris_sparc.hpp +../../../src/hotspot/os_cpu/solaris_sparc/atomic_solaris_sparc.hpp +../../../src/hotspot/os_cpu/solaris_sparc/vm_version_solaris_sparc.cpp +../../../src/hotspot/os_cpu/solaris_sparc/count_trailing_zeros_solaris_sparc.hpp +../../../src/hotspot/os_cpu/solaris_sparc/thread_solaris_sparc.hpp +../../../src/hotspot/os_cpu/solaris_sparc/os_solaris_sparc.cpp +../../../src/hotspot/os_cpu/solaris_sparc/globals_solaris_sparc.hpp +../../../src/hotspot/os_cpu/solaris_sparc/orderAccess_solaris_sparc.hpp +../../../src/hotspot/os_cpu/solaris_sparc/prefetch_solaris_sparc.inline.hpp +../../../src/hotspot/os_cpu/solaris_sparc/vmStructs_solaris_sparc.hpp +../../../src/hotspot/os_cpu/linux_sparc/globals_linux_sparc.hpp +../../../src/hotspot/os_cpu/linux_sparc/os_linux_sparc.cpp +../../../src/hotspot/os_cpu/linux_sparc/atomic_linux_sparc.hpp +../../../src/hotspot/os_cpu/linux_sparc/thread_linux_sparc.cpp +../../../src/hotspot/os_cpu/linux_sparc/prefetch_linux_sparc.inline.hpp +../../../src/hotspot/os_cpu/linux_sparc/vm_version_linux_sparc.cpp +../../../src/hotspot/os_cpu/linux_sparc/orderAccess_linux_sparc.hpp +../../../src/hotspot/os_cpu/linux_sparc/thread_linux_sparc.hpp +../../../src/hotspot/os_cpu/linux_sparc/os_linux_sparc.hpp +../../../src/hotspot/os_cpu/linux_sparc/vmStructs_linux_sparc.hpp +../../../src/hotspot/os_cpu/bsd_zero/bytes_bsd_zero.inline.hpp +../../../src/hotspot/os_cpu/bsd_zero/prefetch_bsd_zero.inline.hpp +../../../src/hotspot/os_cpu/bsd_zero/vm_version_bsd_zero.cpp +../../../src/hotspot/os_cpu/bsd_zero/os_bsd_zero.cpp +../../../src/hotspot/os_cpu/bsd_zero/thread_bsd_zero.hpp +../../../src/hotspot/os_cpu/bsd_zero/atomic_bsd_zero.hpp +../../../src/hotspot/os_cpu/bsd_zero/os_bsd_zero.hpp +../../../src/hotspot/os_cpu/bsd_zero/globals_bsd_zero.hpp +../../../src/hotspot/os_cpu/bsd_zero/thread_bsd_zero.cpp +../../../src/hotspot/os_cpu/bsd_zero/assembler_bsd_zero.cpp +../../../src/hotspot/os_cpu/bsd_zero/vmStructs_bsd_zero.hpp +../../../src/hotspot/os_cpu/bsd_zero/orderAccess_bsd_zero.hpp +../../../src/hotspot/os_cpu/bsd_x86/assembler_bsd_x86.cpp +../../../src/hotspot/os_cpu/bsd_x86/orderAccess_bsd_x86.hpp +../../../src/hotspot/os_cpu/bsd_x86/copy_bsd_x86.inline.hpp +../../../src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp +../../../src/hotspot/os_cpu/bsd_x86/os_bsd_x86.inline.hpp +../../../src/hotspot/os_cpu/bsd_x86/thread_bsd_x86.cpp +../../../src/hotspot/os_cpu/bsd_x86/vm_version_bsd_x86.cpp +../../../src/hotspot/os_cpu/bsd_x86/globals_bsd_x86.hpp +../../../src/hotspot/os_cpu/bsd_x86/atomic_bsd_x86.hpp +../../../src/hotspot/os_cpu/bsd_x86/thread_bsd_x86.hpp +../../../src/hotspot/os_cpu/bsd_x86/prefetch_bsd_x86.inline.hpp +../../../src/hotspot/os_cpu/bsd_x86/bytes_bsd_x86.inline.hpp +../../../src/hotspot/os_cpu/bsd_x86/vmStructs_bsd_x86.hpp +../../../src/hotspot/os_cpu/bsd_x86/os_bsd_x86.hpp +../../../src/hotspot/os_cpu/linux_ppc/os_linux_ppc.hpp +../../../src/hotspot/os_cpu/linux_ppc/prefetch_linux_ppc.inline.hpp +../../../src/hotspot/os_cpu/linux_ppc/bytes_linux_ppc.inline.hpp +../../../src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp +../../../src/hotspot/os_cpu/linux_ppc/orderAccess_linux_ppc.hpp +../../../src/hotspot/os_cpu/linux_ppc/vmStructs_linux_ppc.hpp +../../../src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.hpp +../../../src/hotspot/os_cpu/linux_ppc/atomic_linux_ppc.hpp +../../../src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp +../../../src/hotspot/os_cpu/linux_ppc/globals_linux_ppc.hpp +../../../src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp +../../../src/hotspot/os_cpu/linux_s390/prefetch_linux_s390.inline.hpp +../../../src/hotspot/os_cpu/linux_s390/thread_linux_s390.cpp +../../../src/hotspot/os_cpu/linux_s390/atomic_linux_s390.hpp +../../../src/hotspot/os_cpu/linux_s390/globals_linux_s390.hpp +../../../src/hotspot/os_cpu/linux_s390/bytes_linux_s390.inline.hpp +../../../src/hotspot/os_cpu/linux_s390/thread_linux_s390.hpp +../../../src/hotspot/os_cpu/linux_s390/orderAccess_linux_s390.hpp +../../../src/hotspot/os_cpu/linux_s390/vmStructs_linux_s390.hpp +../../../src/hotspot/os_cpu/linux_s390/os_linux_s390.hpp +../../../src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp +../../../src/hotspot/os_cpu/windows_x86/globals_windows_x86.hpp +../../../src/hotspot/os_cpu/windows_x86/bytes_windows_x86.inline.hpp +../../../src/hotspot/os_cpu/windows_x86/atomic_windows_x86.hpp +../../../src/hotspot/os_cpu/windows_x86/copy_windows_x86.inline.hpp +../../../src/hotspot/os_cpu/windows_x86/thread_windows_x86.cpp +../../../src/hotspot/os_cpu/windows_x86/prefetch_windows_x86.inline.hpp +../../../src/hotspot/os_cpu/windows_x86/unwind_windows_x86.hpp +../../../src/hotspot/os_cpu/windows_x86/vm_version_windows_x86.cpp +../../../src/hotspot/os_cpu/windows_x86/thread_windows_x86.hpp +../../../src/hotspot/os_cpu/windows_x86/orderAccess_windows_x86.hpp +../../../src/hotspot/os_cpu/windows_x86/assembler_windows_x86.cpp +../../../src/hotspot/os_cpu/windows_x86/os_windows_x86.inline.hpp +../../../src/hotspot/os_cpu/windows_x86/vmStructs_windows_x86.hpp +../../../src/hotspot/os_cpu/windows_x86/os_windows_x86.hpp +../../../src/hotspot/os_cpu/solaris_x86/os_solaris_x86.cpp +../../../src/hotspot/os_cpu/solaris_x86/globals_solaris_x86.hpp +../../../src/hotspot/os_cpu/solaris_x86/atomic_solaris_x86.hpp +../../../src/hotspot/os_cpu/solaris_x86/thread_solaris_x86.cpp +../../../src/hotspot/os_cpu/solaris_x86/os_solaris_x86.inline.hpp +../../../src/hotspot/os_cpu/solaris_x86/vm_version_solaris_x86.cpp +../../../src/hotspot/os_cpu/solaris_x86/bytes_solaris_x86.inline.hpp +../../../src/hotspot/os_cpu/solaris_x86/assembler_solaris_x86.cpp +../../../src/hotspot/os_cpu/solaris_x86/orderAccess_solaris_x86.hpp +../../../src/hotspot/os_cpu/solaris_x86/thread_solaris_x86.hpp +../../../src/hotspot/os_cpu/solaris_x86/os_solaris_x86.hpp +../../../src/hotspot/os_cpu/solaris_x86/count_trailing_zeros_solaris_x86.hpp +../../../src/hotspot/os_cpu/solaris_x86/prefetch_solaris_x86.inline.hpp +../../../src/hotspot/os_cpu/solaris_x86/vmStructs_solaris_x86.hpp +../../../src/hotspot/os_cpu/solaris_x86/copy_solaris_x86.inline.hpp +../../../src/hotspot/os/posix/jvm_posix.cpp +../../../src/hotspot/os/posix/include/jvm_md.h +../../../src/hotspot/os/posix/os_posix.hpp +../../../src/hotspot/os/posix/semaphore_posix.cpp +../../../src/hotspot/os/posix/threadLocalStorage_posix.cpp +../../../src/hotspot/os/posix/vmError_posix.cpp +../../../src/hotspot/os/posix/os_posix.cpp +../../../src/hotspot/os/posix/semaphore_posix.hpp +../../../src/hotspot/os/bsd/semaphore_bsd.cpp +../../../src/hotspot/os/bsd/osThread_bsd.hpp +../../../src/hotspot/os/bsd/os_bsd.inline.hpp +../../../src/hotspot/os/bsd/globals_bsd.hpp +../../../src/hotspot/os/bsd/os_share_bsd.hpp +../../../src/hotspot/os/bsd/os_bsd.hpp +../../../src/hotspot/os/bsd/perfMemory_bsd.cpp +../../../src/hotspot/os/bsd/decoder_machO.cpp +../../../src/hotspot/os/bsd/c1_globals_bsd.hpp +../../../src/hotspot/os/bsd/threadCritical_bsd.cpp +../../../src/hotspot/os/bsd/os_bsd.cpp +../../../src/hotspot/os/bsd/attachListener_bsd.cpp +../../../src/hotspot/os/bsd/decoder_machO.hpp +../../../src/hotspot/os/bsd/vmStructs_bsd.hpp +../../../src/hotspot/os/bsd/os_perf_bsd.cpp +../../../src/hotspot/os/bsd/semaphore_bsd.hpp +../../../src/hotspot/os/bsd/osThread_bsd.cpp +../../../src/hotspot/os/bsd/c2_globals_bsd.hpp +../../../src/hotspot/os/linux/osContainer_linux.cpp +../../../src/hotspot/os/linux/decoder_linux.cpp +../../../src/hotspot/os/linux/perfMemory_linux.cpp +../../../src/hotspot/os/linux/osThread_linux.cpp +../../../src/hotspot/os/linux/os_linux.cpp +../../../src/hotspot/os/linux/globals_linux.hpp +../../../src/hotspot/os/linux/c2_globals_linux.hpp +../../../src/hotspot/os/linux/os_linux.hpp +../../../src/hotspot/os/linux/os_share_linux.hpp +../../../src/hotspot/os/linux/threadCritical_linux.cpp +../../../src/hotspot/os/linux/os_linux.inline.hpp +../../../src/hotspot/os/linux/osContainer_linux.hpp +../../../src/hotspot/os/linux/attachListener_linux.cpp +../../../src/hotspot/os/linux/c1_globals_linux.hpp +../../../src/hotspot/os/linux/os_perf_linux.cpp +../../../src/hotspot/os/linux/vmStructs_linux.hpp +../../../src/hotspot/os/linux/osThread_linux.hpp +../../../src/hotspot/os/windows/globals_windows.hpp +../../../src/hotspot/os/windows/semaphore_windows.cpp +../../../src/hotspot/os/windows/decoder_windows.cpp +../../../src/hotspot/os/windows/os_perf_windows.cpp +../../../src/hotspot/os/windows/iphlp_interface.cpp +../../../src/hotspot/os/windows/threadCritical_windows.cpp +../../../src/hotspot/os/windows/threadLocalStorage_windows.cpp +../../../src/hotspot/os/windows/include/jvm_md.h +../../../src/hotspot/os/windows/pdh_interface.cpp +../../../src/hotspot/os/windows/symbolengine.hpp +../../../src/hotspot/os/windows/windbghelp.hpp +../../../src/hotspot/os/windows/osThread_windows.hpp +../../../src/hotspot/os/windows/os_windows.hpp +../../../src/hotspot/os/windows/vmStructs_windows.hpp +../../../src/hotspot/os/windows/perfMemory_windows.cpp +../../../src/hotspot/os/windows/pdh_interface.hpp +../../../src/hotspot/os/windows/symbolengine.cpp +../../../src/hotspot/os/windows/windbghelp.cpp +../../../src/hotspot/os/windows/os_windows.cpp +../../../src/hotspot/os/windows/osThread_windows.cpp +../../../src/hotspot/os/windows/semaphore_windows.hpp +../../../src/hotspot/os/windows/jvm_windows.cpp +../../../src/hotspot/os/windows/c1_globals_windows.hpp +../../../src/hotspot/os/windows/os_windows.inline.hpp +../../../src/hotspot/os/windows/sharedRuntimeRem.cpp +../../../src/hotspot/os/windows/c2_globals_windows.hpp +../../../src/hotspot/os/windows/iphlp_interface.hpp +../../../src/hotspot/os/windows/attachListener_windows.cpp +../../../src/hotspot/os/windows/vmError_windows.cpp +../../../src/hotspot/os/windows/os_share_windows.hpp +../../../src/hotspot/os/solaris/globals_solaris.hpp +../../../src/hotspot/os/solaris/decoder_solaris.cpp +../../../src/hotspot/os/solaris/os_perf_solaris.cpp +../../../src/hotspot/os/solaris/os_solaris.inline.hpp +../../../src/hotspot/os/solaris/threadCritical_solaris.cpp +../../../src/hotspot/os/solaris/osThread_solaris.hpp +../../../src/hotspot/os/solaris/os_solaris.hpp +../../../src/hotspot/os/solaris/perfMemory_solaris.cpp +../../../src/hotspot/os/solaris/vmStructs_solaris.hpp +../../../src/hotspot/os/solaris/os_solaris.cpp +../../../src/hotspot/os/solaris/osThread_solaris.cpp +../../../src/hotspot/os/solaris/c1_globals_solaris.hpp +../../../src/hotspot/os/solaris/c2_globals_solaris.hpp +../../../src/hotspot/os/solaris/os_share_solaris.hpp +../../../src/hotspot/os/solaris/attachListener_solaris.cpp +../../../src/hotspot/os/aix/loadlib_aix.hpp +../../../src/hotspot/os/aix/threadCritical_aix.cpp +../../../src/hotspot/os/aix/c1_globals_aix.hpp +../../../src/hotspot/os/aix/libperfstat_aix.hpp +../../../src/hotspot/os/aix/perfMemory_aix.cpp +../../../src/hotspot/os/aix/os_aix.hpp +../../../src/hotspot/os/aix/porting_aix.cpp +../../../src/hotspot/os/aix/os_share_aix.hpp +../../../src/hotspot/os/aix/safepointMechanism_aix.cpp +../../../src/hotspot/os/aix/libodm_aix.cpp +../../../src/hotspot/os/aix/libo4.cpp +../../../src/hotspot/os/aix/misc_aix.cpp +../../../src/hotspot/os/aix/globals_aix.hpp +../../../src/hotspot/os/aix/osThread_aix.hpp +../../../src/hotspot/os/aix/c2_globals_aix.hpp +../../../src/hotspot/os/aix/libodm_aix.hpp +../../../src/hotspot/os/aix/libo4.hpp +../../../src/hotspot/os/aix/misc_aix.hpp +../../../src/hotspot/os/aix/decoder_aix.hpp +../../../src/hotspot/os/aix/osThread_aix.cpp +../../../src/hotspot/os/aix/os_aix.inline.hpp +../../../src/hotspot/os/aix/os_perf_aix.cpp +../../../src/hotspot/os/aix/loadlib_aix.cpp +../../../src/hotspot/os/aix/vmStructs_aix.hpp +../../../src/hotspot/os/aix/attachListener_aix.cpp +../../../src/hotspot/os/aix/libperfstat_aix.cpp +../../../src/hotspot/os/aix/os_aix.cpp +../../../src/hotspot/os/aix/porting_aix.hpp +../../../src/hotspot/share/interpreter/bytecodeTracer.cpp +../../../src/hotspot/share/interpreter/bytecodeHistogram.cpp +../../../src/hotspot/share/interpreter/bytecodeInterpreter.cpp +../../../src/hotspot/share/interpreter/cppInterpreterGenerator.hpp +../../../src/hotspot/share/interpreter/rewriter.hpp +../../../src/hotspot/share/interpreter/bytecodes.hpp +../../../src/hotspot/share/interpreter/bytecode.cpp +../../../src/hotspot/share/interpreter/templateInterpreter.hpp +../../../src/hotspot/share/interpreter/bytecodeInterpreterProfiling.hpp +../../../src/hotspot/share/interpreter/interpreter.cpp +../../../src/hotspot/share/interpreter/oopMapCache.cpp +../../../src/hotspot/share/interpreter/linkResolver.cpp +../../../src/hotspot/share/interpreter/templateTable.hpp +../../../src/hotspot/share/interpreter/abstractInterpreter.hpp +../../../src/hotspot/share/interpreter/invocationCounter.cpp +../../../src/hotspot/share/interpreter/cppInterpreter.cpp +../../../src/hotspot/share/interpreter/interp_masm.hpp +../../../src/hotspot/share/interpreter/bytecodeStream.cpp +../../../src/hotspot/share/interpreter/templateInterpreterGenerator.hpp +../../../src/hotspot/share/interpreter/interpreterRuntime.hpp +../../../src/hotspot/share/interpreter/linkResolver.hpp +../../../src/hotspot/share/interpreter/templateTable.cpp +../../../src/hotspot/share/interpreter/abstractInterpreter.cpp +../../../src/hotspot/share/interpreter/bytecodeInterpreter.inline.hpp +../../../src/hotspot/share/interpreter/invocationCounter.hpp +../../../src/hotspot/share/interpreter/cppInterpreter.hpp +../../../src/hotspot/share/interpreter/bytecodeStream.hpp +../../../src/hotspot/share/interpreter/templateInterpreterGenerator.cpp +../../../src/hotspot/share/interpreter/interpreterRuntime.cpp +../../../src/hotspot/share/interpreter/bytecodeHistogram.hpp +../../../src/hotspot/share/interpreter/bytecodeTracer.hpp +../../../src/hotspot/share/interpreter/bytecodeInterpreter.hpp +../../../src/hotspot/share/interpreter/cppInterpreterGenerator.cpp +../../../src/hotspot/share/interpreter/bytecodes.cpp +../../../src/hotspot/share/interpreter/rewriter.cpp +../../../src/hotspot/share/interpreter/bytecode.hpp +../../../src/hotspot/share/interpreter/templateInterpreter.cpp +../../../src/hotspot/share/interpreter/interpreter.hpp +../../../src/hotspot/share/interpreter/oopMapCache.hpp +../../../src/hotspot/share/interpreter/bytecode.inline.hpp +../../../src/hotspot/share/metaprogramming/isIntegral.hpp +../../../src/hotspot/share/metaprogramming/isPointer.hpp +../../../src/hotspot/share/metaprogramming/isFloatingPoint.hpp +../../../src/hotspot/share/metaprogramming/isVolatile.hpp +../../../src/hotspot/share/metaprogramming/isSame.hpp +../../../src/hotspot/share/metaprogramming/removePointer.hpp +../../../src/hotspot/share/metaprogramming/removeReference.hpp +../../../src/hotspot/share/metaprogramming/removeCV.hpp +../../../src/hotspot/share/metaprogramming/decay.hpp +../../../src/hotspot/share/metaprogramming/isSigned.hpp +../../../src/hotspot/share/metaprogramming/enableIf.hpp +../../../src/hotspot/share/metaprogramming/conditional.hpp +../../../src/hotspot/share/metaprogramming/integralConstant.hpp +../../../src/hotspot/share/metaprogramming/isConst.hpp +../../../src/hotspot/share/metaprogramming/primitiveConversions.hpp +../../../src/hotspot/share/metaprogramming/isRegisteredEnum.hpp +../../../src/hotspot/share/asm/codeBuffer.hpp +../../../src/hotspot/share/asm/macroAssembler.hpp +../../../src/hotspot/share/asm/register.hpp +../../../src/hotspot/share/asm/assembler.cpp +../../../src/hotspot/share/asm/register.cpp +../../../src/hotspot/share/asm/assembler.hpp +../../../src/hotspot/share/asm/codeBuffer.cpp +../../../src/hotspot/share/asm/assembler.inline.hpp +../../../src/hotspot/share/asm/macroAssembler.inline.hpp +../../../src/hotspot/share/memory/resourceArea.hpp +../../../src/hotspot/share/memory/freeList.inline.hpp +../../../src/hotspot/share/memory/oopFactory.cpp +../../../src/hotspot/share/memory/metaspaceShared.cpp +../../../src/hotspot/share/memory/metaspaceTracer.cpp +../../../src/hotspot/share/memory/metaspace.cpp +../../../src/hotspot/share/memory/metaspaceClosure.cpp +../../../src/hotspot/share/memory/iterator.cpp +../../../src/hotspot/share/memory/allocation.inline.hpp +../../../src/hotspot/share/memory/metaspaceGCThresholdUpdater.hpp +../../../src/hotspot/share/memory/memRegion.hpp +../../../src/hotspot/share/memory/allocation.cpp +../../../src/hotspot/share/memory/guardedMemory.hpp +../../../src/hotspot/share/memory/binaryTreeDictionary.hpp +../../../src/hotspot/share/memory/heapInspection.cpp +../../../src/hotspot/share/memory/heap.cpp +../../../src/hotspot/share/memory/metaspaceCounters.cpp +../../../src/hotspot/share/memory/filemap.hpp +../../../src/hotspot/share/memory/universe.hpp +../../../src/hotspot/share/memory/arena.cpp +../../../src/hotspot/share/memory/virtualspace.cpp +../../../src/hotspot/share/memory/operator_new.cpp +../../../src/hotspot/share/memory/iterator.inline.hpp +../../../src/hotspot/share/memory/allocation.hpp +../../../src/hotspot/share/memory/guardedMemory.cpp +../../../src/hotspot/share/memory/padded.inline.hpp +../../../src/hotspot/share/memory/heapInspection.hpp +../../../src/hotspot/share/memory/heap.hpp +../../../src/hotspot/share/memory/filemap.cpp +../../../src/hotspot/share/memory/metaspaceCounters.hpp +../../../src/hotspot/share/memory/arena.hpp +../../../src/hotspot/share/memory/universe.cpp +../../../src/hotspot/share/memory/virtualspace.hpp +../../../src/hotspot/share/memory/resourceArea.cpp +../../../src/hotspot/share/memory/metaspaceShared.hpp +../../../src/hotspot/share/memory/oopFactory.hpp +../../../src/hotspot/share/memory/metaspaceTracer.hpp +../../../src/hotspot/share/memory/metaspace/virtualSpaceList.hpp +../../../src/hotspot/share/memory/metaspace/printCLDMetaspaceInfoClosure.cpp +../../../src/hotspot/share/memory/metaspace/metaspaceCommon.hpp +../../../src/hotspot/share/memory/metaspace/chunkManager.hpp +../../../src/hotspot/share/memory/metaspace/occupancyMap.cpp +../../../src/hotspot/share/memory/metaspace/smallBlocks.hpp +../../../src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp +../../../src/hotspot/share/memory/metaspace/spaceManager.cpp +../../../src/hotspot/share/memory/metaspace/metaspaceDCmd.cpp +../../../src/hotspot/share/memory/metaspace/metaDebug.cpp +../../../src/hotspot/share/memory/metaspace/metachunk.hpp +../../../src/hotspot/share/memory/metaspace/printMetaspaceInfoKlassClosure.hpp +../../../src/hotspot/share/memory/metaspace/blockFreelist.hpp +../../../src/hotspot/share/memory/metaspace/metaspaceStatistics.hpp +../../../src/hotspot/share/memory/metaspace/metablock.hpp +../../../src/hotspot/share/memory/metaspace/metabase.hpp +../../../src/hotspot/share/memory/metaspace/metaspaceDCmd.hpp +../../../src/hotspot/share/memory/metaspace/metaDebug.hpp +../../../src/hotspot/share/memory/metaspace/metachunk.cpp +../../../src/hotspot/share/memory/metaspace/printMetaspaceInfoKlassClosure.cpp +../../../src/hotspot/share/memory/metaspace/blockFreelist.cpp +../../../src/hotspot/share/memory/metaspace/metaspaceStatistics.cpp +../../../src/hotspot/share/memory/metaspace/printCLDMetaspaceInfoClosure.hpp +../../../src/hotspot/share/memory/metaspace/virtualSpaceList.cpp +../../../src/hotspot/share/memory/metaspace/metaspaceCommon.cpp +../../../src/hotspot/share/memory/metaspace/occupancyMap.hpp +../../../src/hotspot/share/memory/metaspace/chunkManager.cpp +../../../src/hotspot/share/memory/metaspace/smallBlocks.cpp +../../../src/hotspot/share/memory/metaspace/virtualSpaceNode.hpp +../../../src/hotspot/share/memory/metaspace/spaceManager.hpp +../../../src/hotspot/share/memory/metaspace.hpp +../../../src/hotspot/share/memory/referenceType.hpp +../../../src/hotspot/share/memory/metadataFactory.hpp +../../../src/hotspot/share/memory/freeList.hpp +../../../src/hotspot/share/memory/metaspaceClosure.hpp +../../../src/hotspot/share/memory/resourceArea.inline.hpp +../../../src/hotspot/share/memory/padded.hpp +../../../src/hotspot/share/memory/metaspaceChunkFreeListSummary.hpp +../../../src/hotspot/share/memory/iterator.hpp +../../../src/hotspot/share/memory/binaryTreeDictionary.inline.hpp +../../../src/hotspot/share/memory/memRegion.cpp +../../../src/hotspot/share/jfr/dcmd/jfrDcmds.cpp +../../../src/hotspot/share/jfr/dcmd/jfrDcmds.hpp +../../../src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.cpp +../../../src/hotspot/share/jfr/periodic/jfrOSInterface.cpp +../../../src/hotspot/share/jfr/periodic/jfrModuleEvent.hpp +../../../src/hotspot/share/jfr/periodic/jfrPeriodic.cpp +../../../src/hotspot/share/jfr/periodic/jfrNetworkUtilization.cpp +../../../src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp +../../../src/hotspot/share/jfr/periodic/sampling/jfrCallTrace.cpp +../../../src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.hpp +../../../src/hotspot/share/jfr/periodic/sampling/jfrCallTrace.hpp +../../../src/hotspot/share/jfr/periodic/jfrThreadDumpEvent.cpp +../../../src/hotspot/share/jfr/periodic/jfrModuleEvent.cpp +../../../src/hotspot/share/jfr/periodic/jfrNetworkUtilization.hpp +../../../src/hotspot/share/jfr/periodic/jfrThreadDumpEvent.hpp +../../../src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.hpp +../../../src/hotspot/share/jfr/periodic/jfrOSInterface.hpp +../../../src/hotspot/share/jfr/jfrEvents.hpp +../../../src/hotspot/share/jfr/writers/jfrJavaEventWriter.hpp +../../../src/hotspot/share/jfr/writers/jfrEventWriterHost.inline.hpp +../../../src/hotspot/share/jfr/writers/jfrNativeEventWriter.hpp +../../../src/hotspot/share/jfr/writers/jfrEncoding.hpp +../../../src/hotspot/share/jfr/writers/jfrStorageHost.hpp +../../../src/hotspot/share/jfr/writers/jfrStorageAdapter.hpp +../../../src/hotspot/share/jfr/writers/jfrEncoders.hpp +../../../src/hotspot/share/jfr/writers/jfrPosition.hpp +../../../src/hotspot/share/jfr/writers/jfrMemoryWriterHost.hpp +../../../src/hotspot/share/jfr/writers/jfrPosition.inline.hpp +../../../src/hotspot/share/jfr/writers/jfrMemoryWriterHost.inline.hpp +../../../src/hotspot/share/jfr/writers/jfrStorageHost.inline.hpp +../../../src/hotspot/share/jfr/writers/jfrStreamWriterHost.hpp +../../../src/hotspot/share/jfr/writers/jfrWriterHost.inline.hpp +../../../src/hotspot/share/jfr/writers/jfrJavaEventWriter.cpp +../../../src/hotspot/share/jfr/writers/jfrBigEndianWriter.hpp +../../../src/hotspot/share/jfr/writers/jfrWriterHost.hpp +../../../src/hotspot/share/jfr/writers/jfrEventWriterHost.hpp +../../../src/hotspot/share/jfr/writers/jfrStreamWriterHost.inline.hpp +../../../src/hotspot/share/jfr/jfr.hpp +../../../src/hotspot/share/jfr/instrumentation/jfrJvmtiAgent.hpp +../../../src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.hpp +../../../src/hotspot/share/jfr/instrumentation/jfrJvmtiAgent.cpp +../../../src/hotspot/share/jfr/instrumentation/jfrEventClassTransformer.cpp +../../../src/hotspot/share/jfr/utilities/jfrAllocation.cpp +../../../src/hotspot/share/jfr/utilities/jfrTypes.hpp +../../../src/hotspot/share/jfr/utilities/jfrTimeConverter.cpp +../../../src/hotspot/share/jfr/utilities/jfrTryLock.hpp +../../../src/hotspot/share/jfr/utilities/jfrSpinlockHelper.hpp +../../../src/hotspot/share/jfr/utilities/jfrResourceManager.hpp +../../../src/hotspot/share/jfr/utilities/jfrTime.hpp +../../../src/hotspot/share/jfr/utilities/jfrJavaLog.cpp +../../../src/hotspot/share/jfr/utilities/jfrRefCountPointer.hpp +../../../src/hotspot/share/jfr/utilities/jfrIterator.hpp +../../../src/hotspot/share/jfr/utilities/jfrTime.cpp +../../../src/hotspot/share/jfr/utilities/jfrDoublyLinkedList.hpp +../../../src/hotspot/share/jfr/utilities/jfrJavaLog.hpp +../../../src/hotspot/share/jfr/utilities/jfrHashtable.hpp +../../../src/hotspot/share/jfr/utilities/jfrAllocation.hpp +../../../src/hotspot/share/jfr/utilities/jfrLogTagSets.hpp +../../../src/hotspot/share/jfr/utilities/jfrTimeConverter.hpp +../../../src/hotspot/share/jfr/utilities/jfrBigEndian.hpp +../../../src/hotspot/share/jfr/jfr.cpp +../../../src/hotspot/share/jfr/support/jfrIntrinsics.hpp +../../../src/hotspot/share/jfr/support/jfrAllocationTracer.cpp +../../../src/hotspot/share/jfr/support/jfrKlassExtension.hpp +../../../src/hotspot/share/jfr/support/jfrFlush.hpp +../../../src/hotspot/share/jfr/support/jfrStackTraceMark.hpp +../../../src/hotspot/share/jfr/support/jfrThreadLocal.cpp +../../../src/hotspot/share/jfr/support/jfrEventClass.cpp +../../../src/hotspot/share/jfr/support/jfrFlush.cpp +../../../src/hotspot/share/jfr/support/jfrStackTraceMark.cpp +../../../src/hotspot/share/jfr/support/jfrThreadLocal.hpp +../../../src/hotspot/share/jfr/support/jfrEventClass.hpp +../../../src/hotspot/share/jfr/support/jfrTraceIdExtension.hpp +../../../src/hotspot/share/jfr/support/jfrThreadExtension.hpp +../../../src/hotspot/share/jfr/support/jfrAllocationTracer.hpp +../../../src/hotspot/share/jfr/support/jfrThreadId.hpp +../../../src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.cpp +../../../src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.cpp +../../../src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolWriter.hpp +../../../src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolWriter.cpp +../../../src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.hpp +../../../src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.hpp +../../../src/hotspot/share/jfr/recorder/repository/jfrChunkWriter.cpp +../../../src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.hpp +../../../src/hotspot/share/jfr/recorder/repository/jfrChunkSizeNotifier.hpp +../../../src/hotspot/share/jfr/recorder/repository/jfrChunkState.hpp +../../../src/hotspot/share/jfr/recorder/repository/jfrRepository.cpp +../../../src/hotspot/share/jfr/recorder/repository/jfrChunkState.cpp +../../../src/hotspot/share/jfr/recorder/repository/jfrRepository.hpp +../../../src/hotspot/share/jfr/recorder/repository/jfrChunkWriter.hpp +../../../src/hotspot/share/jfr/recorder/repository/jfrChunkSizeNotifier.cpp +../../../src/hotspot/share/jfr/recorder/repository/jfrEmergencyDump.cpp +../../../src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointBlob.hpp +../../../src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointWriter.cpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadGroup.hpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.hpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.cpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.hpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.cpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdBits.inline.hpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.cpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.hpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.hpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.cpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetWriter.hpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadState.hpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.hpp +../../../src/hotspot/share/jfr/recorder/checkpoint/types/jfrThreadGroup.cpp +../../../src/hotspot/share/jfr/recorder/checkpoint/jfrMetadataEvent.cpp +../../../src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp +../../../src/hotspot/share/jfr/recorder/checkpoint/jfrMetadataEvent.hpp +../../../src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.hpp +../../../src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointBlob.cpp +../../../src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointWriter.hpp +../../../src/hotspot/share/jfr/recorder/jfrRecorder.hpp +../../../src/hotspot/share/jfr/recorder/jfrEventSetting.cpp +../../../src/hotspot/share/jfr/recorder/storage/jfrStorage.cpp +../../../src/hotspot/share/jfr/recorder/storage/jfrStorageControl.cpp +../../../src/hotspot/share/jfr/recorder/storage/jfrBuffer.cpp +../../../src/hotspot/share/jfr/recorder/storage/jfrMemorySpaceRetrieval.hpp +../../../src/hotspot/share/jfr/recorder/storage/jfrMemorySpace.inline.hpp +../../../src/hotspot/share/jfr/recorder/storage/jfrMemorySpace.hpp +../../../src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp +../../../src/hotspot/share/jfr/recorder/storage/jfrStorageUtils.hpp +../../../src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.hpp +../../../src/hotspot/share/jfr/recorder/storage/jfrStorageUtils.inline.hpp +../../../src/hotspot/share/jfr/recorder/storage/jfrStorage.hpp +../../../src/hotspot/share/jfr/recorder/storage/jfrStorageControl.hpp +../../../src/hotspot/share/jfr/recorder/storage/jfrBuffer.hpp +../../../src/hotspot/share/jfr/recorder/jfrRecorder.cpp +../../../src/hotspot/share/jfr/recorder/jfrEventSetting.hpp +../../../src/hotspot/share/jfr/recorder/stacktrace/jfrStackTraceRepository.hpp +../../../src/hotspot/share/jfr/recorder/stacktrace/jfrStackTraceRepository.cpp +../../../src/hotspot/share/jfr/recorder/service/jfrOptionSet.hpp +../../../src/hotspot/share/jfr/recorder/service/jfrRecorderService.hpp +../../../src/hotspot/share/jfr/recorder/service/jfrMemorySizer.cpp +../../../src/hotspot/share/jfr/recorder/service/jfrEvent.cpp +../../../src/hotspot/share/jfr/recorder/service/jfrRecorderThread.cpp +../../../src/hotspot/share/jfr/recorder/service/jfrPostBox.cpp +../../../src/hotspot/share/jfr/recorder/service/jfrRecorderThread.hpp +../../../src/hotspot/share/jfr/recorder/service/jfrRecorderThreadLoop.cpp +../../../src/hotspot/share/jfr/recorder/service/jfrPostBox.hpp +../../../src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp +../../../src/hotspot/share/jfr/recorder/service/jfrRecorderService.cpp +../../../src/hotspot/share/jfr/recorder/service/jfrMemorySizer.hpp +../../../src/hotspot/share/jfr/recorder/service/jfrEvent.hpp +../../../src/hotspot/share/jfr/recorder/jfrEventSetting.inline.hpp +../../../src/hotspot/share/jfr/leakprofiler/stopOperation.hpp +../../../src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleDescription.cpp +../../../src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp +../../../src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.hpp +../../../src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleWriter.cpp +../../../src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleCheckpoint.cpp +../../../src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleWriter.hpp +../../../src/hotspot/share/jfr/leakprofiler/checkpoint/objectSampleDescription.hpp +../../../src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.hpp +../../../src/hotspot/share/jfr/leakprofiler/leakProfiler.hpp +../../../src/hotspot/share/jfr/leakprofiler/emitEventOperation.hpp +../../../src/hotspot/share/jfr/leakprofiler/sampling/objectSample.hpp +../../../src/hotspot/share/jfr/leakprofiler/sampling/objectSampler.hpp +../../../src/hotspot/share/jfr/leakprofiler/sampling/sampleList.cpp +../../../src/hotspot/share/jfr/leakprofiler/sampling/samplePriorityQueue.cpp +../../../src/hotspot/share/jfr/leakprofiler/sampling/samplePriorityQueue.hpp +../../../src/hotspot/share/jfr/leakprofiler/sampling/objectSampler.cpp +../../../src/hotspot/share/jfr/leakprofiler/sampling/sampleList.hpp +../../../src/hotspot/share/jfr/leakprofiler/leakProfiler.cpp +../../../src/hotspot/share/jfr/leakprofiler/utilities/saveRestore.hpp +../../../src/hotspot/share/jfr/leakprofiler/utilities/granularTimer.cpp +../../../src/hotspot/share/jfr/leakprofiler/utilities/granularTimer.hpp +../../../src/hotspot/share/jfr/leakprofiler/utilities/saveRestore.cpp +../../../src/hotspot/share/jfr/leakprofiler/utilities/rootType.hpp +../../../src/hotspot/share/jfr/leakprofiler/utilities/unifiedOop.hpp +../../../src/hotspot/share/jfr/leakprofiler/startOperation.hpp +../../../src/hotspot/share/jfr/leakprofiler/emitEventOperation.cpp +../../../src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.cpp +../../../src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.cpp +../../../src/hotspot/share/jfr/leakprofiler/chains/edge.hpp +../../../src/hotspot/share/jfr/leakprofiler/chains/edgeStore.hpp +../../../src/hotspot/share/jfr/leakprofiler/chains/bitset.hpp +../../../src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.hpp +../../../src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.hpp +../../../src/hotspot/share/jfr/leakprofiler/chains/objectSampleMarker.hpp +../../../src/hotspot/share/jfr/leakprofiler/chains/edgeQueue.hpp +../../../src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.cpp +../../../src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.cpp +../../../src/hotspot/share/jfr/leakprofiler/chains/edgeQueue.cpp +../../../src/hotspot/share/jfr/leakprofiler/chains/edgeUtils.hpp +../../../src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.hpp +../../../src/hotspot/share/jfr/leakprofiler/chains/edge.cpp +../../../src/hotspot/share/jfr/leakprofiler/chains/edgeStore.cpp +../../../src/hotspot/share/jfr/leakprofiler/chains/bitset.cpp +../../../src/hotspot/share/jfr/jni/jfrJniMethod.hpp +../../../src/hotspot/share/jfr/jni/jfrUpcalls.cpp +../../../src/hotspot/share/jfr/jni/jfrJniMethodRegistration.cpp +../../../src/hotspot/share/jfr/jni/jfrJavaSupport.cpp +../../../src/hotspot/share/jfr/jni/jfrGetAllEventClasses.cpp +../../../src/hotspot/share/jfr/jni/jfrJavaCall.hpp +../../../src/hotspot/share/jfr/jni/jfrJavaSupport.hpp +../../../src/hotspot/share/jfr/jni/jfrGetAllEventClasses.hpp +../../../src/hotspot/share/jfr/jni/jfrJavaCall.cpp +../../../src/hotspot/share/jfr/jni/jfrJniMethod.cpp +../../../src/hotspot/share/jfr/jni/jfrUpcalls.hpp +../../../src/hotspot/share/jfr/jni/jfrJniMethodRegistration.hpp +../../../src/hotspot/share/jfr/metadata/jfrSerializer.hpp +../../../src/hotspot/share/ci/ciConstantPoolCache.hpp +../../../src/hotspot/share/ci/ciClassList.hpp +../../../src/hotspot/share/ci/ciTypeArray.hpp +../../../src/hotspot/share/ci/ciCallSite.hpp +../../../src/hotspot/share/ci/ciType.cpp +../../../src/hotspot/share/ci/ciTypeArrayKlass.cpp +../../../src/hotspot/share/ci/ciMethodBlocks.hpp +../../../src/hotspot/share/ci/ciArray.hpp +../../../src/hotspot/share/ci/ciTypeFlow.hpp +../../../src/hotspot/share/ci/bcEscapeAnalyzer.cpp +../../../src/hotspot/share/ci/ciNullObject.hpp +../../../src/hotspot/share/ci/ciField.hpp +../../../src/hotspot/share/ci/ciConstant.cpp +../../../src/hotspot/share/ci/ciArrayKlass.hpp +../../../src/hotspot/share/ci/ciMethodType.hpp +../../../src/hotspot/share/ci/ciReplay.hpp +../../../src/hotspot/share/ci/ciInstanceKlass.hpp +../../../src/hotspot/share/ci/ciSignature.hpp +../../../src/hotspot/share/ci/ciInstance.cpp +../../../src/hotspot/share/ci/ciSymbol.cpp +../../../src/hotspot/share/ci/ciObjArray.cpp +../../../src/hotspot/share/ci/ciMetadata.cpp +../../../src/hotspot/share/ci/ciMemberName.cpp +../../../src/hotspot/share/ci/ciObjArrayKlass.cpp +../../../src/hotspot/share/ci/ciMethod.hpp +../../../src/hotspot/share/ci/ciMethodHandle.hpp +../../../src/hotspot/share/ci/ciFlags.cpp +../../../src/hotspot/share/ci/ciObjectFactory.hpp +../../../src/hotspot/share/ci/ciUtilities.hpp +../../../src/hotspot/share/ci/ciEnv.hpp +../../../src/hotspot/share/ci/ciStreams.cpp +../../../src/hotspot/share/ci/ciKlass.hpp +../../../src/hotspot/share/ci/ciMethodData.cpp +../../../src/hotspot/share/ci/ciObject.cpp +../../../src/hotspot/share/ci/ciExceptionHandler.cpp +../../../src/hotspot/share/ci/ciBaseObject.cpp +../../../src/hotspot/share/ci/ciObjArray.hpp +../../../src/hotspot/share/ci/ciObjArrayKlass.hpp +../../../src/hotspot/share/ci/ciMemberName.hpp +../../../src/hotspot/share/ci/ciMetadata.hpp +../../../src/hotspot/share/ci/ciUtilities.inline.hpp +../../../src/hotspot/share/ci/ciMethodHandle.cpp +../../../src/hotspot/share/ci/ciMethod.cpp +../../../src/hotspot/share/ci/ciFlags.hpp +../../../src/hotspot/share/ci/ciUtilities.cpp +../../../src/hotspot/share/ci/ciObjectFactory.cpp +../../../src/hotspot/share/ci/ciStreams.hpp +../../../src/hotspot/share/ci/ciEnv.cpp +../../../src/hotspot/share/ci/ciKlass.cpp +../../../src/hotspot/share/ci/ciObject.hpp +../../../src/hotspot/share/ci/ciMethodData.hpp +../../../src/hotspot/share/ci/ciBaseObject.hpp +../../../src/hotspot/share/ci/ciExceptionHandler.hpp +../../../src/hotspot/share/ci/ciConstantPoolCache.cpp +../../../src/hotspot/share/ci/ciTypeArray.cpp +../../../src/hotspot/share/ci/ciTypeArrayKlass.hpp +../../../src/hotspot/share/ci/ciType.hpp +../../../src/hotspot/share/ci/ciCallSite.cpp +../../../src/hotspot/share/ci/ciMethodBlocks.cpp +../../../src/hotspot/share/ci/ciArray.cpp +../../../src/hotspot/share/ci/compilerInterface.hpp +../../../src/hotspot/share/ci/ciTypeFlow.cpp +../../../src/hotspot/share/ci/bcEscapeAnalyzer.hpp +../../../src/hotspot/share/ci/ciCallProfile.hpp +../../../src/hotspot/share/ci/ciNullObject.cpp +../../../src/hotspot/share/ci/ciField.cpp +../../../src/hotspot/share/ci/ciConstant.hpp +../../../src/hotspot/share/ci/ciArrayKlass.cpp +../../../src/hotspot/share/ci/ciReplay.cpp +../../../src/hotspot/share/ci/ciInstanceKlass.cpp +../../../src/hotspot/share/ci/ciMethodType.cpp +../../../src/hotspot/share/ci/ciSymbol.hpp +../../../src/hotspot/share/ci/ciSignature.cpp +../../../src/hotspot/share/ci/ciInstance.hpp +../../../src/hotspot/share/include/jmm.h +../../../src/hotspot/share/include/jvm.h +../../../src/hotspot/share/c1/c1_FpuStackSim.hpp +../../../src/hotspot/share/c1/c1_MacroAssembler.hpp +../../../src/hotspot/share/c1/c1_ValueStack.hpp +../../../src/hotspot/share/c1/c1_Compilation.cpp +../../../src/hotspot/share/c1/c1_FrameMap.cpp +../../../src/hotspot/share/c1/c1_RangeCheckElimination.hpp +../../../src/hotspot/share/c1/c1_LIRGenerator.cpp +../../../src/hotspot/share/c1/c1_CodeStubs.hpp +../../../src/hotspot/share/c1/c1_InstructionPrinter.hpp +../../../src/hotspot/share/c1/c1_IR.hpp +../../../src/hotspot/share/c1/c1_LinearScan.hpp +../../../src/hotspot/share/c1/c1_CFGPrinter.cpp +../../../src/hotspot/share/c1/c1_Instruction.hpp +../../../src/hotspot/share/c1/c1_Compiler.cpp +../../../src/hotspot/share/c1/c1_Defs.cpp +../../../src/hotspot/share/c1/c1_ValueSet.hpp +../../../src/hotspot/share/c1/c1_LIR.cpp +../../../src/hotspot/share/c1/c1_LIRAssembler.cpp +../../../src/hotspot/share/c1/c1_Runtime1.hpp +../../../src/hotspot/share/c1/c1_Optimizer.hpp +../../../src/hotspot/share/c1/c1_ValueMap.cpp +../../../src/hotspot/share/c1/c1_GraphBuilder.hpp +../../../src/hotspot/share/c1/c1_Canonicalizer.cpp +../../../src/hotspot/share/c1/c1_ValueType.hpp +../../../src/hotspot/share/c1/c1_globals.hpp +../../../src/hotspot/share/c1/c1_Instruction.cpp +../../../src/hotspot/share/c1/c1_Defs.hpp +../../../src/hotspot/share/c1/c1_Compiler.hpp +../../../src/hotspot/share/c1/c1_ValueSet.cpp +../../../src/hotspot/share/c1/c1_LIR.hpp +../../../src/hotspot/share/c1/c1_LIRAssembler.hpp +../../../src/hotspot/share/c1/c1_Runtime1.cpp +../../../src/hotspot/share/c1/c1_ValueMap.hpp +../../../src/hotspot/share/c1/c1_Optimizer.cpp +../../../src/hotspot/share/c1/c1_GraphBuilder.cpp +../../../src/hotspot/share/c1/c1_Canonicalizer.hpp +../../../src/hotspot/share/c1/c1_Decorators.hpp +../../../src/hotspot/share/c1/c1_globals.cpp +../../../src/hotspot/share/c1/c1_ValueType.cpp +../../../src/hotspot/share/c1/c1_ValueStack.cpp +../../../src/hotspot/share/c1/c1_Compilation.hpp +../../../src/hotspot/share/c1/c1_FrameMap.hpp +../../../src/hotspot/share/c1/c1_RangeCheckElimination.cpp +../../../src/hotspot/share/c1/c1_LIRGenerator.hpp +../../../src/hotspot/share/c1/c1_ValueSet.inline.hpp +../../../src/hotspot/share/c1/c1_InstructionPrinter.cpp +../../../src/hotspot/share/c1/c1_IR.cpp +../../../src/hotspot/share/c1/c1_LinearScan.cpp +../../../src/hotspot/share/c1/c1_CFGPrinter.hpp +../../../src/hotspot/share/runtime/stackValueCollection.cpp +../../../src/hotspot/share/runtime/safepointMechanism.hpp +../../../src/hotspot/share/runtime/prefetch.hpp +../../../src/hotspot/share/runtime/synchronizer.cpp +../../../src/hotspot/share/runtime/vframe.cpp +../../../src/hotspot/share/runtime/init.hpp +../../../src/hotspot/share/runtime/fieldDescriptor.hpp +../../../src/hotspot/share/runtime/os.inline.hpp +../../../src/hotspot/share/runtime/mutex.cpp +../../../src/hotspot/share/runtime/safepoint.hpp +../../../src/hotspot/share/runtime/thread.cpp +../../../src/hotspot/share/runtime/jniHandles.cpp +../../../src/hotspot/share/runtime/semaphore.hpp +../../../src/hotspot/share/runtime/vframe.inline.hpp +../../../src/hotspot/share/runtime/unhandledOops.hpp +../../../src/hotspot/share/runtime/rframe.hpp +../../../src/hotspot/share/runtime/sharedRuntimeTrig.cpp +../../../src/hotspot/share/runtime/os.cpp +../../../src/hotspot/share/runtime/frame.cpp +../../../src/hotspot/share/runtime/osThread.cpp +../../../src/hotspot/share/runtime/jniHandles.inline.hpp +../../../src/hotspot/share/runtime/vmStructs.hpp +../../../src/hotspot/share/runtime/vframeArray.cpp +../../../src/hotspot/share/runtime/threadLocalStorage.hpp +../../../src/hotspot/share/runtime/reflectionUtils.hpp +../../../src/hotspot/share/runtime/signature.cpp +../../../src/hotspot/share/runtime/flags/jvmFlag.cpp +../../../src/hotspot/share/runtime/flags/jvmFlagRangeList.hpp +../../../src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.hpp +../../../src/hotspot/share/runtime/flags/jvmFlagWriteableList.cpp +../../../src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.hpp +../../../src/hotspot/share/runtime/flags/jvmFlagConstraintList.hpp +../../../src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp +../../../src/hotspot/share/runtime/flags/jvmFlagConstraintList.cpp +../../../src/hotspot/share/runtime/flags/jvmFlagRangeList.cpp +../../../src/hotspot/share/runtime/flags/jvmFlag.hpp +../../../src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp +../../../src/hotspot/share/runtime/flags/flagSetting.hpp +../../../src/hotspot/share/runtime/flags/jvmFlagWriteableList.hpp +../../../src/hotspot/share/runtime/orderAccess.cpp +../../../src/hotspot/share/runtime/handles.inline.hpp +../../../src/hotspot/share/runtime/arguments.cpp +../../../src/hotspot/share/runtime/handles.hpp +../../../src/hotspot/share/runtime/objectMonitor.hpp +../../../src/hotspot/share/runtime/threadCritical.hpp +../../../src/hotspot/share/runtime/park.hpp +../../../src/hotspot/share/runtime/sweeper.cpp +../../../src/hotspot/share/runtime/relocator.cpp +../../../src/hotspot/share/runtime/sharedRuntime.hpp +../../../src/hotspot/share/runtime/arguments_ext.cpp +../../../src/hotspot/share/runtime/prefetch.inline.hpp +../../../src/hotspot/share/runtime/globals_ext.hpp +../../../src/hotspot/share/runtime/basicLock.hpp +../../../src/hotspot/share/runtime/compilationPolicy.cpp +../../../src/hotspot/share/runtime/java.hpp +../../../src/hotspot/share/runtime/simpleThresholdPolicy.cpp +../../../src/hotspot/share/runtime/objectMonitor.inline.hpp +../../../src/hotspot/share/runtime/mutexLocker.cpp +../../../src/hotspot/share/runtime/serviceThread.cpp +../../../src/hotspot/share/runtime/statSampler.cpp +../../../src/hotspot/share/runtime/vm_operations.hpp +../../../src/hotspot/share/runtime/timer.cpp +../../../src/hotspot/share/runtime/stackValue.hpp +../../../src/hotspot/share/runtime/monitorChunk.hpp +../../../src/hotspot/share/runtime/extendedPC.hpp +../../../src/hotspot/share/runtime/biasedLocking.cpp +../../../src/hotspot/share/runtime/vmThread.cpp +../../../src/hotspot/share/runtime/timerTrace.cpp +../../../src/hotspot/share/runtime/os_ext.hpp +../../../src/hotspot/share/runtime/stubCodeGenerator.cpp +../../../src/hotspot/share/runtime/threadSMR.cpp +../../../src/hotspot/share/runtime/task.hpp +../../../src/hotspot/share/runtime/perfData.hpp +../../../src/hotspot/share/runtime/vframe_hp.hpp +../../../src/hotspot/share/runtime/stubRoutines.hpp +../../../src/hotspot/share/runtime/threadHeapSampler.hpp +../../../src/hotspot/share/runtime/vm_version.cpp +../../../src/hotspot/share/runtime/memprofiler.hpp +../../../src/hotspot/share/runtime/fieldType.hpp +../../../src/hotspot/share/runtime/safepointVerifiers.hpp +../../../src/hotspot/share/runtime/globals.cpp +../../../src/hotspot/share/runtime/threadStatisticalInfo.hpp +../../../src/hotspot/share/runtime/handshake.cpp +../../../src/hotspot/share/runtime/atomic.hpp +../../../src/hotspot/share/runtime/jniPeriodicChecker.cpp +../../../src/hotspot/share/runtime/deoptimization.hpp +../../../src/hotspot/share/runtime/perfMemory.cpp +../../../src/hotspot/share/runtime/interfaceSupport.inline.hpp +../../../src/hotspot/share/runtime/os_perf.hpp +../../../src/hotspot/share/runtime/globals_extension.hpp +../../../src/hotspot/share/runtime/threadSMR.inline.hpp +../../../src/hotspot/share/runtime/icache.hpp +../../../src/hotspot/share/runtime/reflection.hpp +../../../src/hotspot/share/runtime/javaCalls.hpp +../../../src/hotspot/share/runtime/rtmLocking.hpp +../../../src/hotspot/share/runtime/compilationPolicy.hpp +../../../src/hotspot/share/runtime/basicLock.cpp +../../../src/hotspot/share/runtime/java.cpp +../../../src/hotspot/share/runtime/simpleThresholdPolicy.hpp +../../../src/hotspot/share/runtime/perfData.inline.hpp +../../../src/hotspot/share/runtime/statSampler.hpp +../../../src/hotspot/share/runtime/vm_operations.cpp +../../../src/hotspot/share/runtime/mutexLocker.hpp +../../../src/hotspot/share/runtime/serviceThread.hpp +../../../src/hotspot/share/runtime/monitorChunk.cpp +../../../src/hotspot/share/runtime/stackValue.cpp +../../../src/hotspot/share/runtime/timer.hpp +../../../src/hotspot/share/runtime/vmThread.hpp +../../../src/hotspot/share/runtime/jfieldIDWorkaround.hpp +../../../src/hotspot/share/runtime/biasedLocking.hpp +../../../src/hotspot/share/runtime/registerMap.hpp +../../../src/hotspot/share/runtime/threadSMR.hpp +../../../src/hotspot/share/runtime/task.cpp +../../../src/hotspot/share/runtime/perfData.cpp +../../../src/hotspot/share/runtime/stubCodeGenerator.hpp +../../../src/hotspot/share/runtime/timerTrace.hpp +../../../src/hotspot/share/runtime/stubRoutines.cpp +../../../src/hotspot/share/runtime/interfaceSupport.cpp +../../../src/hotspot/share/runtime/vframe_hp.cpp +../../../src/hotspot/share/runtime/threadHeapSampler.cpp +../../../src/hotspot/share/runtime/vm_version.hpp +../../../src/hotspot/share/runtime/javaFrameAnchor.hpp +../../../src/hotspot/share/runtime/memprofiler.cpp +../../../src/hotspot/share/runtime/globals.hpp +../../../src/hotspot/share/runtime/safepointVerifiers.cpp +../../../src/hotspot/share/runtime/fieldType.cpp +../../../src/hotspot/share/runtime/deoptimization.cpp +../../../src/hotspot/share/runtime/jniPeriodicChecker.hpp +../../../src/hotspot/share/runtime/handshake.hpp +../../../src/hotspot/share/runtime/thread.inline.hpp +../../../src/hotspot/share/runtime/perfMemory.hpp +../../../src/hotspot/share/runtime/simpleThresholdPolicy.inline.hpp +../../../src/hotspot/share/runtime/javaCalls.cpp +../../../src/hotspot/share/runtime/reflection.cpp +../../../src/hotspot/share/runtime/icache.cpp +../../../src/hotspot/share/runtime/rtmLocking.cpp +../../../src/hotspot/share/runtime/stackValueCollection.hpp +../../../src/hotspot/share/runtime/safepointMechanism.cpp +../../../src/hotspot/share/runtime/semaphore.inline.hpp +../../../src/hotspot/share/runtime/vframe.hpp +../../../src/hotspot/share/runtime/synchronizer.hpp +../../../src/hotspot/share/runtime/fieldDescriptor.cpp +../../../src/hotspot/share/runtime/init.cpp +../../../src/hotspot/share/runtime/mutex.hpp +../../../src/hotspot/share/runtime/thread.hpp +../../../src/hotspot/share/runtime/jniHandles.hpp +../../../src/hotspot/share/runtime/safepoint.cpp +../../../src/hotspot/share/runtime/unhandledOops.cpp +../../../src/hotspot/share/runtime/rframe.cpp +../../../src/hotspot/share/runtime/safepointMechanism.inline.hpp +../../../src/hotspot/share/runtime/osThread.hpp +../../../src/hotspot/share/runtime/frame.inline.hpp +../../../src/hotspot/share/runtime/frame.hpp +../../../src/hotspot/share/runtime/os.hpp +../../../src/hotspot/share/runtime/vframeArray.hpp +../../../src/hotspot/share/runtime/vmStructs.cpp +../../../src/hotspot/share/runtime/signature.hpp +../../../src/hotspot/share/runtime/reflectionUtils.cpp +../../../src/hotspot/share/runtime/orderAccess.hpp +../../../src/hotspot/share/runtime/arguments.hpp +../../../src/hotspot/share/runtime/handles.cpp +../../../src/hotspot/share/runtime/objectMonitor.cpp +../../../src/hotspot/share/runtime/sharedRuntimeMath.hpp +../../../src/hotspot/share/runtime/sweeper.hpp +../../../src/hotspot/share/runtime/park.cpp +../../../src/hotspot/share/runtime/sharedRuntime.cpp +../../../src/hotspot/share/runtime/relocator.hpp +../../../src/hotspot/share/runtime/sharedRuntimeTrans.cpp +../../../src/hotspot/share/runtime/arguments_ext.hpp +../../../src/hotspot/share/libadt/set.cpp +../../../src/hotspot/share/libadt/vectset.hpp +../../../src/hotspot/share/libadt/dict.cpp +../../../src/hotspot/share/libadt/set.hpp +../../../src/hotspot/share/libadt/dict.hpp +../../../src/hotspot/share/libadt/vectset.cpp +../../../src/hotspot/share/code/codeCache.hpp +../../../src/hotspot/share/code/pcDesc.hpp +../../../src/hotspot/share/code/oopRecorder.cpp +../../../src/hotspot/share/code/dependencies.cpp +../../../src/hotspot/share/code/compiledMethod.inline.hpp +../../../src/hotspot/share/code/compressedStream.hpp +../../../src/hotspot/share/code/stubs.cpp +../../../src/hotspot/share/code/exceptionHandlerTable.hpp +../../../src/hotspot/share/code/nmethod.hpp +../../../src/hotspot/share/code/compiledMethod.hpp +../../../src/hotspot/share/code/compiledIC.cpp +../../../src/hotspot/share/code/codeBlob.cpp +../../../src/hotspot/share/code/codeHeapState.cpp +../../../src/hotspot/share/code/icBuffer.cpp +../../../src/hotspot/share/code/dependencyContext.hpp +../../../src/hotspot/share/code/debugInfo.hpp +../../../src/hotspot/share/code/vtableStubs.cpp +../../../src/hotspot/share/code/nativeInst.hpp +../../../src/hotspot/share/code/location.cpp +../../../src/hotspot/share/code/relocInfo.cpp +../../../src/hotspot/share/code/relocInfo_ext.hpp +../../../src/hotspot/share/code/vmreg.cpp +../../../src/hotspot/share/code/scopeDesc.hpp +../../../src/hotspot/share/code/debugInfoRec.hpp +../../../src/hotspot/share/code/codeHeapState.hpp +../../../src/hotspot/share/code/dependencyContext.cpp +../../../src/hotspot/share/code/icBuffer.hpp +../../../src/hotspot/share/code/debugInfo.cpp +../../../src/hotspot/share/code/vtableStubs.hpp +../../../src/hotspot/share/code/relocInfo.hpp +../../../src/hotspot/share/code/location.hpp +../../../src/hotspot/share/code/vmreg.inline.hpp +../../../src/hotspot/share/code/vmreg.hpp +../../../src/hotspot/share/code/relocInfo_ext.cpp +../../../src/hotspot/share/code/debugInfoRec.cpp +../../../src/hotspot/share/code/scopeDesc.cpp +../../../src/hotspot/share/code/codeCache.cpp +../../../src/hotspot/share/code/pcDesc.cpp +../../../src/hotspot/share/code/oopRecorder.hpp +../../../src/hotspot/share/code/dependencies.hpp +../../../src/hotspot/share/code/stubs.hpp +../../../src/hotspot/share/code/compressedStream.cpp +../../../src/hotspot/share/code/exceptionHandlerTable.cpp +../../../src/hotspot/share/code/nmethod.cpp +../../../src/hotspot/share/code/compiledMethod.cpp +../../../src/hotspot/share/code/compiledIC.hpp +../../../src/hotspot/share/code/codeBlob.hpp +../../../src/hotspot/share/prims/jvmtiImpl.hpp +../../../src/hotspot/share/prims/jvmtiTagMap.cpp +../../../src/hotspot/share/prims/jvmtiExport.hpp +../../../src/hotspot/share/prims/jvmtiEventController.inline.hpp +../../../src/hotspot/share/prims/whitebox.inline.hpp +../../../src/hotspot/share/prims/jvmtiTrace.cpp +../../../src/hotspot/share/prims/cdsoffsets.hpp +../../../src/hotspot/share/prims/jvmtiRawMonitor.cpp +../../../src/hotspot/share/prims/jvmtiExtensions.hpp +../../../src/hotspot/share/prims/jvmtiManageCapabilities.cpp +../../../src/hotspot/share/prims/jvmtiRedefineClasses.cpp +../../../src/hotspot/share/prims/nativeLookup.cpp +../../../src/hotspot/share/prims/perf.cpp +../../../src/hotspot/share/prims/jniCheck.cpp +../../../src/hotspot/share/prims/forte.cpp +../../../src/hotspot/share/prims/jvmtiEventController.hpp +../../../src/hotspot/share/prims/jvmtiEnvThreadState.hpp +../../../src/hotspot/share/prims/methodComparator.cpp +../../../src/hotspot/share/prims/jvmtiThreadState.inline.hpp +../../../src/hotspot/share/prims/resolvedMethodTable.hpp +../../../src/hotspot/share/prims/jvmtiClassFileReconstituter.hpp +../../../src/hotspot/share/prims/whitebox.cpp +../../../src/hotspot/share/prims/jvmtiGetLoadedClasses.hpp +../../../src/hotspot/share/prims/jvmtiAgentThread.hpp +../../../src/hotspot/share/prims/jvmtiCodeBlobEvents.cpp +../../../src/hotspot/share/prims/stackwalk.cpp +../../../src/hotspot/share/prims/privilegedStack.hpp +../../../src/hotspot/share/prims/jvmtiUtil.hpp +../../../src/hotspot/share/prims/jvmtiEnvBase.hpp +../../../src/hotspot/share/prims/jvmtiThreadState.cpp +../../../src/hotspot/share/prims/methodHandles.hpp +../../../src/hotspot/share/prims/jniFastGetField.hpp +../../../src/hotspot/share/prims/wbtestmethods/parserTests.cpp +../../../src/hotspot/share/prims/wbtestmethods/parserTests.hpp +../../../src/hotspot/share/prims/unsafe.cpp +../../../src/hotspot/share/prims/methodComparator.hpp +../../../src/hotspot/share/prims/jvmtiEnvThreadState.cpp +../../../src/hotspot/share/prims/resolvedMethodTable.cpp +../../../src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp +../../../src/hotspot/share/prims/evmCompat.cpp +../../../src/hotspot/share/prims/whitebox.hpp +../../../src/hotspot/share/prims/jvmtiEnter.inline.hpp +../../../src/hotspot/share/prims/jvmtiGetLoadedClasses.cpp +../../../src/hotspot/share/prims/stackwalk.hpp +../../../src/hotspot/share/prims/privilegedStack.cpp +../../../src/hotspot/share/prims/jvmtiCodeBlobEvents.hpp +../../../src/hotspot/share/prims/jvmtiUtil.cpp +../../../src/hotspot/share/prims/jvmtiEnvBase.cpp +../../../src/hotspot/share/prims/methodHandles.cpp +../../../src/hotspot/share/prims/jvmtiThreadState.hpp +../../../src/hotspot/share/prims/jniFastGetField.cpp +../../../src/hotspot/share/prims/jvm_misc.hpp +../../../src/hotspot/share/prims/unsafe.hpp +../../../src/hotspot/share/prims/jvmtiImpl.cpp +../../../src/hotspot/share/prims/jvmtiTagMap.hpp +../../../src/hotspot/share/prims/jvmtiExport.cpp +../../../src/hotspot/share/prims/jvmtiTrace.hpp +../../../src/hotspot/share/prims/cdsoffsets.cpp +../../../src/hotspot/share/prims/jvmtiRawMonitor.hpp +../../../src/hotspot/share/prims/jvmtiExtensions.cpp +../../../src/hotspot/share/prims/jniExport.hpp +../../../src/hotspot/share/prims/jvmtiManageCapabilities.hpp +../../../src/hotspot/share/prims/jvmtiRedefineClasses.hpp +../../../src/hotspot/share/prims/jni.cpp +../../../src/hotspot/share/prims/jvm.cpp +../../../src/hotspot/share/prims/jvmtiEnv.cpp +../../../src/hotspot/share/prims/nativeLookup.hpp +../../../src/hotspot/share/prims/jniCheck.hpp +../../../src/hotspot/share/prims/jvmtiEventController.cpp +../../../src/hotspot/share/prims/forte.hpp +../../../src/hotspot/share/classfile/sharedPathsMiscInfo.hpp +../../../src/hotspot/share/classfile/classLoaderStats.cpp +../../../src/hotspot/share/classfile/javaClasses.cpp +../../../src/hotspot/share/classfile/compactHashtable.hpp +../../../src/hotspot/share/classfile/metadataOnStackMark.cpp +../../../src/hotspot/share/classfile/classFileStream.hpp +../../../src/hotspot/share/classfile/klassFactory.cpp +../../../src/hotspot/share/classfile/moduleEntry.cpp +../../../src/hotspot/share/classfile/packageEntry.cpp +../../../src/hotspot/share/classfile/bytecodeAssembler.hpp +../../../src/hotspot/share/classfile/classListParser.hpp +../../../src/hotspot/share/classfile/javaClasses.inline.hpp +../../../src/hotspot/share/classfile/classLoaderExt.hpp +../../../src/hotspot/share/classfile/classLoader.hpp +../../../src/hotspot/share/classfile/dictionary.hpp +../../../src/hotspot/share/classfile/classLoaderData.inline.hpp +../../../src/hotspot/share/classfile/stringTable.cpp +../../../src/hotspot/share/classfile/stackMapFrame.hpp +../../../src/hotspot/share/classfile/altHashing.cpp +../../../src/hotspot/share/classfile/placeholders.cpp +../../../src/hotspot/share/classfile/defaultMethods.hpp +../../../src/hotspot/share/classfile/systemDictionaryShared.hpp +../../../src/hotspot/share/classfile/classLoader.inline.hpp +../../../src/hotspot/share/classfile/classFileError.cpp +../../../src/hotspot/share/classfile/javaAssertions.cpp +../../../src/hotspot/share/classfile/classFileParser.hpp +../../../src/hotspot/share/classfile/verifier.hpp +../../../src/hotspot/share/classfile/protectionDomainCache.hpp +../../../src/hotspot/share/classfile/dictionary.inline.hpp +../../../src/hotspot/share/classfile/stackMapTable.hpp +../../../src/hotspot/share/classfile/resolutionErrors.hpp +../../../src/hotspot/share/classfile/symbolTable.hpp +../../../src/hotspot/share/classfile/vmSymbols.hpp +../../../src/hotspot/share/classfile/compactHashtable.inline.hpp +../../../src/hotspot/share/classfile/modules.cpp +../../../src/hotspot/share/classfile/verificationType.cpp +../../../src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp +../../../src/hotspot/share/classfile/loaderConstraints.cpp +../../../src/hotspot/share/classfile/classLoaderData.cpp +../../../src/hotspot/share/classfile/systemDictionary.hpp +../../../src/hotspot/share/classfile/altHashing.hpp +../../../src/hotspot/share/classfile/stringTable.hpp +../../../src/hotspot/share/classfile/stackMapFrame.cpp +../../../src/hotspot/share/classfile/defaultMethods.cpp +../../../src/hotspot/share/classfile/placeholders.hpp +../../../src/hotspot/share/classfile/systemDictionaryShared.cpp +../../../src/hotspot/share/classfile/javaAssertions.hpp +../../../src/hotspot/share/classfile/protectionDomainCache.cpp +../../../src/hotspot/share/classfile/classFileParser.cpp +../../../src/hotspot/share/classfile/verifier.cpp +../../../src/hotspot/share/classfile/stackMapTable.cpp +../../../src/hotspot/share/classfile/vmSymbols.cpp +../../../src/hotspot/share/classfile/symbolTable.cpp +../../../src/hotspot/share/classfile/resolutionErrors.cpp +../../../src/hotspot/share/classfile/verificationType.hpp +../../../src/hotspot/share/classfile/modules.hpp +../../../src/hotspot/share/classfile/classLoaderHierarchyDCmd.hpp +../../../src/hotspot/share/classfile/loaderConstraints.hpp +../../../src/hotspot/share/classfile/classLoaderData.hpp +../../../src/hotspot/share/classfile/systemDictionary.cpp +../../../src/hotspot/share/classfile/sharedPathsMiscInfo.cpp +../../../src/hotspot/share/classfile/javaClasses.hpp +../../../src/hotspot/share/classfile/classLoaderStats.hpp +../../../src/hotspot/share/classfile/compactHashtable.cpp +../../../src/hotspot/share/classfile/metadataOnStackMark.hpp +../../../src/hotspot/share/classfile/classFileStream.cpp +../../../src/hotspot/share/classfile/moduleEntry.hpp +../../../src/hotspot/share/classfile/klassFactory.hpp +../../../src/hotspot/share/classfile/packageEntry.hpp +../../../src/hotspot/share/classfile/stackMapTableFormat.hpp +../../../src/hotspot/share/classfile/bytecodeAssembler.cpp +../../../src/hotspot/share/classfile/classListParser.cpp +../../../src/hotspot/share/classfile/classLoaderExt.cpp +../../../src/hotspot/share/classfile/classLoader.cpp +../../../src/hotspot/share/classfile/dictionary.cpp +../../../src/hotspot/share/utilities/numberSeq.hpp +../../../src/hotspot/share/utilities/exceptions.cpp +../../../src/hotspot/share/utilities/vmError.hpp +../../../src/hotspot/share/utilities/globalCounter.hpp +../../../src/hotspot/share/utilities/resourceHash.hpp +../../../src/hotspot/share/utilities/pair.hpp +../../../src/hotspot/share/utilities/constantTag.hpp +../../../src/hotspot/share/utilities/bitMap.inline.hpp +../../../src/hotspot/share/utilities/globalDefinitions_xlc.hpp +../../../src/hotspot/share/utilities/defaultStream.hpp +../../../src/hotspot/share/utilities/globalCounter.inline.hpp +../../../src/hotspot/share/utilities/intHisto.hpp +../../../src/hotspot/share/utilities/utf8.hpp +../../../src/hotspot/share/utilities/copy.cpp +../../../src/hotspot/share/utilities/globalDefinitions_visCPP.hpp +../../../src/hotspot/share/utilities/json.hpp +../../../src/hotspot/share/utilities/elfFuncDescTable.hpp +../../../src/hotspot/share/utilities/bitMap.cpp +../../../src/hotspot/share/utilities/count_trailing_zeros.hpp +../../../src/hotspot/share/utilities/quickSort.hpp +../../../src/hotspot/share/utilities/sizes.cpp +../../../src/hotspot/share/utilities/decoder_elf.cpp +../../../src/hotspot/share/utilities/concurrentHashTableTasks.inline.hpp +../../../src/hotspot/share/utilities/ostream.hpp +../../../src/hotspot/share/utilities/macros.hpp +../../../src/hotspot/share/utilities/elfFile.cpp +../../../src/hotspot/share/utilities/align.hpp +../../../src/hotspot/share/utilities/xmlstream.hpp +../../../src/hotspot/share/utilities/internalVMTests.cpp +../../../src/hotspot/share/utilities/preserveException.cpp +../../../src/hotspot/share/utilities/elfSymbolTable.hpp +../../../src/hotspot/share/utilities/spinYield.cpp +../../../src/hotspot/share/utilities/accessFlags.cpp +../../../src/hotspot/share/utilities/formatBuffer.cpp +../../../src/hotspot/share/utilities/errorReporter.hpp +../../../src/hotspot/share/utilities/globalDefinitions_sparcWorks.hpp +../../../src/hotspot/share/utilities/histogram.hpp +../../../src/hotspot/share/utilities/stringUtils.cpp +../../../src/hotspot/share/utilities/ticks.cpp +../../../src/hotspot/share/utilities/dtrace_disabled.hpp +../../../src/hotspot/share/utilities/debug.hpp +../../../src/hotspot/share/utilities/growableArray.cpp +../../../src/hotspot/share/utilities/globalDefinitions.hpp +../../../src/hotspot/share/utilities/nativeCallStack.hpp +../../../src/hotspot/share/utilities/hashtable.hpp +../../../src/hotspot/share/utilities/decoder.hpp +../../../src/hotspot/share/utilities/elfStringTable.cpp +../../../src/hotspot/share/utilities/events.hpp +../../../src/hotspot/share/utilities/ostream.cpp +../../../src/hotspot/share/utilities/elfFile.hpp +../../../src/hotspot/share/utilities/internalVMTests.hpp +../../../src/hotspot/share/utilities/fakeRttiSupport.hpp +../../../src/hotspot/share/utilities/xmlstream.cpp +../../../src/hotspot/share/utilities/elfSymbolTable.cpp +../../../src/hotspot/share/utilities/preserveException.hpp +../../../src/hotspot/share/utilities/accessFlags.hpp +../../../src/hotspot/share/utilities/spinYield.hpp +../../../src/hotspot/share/utilities/formatBuffer.hpp +../../../src/hotspot/share/utilities/errorReporter.cpp +../../../src/hotspot/share/utilities/breakpoint.hpp +../../../src/hotspot/share/utilities/histogram.cpp +../../../src/hotspot/share/utilities/ticks.hpp +../../../src/hotspot/share/utilities/stringUtils.hpp +../../../src/hotspot/share/utilities/growableArray.hpp +../../../src/hotspot/share/utilities/debug.cpp +../../../src/hotspot/share/utilities/globalDefinitions.cpp +../../../src/hotspot/share/utilities/bytes.hpp +../../../src/hotspot/share/utilities/stack.hpp +../../../src/hotspot/share/utilities/hashtable.cpp +../../../src/hotspot/share/utilities/nativeCallStack.cpp +../../../src/hotspot/share/utilities/events.cpp +../../../src/hotspot/share/utilities/decoder.cpp +../../../src/hotspot/share/utilities/elfStringTable.hpp +../../../src/hotspot/share/utilities/exceptions.hpp +../../../src/hotspot/share/utilities/globalDefinitions_gcc.hpp +../../../src/hotspot/share/utilities/dtrace.hpp +../../../src/hotspot/share/utilities/numberSeq.cpp +../../../src/hotspot/share/utilities/vmError.cpp +../../../src/hotspot/share/utilities/globalCounter.cpp +../../../src/hotspot/share/utilities/constantTag.cpp +../../../src/hotspot/share/utilities/stack.inline.hpp +../../../src/hotspot/share/utilities/hashtable.inline.hpp +../../../src/hotspot/share/utilities/concurrentHashTable.inline.hpp +../../../src/hotspot/share/utilities/intHisto.cpp +../../../src/hotspot/share/utilities/copy.hpp +../../../src/hotspot/share/utilities/utf8.cpp +../../../src/hotspot/share/utilities/json.cpp +../../../src/hotspot/share/utilities/concurrentHashTable.hpp +../../../src/hotspot/share/utilities/elfFuncDescTable.cpp +../../../src/hotspot/share/utilities/bitMap.hpp +../../../src/hotspot/share/utilities/decoder_elf.hpp +../../../src/hotspot/share/utilities/linkedlist.hpp +../../../src/hotspot/share/utilities/chunkedList.hpp +../../../src/hotspot/share/utilities/sizes.hpp +../../../src/hotspot/share/utilities/compilerWarnings.hpp +../../../src/hotspot/share/adlc/dict2.hpp +../../../src/hotspot/share/adlc/filebuff.cpp +../../../src/hotspot/share/adlc/formssel.hpp +../../../src/hotspot/share/adlc/adlc.hpp +../../../src/hotspot/share/adlc/forms.cpp +../../../src/hotspot/share/adlc/output_c.cpp +../../../src/hotspot/share/adlc/formsopt.cpp +../../../src/hotspot/share/adlc/dfa.cpp +../../../src/hotspot/share/adlc/archDesc.cpp +../../../src/hotspot/share/adlc/arena.cpp +../../../src/hotspot/share/adlc/adlparse.hpp +../../../src/hotspot/share/adlc/formsopt.hpp +../../../src/hotspot/share/adlc/archDesc.hpp +../../../src/hotspot/share/adlc/output_h.cpp +../../../src/hotspot/share/adlc/arena.hpp +../../../src/hotspot/share/adlc/adlparse.cpp +../../../src/hotspot/share/adlc/filebuff.hpp +../../../src/hotspot/share/adlc/dict2.cpp +../../../src/hotspot/share/adlc/formssel.cpp +../../../src/hotspot/share/adlc/main.cpp +../../../src/hotspot/share/adlc/forms.hpp +../../../src/hotspot/share/gc/parallel/vmPSOperations.cpp +../../../src/hotspot/share/gc/parallel/psGenerationCounters.hpp +../../../src/hotspot/share/gc/parallel/spaceCounters.hpp +../../../src/hotspot/share/gc/parallel/psPromotionManager.cpp +../../../src/hotspot/share/gc/parallel/parallelArguments.cpp +../../../src/hotspot/share/gc/parallel/psScavenge.cpp +../../../src/hotspot/share/gc/parallel/asPSOldGen.hpp +../../../src/hotspot/share/gc/parallel/psTasks.cpp +../../../src/hotspot/share/gc/parallel/jvmFlagConstraintsParallel.hpp +../../../src/hotspot/share/gc/parallel/gcAdaptivePolicyCounters.hpp +../../../src/hotspot/share/gc/parallel/psPromotionLAB.cpp +../../../src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp +../../../src/hotspot/share/gc/parallel/mutableNUMASpace.hpp +../../../src/hotspot/share/gc/parallel/pcTasks.hpp +../../../src/hotspot/share/gc/parallel/psMarkSweep.hpp +../../../src/hotspot/share/gc/parallel/psGCAdaptivePolicyCounters.cpp +../../../src/hotspot/share/gc/parallel/psMarkSweepDecorator.cpp +../../../src/hotspot/share/gc/parallel/psOldGen.hpp +../../../src/hotspot/share/gc/parallel/psPromotionLAB.inline.hpp +../../../src/hotspot/share/gc/parallel/generationSizer.cpp +../../../src/hotspot/share/gc/parallel/parMarkBitMap.inline.hpp +../../../src/hotspot/share/gc/parallel/asPSYoungGen.cpp +../../../src/hotspot/share/gc/parallel/psVirtualspace.hpp +../../../src/hotspot/share/gc/parallel/adjoiningVirtualSpaces.cpp +../../../src/hotspot/share/gc/parallel/vmStructs_parallelgc.hpp +../../../src/hotspot/share/gc/parallel/parallelScavengeHeap.hpp +../../../src/hotspot/share/gc/parallel/psCompactionManager.hpp +../../../src/hotspot/share/gc/parallel/gcTaskManager.cpp +../../../src/hotspot/share/gc/parallel/gcTaskThread.cpp +../../../src/hotspot/share/gc/parallel/immutableSpace.cpp +../../../src/hotspot/share/gc/parallel/psParallelCompact.hpp +../../../src/hotspot/share/gc/parallel/psParallelCompact.inline.hpp +../../../src/hotspot/share/gc/parallel/psYoungGen.cpp +../../../src/hotspot/share/gc/parallel/psMemoryPool.cpp +../../../src/hotspot/share/gc/parallel/mutableSpace.hpp +../../../src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.cpp +../../../src/hotspot/share/gc/parallel/psCardTable.hpp +../../../src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp +../../../src/hotspot/share/gc/parallel/adjoiningGenerations.cpp +../../../src/hotspot/share/gc/parallel/objectStartArray.hpp +../../../src/hotspot/share/gc/parallel/parMarkBitMap.cpp +../../../src/hotspot/share/gc/parallel/psMarkSweepProxy.hpp +../../../src/hotspot/share/gc/parallel/generationSizer.hpp +../../../src/hotspot/share/gc/parallel/asPSYoungGen.hpp +../../../src/hotspot/share/gc/parallel/psVirtualspace.cpp +../../../src/hotspot/share/gc/parallel/adjoiningVirtualSpaces.hpp +../../../src/hotspot/share/gc/parallel/gcTaskManager.hpp +../../../src/hotspot/share/gc/parallel/gcTaskThread.hpp +../../../src/hotspot/share/gc/parallel/psCompactionManager.cpp +../../../src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp +../../../src/hotspot/share/gc/parallel/psParallelCompact.cpp +../../../src/hotspot/share/gc/parallel/immutableSpace.hpp +../../../src/hotspot/share/gc/parallel/psScavenge.inline.hpp +../../../src/hotspot/share/gc/parallel/psMemoryPool.hpp +../../../src/hotspot/share/gc/parallel/psYoungGen.hpp +../../../src/hotspot/share/gc/parallel/mutableSpace.cpp +../../../src/hotspot/share/gc/parallel/psCardTable.cpp +../../../src/hotspot/share/gc/parallel/psAdaptiveSizePolicy.hpp +../../../src/hotspot/share/gc/parallel/adjoiningGenerations.hpp +../../../src/hotspot/share/gc/parallel/objectStartArray.cpp +../../../src/hotspot/share/gc/parallel/parMarkBitMap.hpp +../../../src/hotspot/share/gc/parallel/vmPSOperations.hpp +../../../src/hotspot/share/gc/parallel/parallelScavengeHeap.inline.hpp +../../../src/hotspot/share/gc/parallel/parallelArguments.hpp +../../../src/hotspot/share/gc/parallel/psPromotionManager.hpp +../../../src/hotspot/share/gc/parallel/spaceCounters.cpp +../../../src/hotspot/share/gc/parallel/psGenerationCounters.cpp +../../../src/hotspot/share/gc/parallel/psScavenge.hpp +../../../src/hotspot/share/gc/parallel/asPSOldGen.cpp +../../../src/hotspot/share/gc/parallel/psTasks.hpp +../../../src/hotspot/share/gc/parallel/jvmFlagConstraintsParallel.cpp +../../../src/hotspot/share/gc/parallel/gcAdaptivePolicyCounters.cpp +../../../src/hotspot/share/gc/parallel/objectStartArray.inline.hpp +../../../src/hotspot/share/gc/parallel/psPromotionLAB.hpp +../../../src/hotspot/share/gc/parallel/mutableNUMASpace.cpp +../../../src/hotspot/share/gc/parallel/pcTasks.cpp +../../../src/hotspot/share/gc/parallel/psMarkSweep.cpp +../../../src/hotspot/share/gc/parallel/parallel_globals.hpp +../../../src/hotspot/share/gc/parallel/psOldGen.cpp +../../../src/hotspot/share/gc/parallel/psGCAdaptivePolicyCounters.hpp +../../../src/hotspot/share/gc/parallel/psMarkSweepDecorator.hpp +../../../src/hotspot/share/gc/g1/heapRegionManager.cpp +../../../src/hotspot/share/gc/g1/g1StringDedupQueue.hpp +../../../src/hotspot/share/gc/g1/g1RemSetSummary.hpp +../../../src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp +../../../src/hotspot/share/gc/g1/g1Predictions.hpp +../../../src/hotspot/share/gc/g1/g1FullCollector.cpp +../../../src/hotspot/share/gc/g1/g1InCSetState.hpp +../../../src/hotspot/share/gc/g1/g1RegionMarkStatsCache.inline.hpp +../../../src/hotspot/share/gc/g1/g1ConcurrentMarkThread.inline.hpp +../../../src/hotspot/share/gc/g1/g1CollectionSet.hpp +../../../src/hotspot/share/gc/g1/g1BarrierSet.cpp +../../../src/hotspot/share/gc/g1/heapRegionTracer.hpp +../../../src/hotspot/share/gc/g1/g1Arguments.cpp +../../../src/hotspot/share/gc/g1/g1BlockOffsetTable.hpp +../../../src/hotspot/share/gc/g1/heapRegion.inline.hpp +../../../src/hotspot/share/gc/g1/g1ConcurrentMarkBitMap.cpp +../../../src/hotspot/share/gc/g1/g1FullGCCompactionPoint.cpp +../../../src/hotspot/share/gc/g1/g1IHOPControl.cpp +../../../src/hotspot/share/gc/g1/sparsePRT.hpp +../../../src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.cpp +../../../src/hotspot/share/gc/g1/g1HotCardCache.hpp +../../../src/hotspot/share/gc/g1/survRateGroup.cpp +../../../src/hotspot/share/gc/g1/g1FullGCPrepareTask.hpp +../../../src/hotspot/share/gc/g1/g1CollectorState.hpp +../../../src/hotspot/share/gc/g1/vm_operations_g1.cpp +../../../src/hotspot/share/gc/g1/g1RootClosures.cpp +../../../src/hotspot/share/gc/g1/dirtyCardQueue.cpp +../../../src/hotspot/share/gc/g1/g1RegionToSpaceMapper.hpp +../../../src/hotspot/share/gc/g1/g1SharedClosures.hpp +../../../src/hotspot/share/gc/g1/g1CardCounts.hpp +../../../src/hotspot/share/gc/g1/g1EvacFailure.hpp +../../../src/hotspot/share/gc/g1/heapRegionBounds.hpp +../../../src/hotspot/share/gc/g1/satbMarkQueue.hpp +../../../src/hotspot/share/gc/g1/g1HeapRegionEventSender.cpp +../../../src/hotspot/share/gc/g1/g1ConcurrentMark.hpp +../../../src/hotspot/share/gc/g1/g1Policy.hpp +../../../src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp +../../../src/hotspot/share/gc/g1/g1HeapVerifier.cpp +../../../src/hotspot/share/gc/g1/g1BarrierSetRuntime.hpp +../../../src/hotspot/share/gc/g1/g1ConcurrentMarkThread.cpp +../../../src/hotspot/share/gc/g1/g1StringDedupStat.hpp +../../../src/hotspot/share/gc/g1/g1RootProcessor.cpp +../../../src/hotspot/share/gc/g1/g1FullGCCompactTask.cpp +../../../src/hotspot/share/gc/g1/g1BarrierSetAssembler.hpp +../../../src/hotspot/share/gc/g1/g1FullGCOopClosures.hpp +../../../src/hotspot/share/gc/g1/g1CollectedHeap.hpp +../../../src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp +../../../src/hotspot/share/gc/g1/heapRegionBounds.inline.hpp +../../../src/hotspot/share/gc/g1/g1CodeBlobClosure.hpp +../../../src/hotspot/share/gc/g1/heapRegionType.hpp +../../../src/hotspot/share/gc/g1/g1BarrierSet.inline.hpp +../../../src/hotspot/share/gc/g1/g1MMUTracker.cpp +../../../src/hotspot/share/gc/g1/g1AllocRegion.hpp +../../../src/hotspot/share/gc/g1/g1AllocRegion.inline.hpp +../../../src/hotspot/share/gc/g1/g1MemoryPool.cpp +../../../src/hotspot/share/gc/g1/g1EvacStats.hpp +../../../src/hotspot/share/gc/g1/g1HeapTransition.hpp +../../../src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp +../../../src/hotspot/share/gc/g1/collectionSetChooser.cpp +../../../src/hotspot/share/gc/g1/g1ParScanThreadState.hpp +../../../src/hotspot/share/gc/g1/g1Analytics.cpp +../../../src/hotspot/share/gc/g1/g1FullGCMarkTask.hpp +../../../src/hotspot/share/gc/g1/g1CodeCacheRemSet.hpp +../../../src/hotspot/share/gc/g1/g1FullGCOopClosures.inline.hpp +../../../src/hotspot/share/gc/g1/g1ConcurrentRefineThread.cpp +../../../src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp +../../../src/hotspot/share/gc/g1/c1/g1BarrierSetC1.hpp +../../../src/hotspot/share/gc/g1/g1FullGCMarker.hpp +../../../src/hotspot/share/gc/g1/g1CodeRootSetTable.hpp +../../../src/hotspot/share/gc/g1/g1FullGCReferenceProcessorExecutor.hpp +../../../src/hotspot/share/gc/g1/g1CardTable.cpp +../../../src/hotspot/share/gc/g1/g1RegionMarkStatsCache.cpp +../../../src/hotspot/share/gc/g1/g1FromCardCache.cpp +../../../src/hotspot/share/gc/g1/g1Allocator.hpp +../../../src/hotspot/share/gc/g1/g1RemSet.cpp +../../../src/hotspot/share/gc/g1/g1ThreadLocalData.hpp +../../../src/hotspot/share/gc/g1/g1FullGCTask.hpp +../../../src/hotspot/share/gc/g1/g1SurvivorRegions.cpp +../../../src/hotspot/share/gc/g1/ptrQueue.hpp +../../../src/hotspot/share/gc/g1/g1YoungGenSizer.cpp +../../../src/hotspot/share/gc/g1/g1HeapSizingPolicy.cpp +../../../src/hotspot/share/gc/g1/g1StringDedup.cpp +../../../src/hotspot/share/gc/g1/heapRegion.cpp +../../../src/hotspot/share/gc/g1/g1BiasedArray.hpp +../../../src/hotspot/share/gc/g1/g1FullGCScope.hpp +../../../src/hotspot/share/gc/g1/g1MonitoringSupport.hpp +../../../src/hotspot/share/gc/g1/heapRegionRemSet.cpp +../../../src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp +../../../src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp +../../../src/hotspot/share/gc/g1/g1CollectorPolicy.cpp +../../../src/hotspot/share/gc/g1/g1OopClosures.cpp +../../../src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.hpp +../../../src/hotspot/share/gc/g1/jvmFlagConstraintsG1.cpp +../../../src/hotspot/share/gc/g1/g1OopClosures.inline.hpp +../../../src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.hpp +../../../src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.hpp +../../../src/hotspot/share/gc/g1/heapRegionSet.cpp +../../../src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp +../../../src/hotspot/share/gc/g1/g1CodeBlobClosure.cpp +../../../src/hotspot/share/gc/g1/g1CollectedHeap.cpp +../../../src/hotspot/share/gc/g1/heapRegionType.cpp +../../../src/hotspot/share/gc/g1/g1Allocator.inline.hpp +../../../src/hotspot/share/gc/g1/g1FullGCCompactTask.hpp +../../../src/hotspot/share/gc/g1/g1RootProcessor.hpp +../../../src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp +../../../src/hotspot/share/gc/g1/g1AllocRegion.cpp +../../../src/hotspot/share/gc/g1/g1MMUTracker.hpp +../../../src/hotspot/share/gc/g1/g1MemoryPool.hpp +../../../src/hotspot/share/gc/g1/g1EvacStats.cpp +../../../src/hotspot/share/gc/g1/g1FullGCAdjustTask.hpp +../../../src/hotspot/share/gc/g1/g1HeapTransition.cpp +../../../src/hotspot/share/gc/g1/collectionSetChooser.hpp +../../../src/hotspot/share/gc/g1/g1HeapRegionTraceType.hpp +../../../src/hotspot/share/gc/g1/g1Analytics.hpp +../../../src/hotspot/share/gc/g1/g1ParScanThreadState.cpp +../../../src/hotspot/share/gc/g1/g1YCTypes.hpp +../../../src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp +../../../src/hotspot/share/gc/g1/g1CodeCacheRemSet.cpp +../../../src/hotspot/share/gc/g1/g1FullGCMarker.cpp +../../../src/hotspot/share/gc/g1/heapRegionSet.inline.hpp +../../../src/hotspot/share/gc/g1/g1ConcurrentRefineThread.hpp +../../../src/hotspot/share/gc/g1/g1FullGCReferenceProcessorExecutor.cpp +../../../src/hotspot/share/gc/g1/g1FromCardCache.hpp +../../../src/hotspot/share/gc/g1/g1ConcurrentMarkBitMap.inline.hpp +../../../src/hotspot/share/gc/g1/g1CardTable.hpp +../../../src/hotspot/share/gc/g1/g1RegionMarkStatsCache.hpp +../../../src/hotspot/share/gc/g1/g1RemSet.hpp +../../../src/hotspot/share/gc/g1/g1FullGCTask.cpp +../../../src/hotspot/share/gc/g1/g1CardTable.inline.hpp +../../../src/hotspot/share/gc/g1/g1SurvivorRegions.hpp +../../../src/hotspot/share/gc/g1/vmStructs_g1.hpp +../../../src/hotspot/share/gc/g1/g1Allocator.cpp +../../../src/hotspot/share/gc/g1/g1StringDedup.hpp +../../../src/hotspot/share/gc/g1/g1YoungGenSizer.hpp +../../../src/hotspot/share/gc/g1/ptrQueue.cpp +../../../src/hotspot/share/gc/g1/g1HeapSizingPolicy.hpp +../../../src/hotspot/share/gc/g1/heapRegionRemSet.hpp +../../../src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp +../../../src/hotspot/share/gc/g1/g1ConcurrentRefine.hpp +../../../src/hotspot/share/gc/g1/g1FullGCScope.cpp +../../../src/hotspot/share/gc/g1/heapRegion.hpp +../../../src/hotspot/share/gc/g1/g1BiasedArray.cpp +../../../src/hotspot/share/gc/g1/g1MonitoringSupport.cpp +../../../src/hotspot/share/gc/g1/g1OopClosures.hpp +../../../src/hotspot/share/gc/g1/g1CollectorPolicy.hpp +../../../src/hotspot/share/gc/g1/g1ConcurrentMarkObjArrayProcessor.cpp +../../../src/hotspot/share/gc/g1/g1_globals.hpp +../../../src/hotspot/share/gc/g1/jvmFlagConstraintsG1.hpp +../../../src/hotspot/share/gc/g1/heapRegionSet.hpp +../../../src/hotspot/share/gc/g1/g1PageBasedVirtualSpace.cpp +../../../src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp +../../../src/hotspot/share/gc/g1/g1HeapSizingPolicy_ext.cpp +../../../src/hotspot/share/gc/g1/g1StringDedupQueue.cpp +../../../src/hotspot/share/gc/g1/g1RemSetSummary.cpp +../../../src/hotspot/share/gc/g1/heapRegionManager.hpp +../../../src/hotspot/share/gc/g1/g1EdenRegions.hpp +../../../src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp +../../../src/hotspot/share/gc/g1/g1FullCollector.hpp +../../../src/hotspot/share/gc/g1/g1BlockOffsetTable.inline.hpp +../../../src/hotspot/share/gc/g1/g1BarrierSet.hpp +../../../src/hotspot/share/gc/g1/g1CollectionSet.cpp +../../../src/hotspot/share/gc/g1/evacuationInfo.hpp +../../../src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp +../../../src/hotspot/share/gc/g1/c2/g1BarrierSetC2.hpp +../../../src/hotspot/share/gc/g1/heapRegionTracer.cpp +../../../src/hotspot/share/gc/g1/g1Arguments.hpp +../../../src/hotspot/share/gc/g1/g1FullGCCompactionPoint.hpp +../../../src/hotspot/share/gc/g1/sparsePRT.cpp +../../../src/hotspot/share/gc/g1/g1IHOPControl.hpp +../../../src/hotspot/share/gc/g1/g1BlockOffsetTable.cpp +../../../src/hotspot/share/gc/g1/g1ConcurrentMarkBitMap.hpp +../../../src/hotspot/share/gc/g1/g1HotCardCache.cpp +../../../src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.hpp +../../../src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp +../../../src/hotspot/share/gc/g1/survRateGroup.hpp +../../../src/hotspot/share/gc/g1/g1EvacStats.inline.hpp +../../../src/hotspot/share/gc/g1/dirtyCardQueue.hpp +../../../src/hotspot/share/gc/g1/g1RootClosures.hpp +../../../src/hotspot/share/gc/g1/g1HRPrinter.hpp +../../../src/hotspot/share/gc/g1/vm_operations_g1.hpp +../../../src/hotspot/share/gc/g1/g1RegionToSpaceMapper.cpp +../../../src/hotspot/share/gc/g1/heapRegionManager.inline.hpp +../../../src/hotspot/share/gc/g1/satbMarkQueue.cpp +../../../src/hotspot/share/gc/g1/g1HeapRegionEventSender.hpp +../../../src/hotspot/share/gc/g1/g1CardCounts.cpp +../../../src/hotspot/share/gc/g1/g1EvacFailure.cpp +../../../src/hotspot/share/gc/g1/g1InitialMarkToMixedTimeTracker.hpp +../../../src/hotspot/share/gc/g1/g1HeapVerifier.hpp +../../../src/hotspot/share/gc/g1/g1Policy.cpp +../../../src/hotspot/share/gc/g1/g1ConcurrentMark.cpp +../../../src/hotspot/share/gc/g1/g1StringDedupStat.cpp +../../../src/hotspot/share/gc/g1/g1BarrierSetRuntime.cpp +../../../src/hotspot/share/gc/g1/g1ConcurrentMarkThread.hpp +../../../src/hotspot/share/gc/epsilon/epsilonMemoryPool.cpp +../../../src/hotspot/share/gc/epsilon/epsilonArguments.hpp +../../../src/hotspot/share/gc/epsilon/epsilonCollectorPolicy.hpp +../../../src/hotspot/share/gc/epsilon/epsilonHeap.cpp +../../../src/hotspot/share/gc/epsilon/vmStructs_epsilon.hpp +../../../src/hotspot/share/gc/epsilon/epsilonBarrierSet.cpp +../../../src/hotspot/share/gc/epsilon/epsilonMonitoringSupport.cpp +../../../src/hotspot/share/gc/epsilon/epsilonBarrierSet.hpp +../../../src/hotspot/share/gc/epsilon/epsilon_globals.hpp +../../../src/hotspot/share/gc/epsilon/epsilonMonitoringSupport.hpp +../../../src/hotspot/share/gc/epsilon/epsilonMemoryPool.hpp +../../../src/hotspot/share/gc/epsilon/epsilonArguments.cpp +../../../src/hotspot/share/gc/epsilon/epsilonHeap.hpp +../../../src/hotspot/share/gc/epsilon/epsilonThreadLocalData.hpp +../../../src/hotspot/share/gc/z/zMetronome.cpp +../../../src/hotspot/share/gc/z/zHeap.cpp +../../../src/hotspot/share/gc/z/zHash.inline.hpp +../../../src/hotspot/share/gc/z/zValue.hpp +../../../src/hotspot/share/gc/z/zLock.inline.hpp +../../../src/hotspot/share/gc/z/zRelocationSetSelector.cpp +../../../src/hotspot/share/gc/z/zCollectorPolicy.hpp +../../../src/hotspot/share/gc/z/zAddress.hpp +../../../src/hotspot/share/gc/z/zArguments.cpp +../../../src/hotspot/share/gc/z/zTask.hpp +../../../src/hotspot/share/gc/z/zVirtualMemory.cpp +../../../src/hotspot/share/gc/z/zResurrection.cpp +../../../src/hotspot/share/gc/z/zDirector.hpp +../../../src/hotspot/share/gc/z/zList.hpp +../../../src/hotspot/share/gc/z/zErrno.hpp +../../../src/hotspot/share/gc/z/zBarrier.inline.hpp +../../../src/hotspot/share/gc/z/zFuture.hpp +../../../src/hotspot/share/gc/z/zReferenceProcessor.hpp +../../../src/hotspot/share/gc/z/zLargePages.cpp +../../../src/hotspot/share/gc/z/zFuture.inline.hpp +../../../src/hotspot/share/gc/z/zForwardingTable.cpp +../../../src/hotspot/share/gc/z/zMarkStack.cpp +../../../src/hotspot/share/gc/z/zForwardingTable.inline.hpp +../../../src/hotspot/share/gc/z/zWorkers.hpp +../../../src/hotspot/share/gc/z/zLiveMap.cpp +../../../src/hotspot/share/gc/z/zMemory.cpp +../../../src/hotspot/share/gc/z/zOopClosures.inline.hpp +../../../src/hotspot/share/gc/z/zNUMA.hpp +../../../src/hotspot/share/gc/z/zRootsIterator.hpp +../../../src/hotspot/share/gc/z/zGlobals.cpp +../../../src/hotspot/share/gc/z/zVirtualMemory.inline.hpp +../../../src/hotspot/share/gc/z/zRelocationSet.hpp +../../../src/hotspot/share/gc/z/zArray.hpp +../../../src/hotspot/share/gc/z/zResurrection.inline.hpp +../../../src/hotspot/share/gc/z/zMemory.inline.hpp +../../../src/hotspot/share/gc/z/zHeapIterator.cpp +../../../src/hotspot/share/gc/z/zInitialize.cpp +../../../src/hotspot/share/gc/z/zMarkCache.hpp +../../../src/hotspot/share/gc/z/zPageCache.hpp +../../../src/hotspot/share/gc/z/zTracer.hpp +../../../src/hotspot/share/gc/z/zThread.cpp +../../../src/hotspot/share/gc/z/zRelocate.hpp +../../../src/hotspot/share/gc/z/zPhysicalMemory.inline.hpp +../../../src/hotspot/share/gc/z/zStat.cpp +../../../src/hotspot/share/gc/z/z_globals.hpp +../../../src/hotspot/share/gc/z/zBarrierSet.hpp +../../../src/hotspot/share/gc/z/zLock.hpp +../../../src/hotspot/share/gc/z/zBarrier.hpp +../../../src/hotspot/share/gc/z/zPhysicalMemory.hpp +../../../src/hotspot/share/gc/z/zDriver.hpp +../../../src/hotspot/share/gc/z/zWeakRootsProcessor.cpp +../../../src/hotspot/share/gc/z/zMessagePort.hpp +../../../src/hotspot/share/gc/z/zPageTable.cpp +../../../src/hotspot/share/gc/z/zCollectedHeap.hpp +../../../src/hotspot/share/gc/z/zRuntimeWorkers.hpp +../../../src/hotspot/share/gc/z/c1/zBarrierSetC1.hpp +../../../src/hotspot/share/gc/z/c1/zBarrierSetC1.cpp +../../../src/hotspot/share/gc/z/zAddress.inline.hpp +../../../src/hotspot/share/gc/z/zMark.cpp +../../../src/hotspot/share/gc/z/vmStructs_z.cpp +../../../src/hotspot/share/gc/z/zPreMappedMemory.inline.hpp +../../../src/hotspot/share/gc/z/zOopClosures.cpp +../../../src/hotspot/share/gc/z/zAllocationFlags.hpp +../../../src/hotspot/share/gc/z/zPageTable.inline.hpp +../../../src/hotspot/share/gc/z/zServiceability.cpp +../../../src/hotspot/share/gc/z/zLargePages.inline.hpp +../../../src/hotspot/share/gc/z/zPageAllocator.cpp +../../../src/hotspot/share/gc/z/zBarrierSetAssembler.hpp +../../../src/hotspot/share/gc/z/zPreMappedMemory.cpp +../../../src/hotspot/share/gc/z/zPageCache.inline.hpp +../../../src/hotspot/share/gc/z/zBarrierSetRuntime.cpp +../../../src/hotspot/share/gc/z/zPage.cpp +../../../src/hotspot/share/gc/z/zUtils.cpp +../../../src/hotspot/share/gc/z/zObjectAllocator.hpp +../../../src/hotspot/share/gc/z/zHash.hpp +../../../src/hotspot/share/gc/z/zNMethodTable.cpp +../../../src/hotspot/share/gc/z/zPageTableEntry.hpp +../../../src/hotspot/share/gc/z/zCPU.hpp +../../../src/hotspot/share/gc/z/zBitMap.inline.hpp +../../../src/hotspot/share/gc/z/zStat.hpp +../../../src/hotspot/share/gc/z/zBarrierSet.cpp +../../../src/hotspot/share/gc/z/zBarrier.cpp +../../../src/hotspot/share/gc/z/zHeap.inline.hpp +../../../src/hotspot/share/gc/z/zDriver.cpp +../../../src/hotspot/share/gc/z/zMessagePort.inline.hpp +../../../src/hotspot/share/gc/z/zPhysicalMemory.cpp +../../../src/hotspot/share/gc/z/zPageTable.hpp +../../../src/hotspot/share/gc/z/zRelocationSet.inline.hpp +../../../src/hotspot/share/gc/z/zPage.inline.hpp +../../../src/hotspot/share/gc/z/zUtils.inline.hpp +../../../src/hotspot/share/gc/z/zMarkTerminate.hpp +../../../src/hotspot/share/gc/z/zWeakRootsProcessor.hpp +../../../src/hotspot/share/gc/z/zCollectedHeap.cpp +../../../src/hotspot/share/gc/z/zRuntimeWorkers.cpp +../../../src/hotspot/share/gc/z/zArray.inline.hpp +../../../src/hotspot/share/gc/z/zBitField.hpp +../../../src/hotspot/share/gc/z/zAddressRangeMap.hpp +../../../src/hotspot/share/gc/z/zMarkStackEntry.hpp +../../../src/hotspot/share/gc/z/vmStructs_z.hpp +../../../src/hotspot/share/gc/z/zMarkStack.inline.hpp +../../../src/hotspot/share/gc/z/zMark.hpp +../../../src/hotspot/share/gc/z/zOopClosures.hpp +../../../src/hotspot/share/gc/z/zTracer.inline.hpp +../../../src/hotspot/share/gc/z/zBarrierSetAssembler.cpp +../../../src/hotspot/share/gc/z/zPageAllocator.hpp +../../../src/hotspot/share/gc/z/zServiceability.hpp +../../../src/hotspot/share/gc/z/zPreMappedMemory.hpp +../../../src/hotspot/share/gc/z/zMark.inline.hpp +../../../src/hotspot/share/gc/z/zBarrierSetRuntime.hpp +../../../src/hotspot/share/gc/z/zAddressRangeMap.inline.hpp +../../../src/hotspot/share/gc/z/zOop.inline.hpp +../../../src/hotspot/share/gc/z/zUtils.hpp +../../../src/hotspot/share/gc/z/zPage.hpp +../../../src/hotspot/share/gc/z/zObjectAllocator.cpp +../../../src/hotspot/share/gc/z/zCPU.cpp +../../../src/hotspot/share/gc/z/zNMethodTable.hpp +../../../src/hotspot/share/gc/z/zMetronome.hpp +../../../src/hotspot/share/gc/z/zHeap.hpp +../../../src/hotspot/share/gc/z/zLiveMap.inline.hpp +../../../src/hotspot/share/gc/z/zCollectorPolicy.cpp +../../../src/hotspot/share/gc/z/zRelocationSetSelector.hpp +../../../src/hotspot/share/gc/z/zWorkers.inline.hpp +../../../src/hotspot/share/gc/z/zArguments.hpp +../../../src/hotspot/share/gc/z/zForwardingTableEntry.hpp +../../../src/hotspot/share/gc/z/zTask.cpp +../../../src/hotspot/share/gc/z/zAddress.cpp +../../../src/hotspot/share/gc/z/zErrno.cpp +../../../src/hotspot/share/gc/z/zBarrierSet.inline.hpp +../../../src/hotspot/share/gc/z/zResurrection.hpp +../../../src/hotspot/share/gc/z/zVirtualMemory.hpp +../../../src/hotspot/share/gc/z/zDirector.cpp +../../../src/hotspot/share/gc/z/zNMethodTableEntry.hpp +../../../src/hotspot/share/gc/z/zList.inline.hpp +../../../src/hotspot/share/gc/z/zReferenceProcessor.cpp +../../../src/hotspot/share/gc/z/zLargePages.hpp +../../../src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp +../../../src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp +../../../src/hotspot/share/gc/z/zMarkStack.hpp +../../../src/hotspot/share/gc/z/zThreadLocalData.hpp +../../../src/hotspot/share/gc/z/zBitMap.hpp +../../../src/hotspot/share/gc/z/zForwardingTable.hpp +../../../src/hotspot/share/gc/z/zMarkCache.inline.hpp +../../../src/hotspot/share/gc/z/zWorkers.cpp +../../../src/hotspot/share/gc/z/zRootsIterator.cpp +../../../src/hotspot/share/gc/z/zNUMA.cpp +../../../src/hotspot/share/gc/z/zGlobals.hpp +../../../src/hotspot/share/gc/z/zMemory.hpp +../../../src/hotspot/share/gc/z/zLiveMap.hpp +../../../src/hotspot/share/gc/z/zRelocationSet.cpp +../../../src/hotspot/share/gc/z/zMarkTerminate.inline.hpp +../../../src/hotspot/share/gc/z/zInitialize.hpp +../../../src/hotspot/share/gc/z/zHeapIterator.hpp +../../../src/hotspot/share/gc/z/zThread.hpp +../../../src/hotspot/share/gc/z/zTracer.cpp +../../../src/hotspot/share/gc/z/zMarkCache.cpp +../../../src/hotspot/share/gc/z/zPageCache.cpp +../../../src/hotspot/share/gc/z/zRelocate.cpp +../../../src/hotspot/share/gc/z/zOop.hpp +../../../src/hotspot/share/gc/shared/gcCause.cpp +../../../src/hotspot/share/gc/shared/oopStorageParState.hpp +../../../src/hotspot/share/gc/shared/referenceProcessorStats.hpp +../../../src/hotspot/share/gc/shared/plab.hpp +../../../src/hotspot/share/gc/shared/gcConfiguration.cpp +../../../src/hotspot/share/gc/shared/spaceDecorator.cpp +../../../src/hotspot/share/gc/shared/gcPolicyCounters.hpp +../../../src/hotspot/share/gc/shared/allocTracer.cpp +../../../src/hotspot/share/gc/shared/gcTraceTime.inline.hpp +../../../src/hotspot/share/gc/shared/adaptiveSizePolicy.cpp +../../../src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp +../../../src/hotspot/share/gc/shared/collectedHeap.cpp +../../../src/hotspot/share/gc/shared/barrierSetConfig.inline.hpp +../../../src/hotspot/share/gc/shared/collectedHeap.inline.hpp +../../../src/hotspot/share/gc/shared/ageTable.hpp +../../../src/hotspot/share/gc/shared/blockOffsetTable.cpp +../../../src/hotspot/share/gc/shared/hSpaceCounters.hpp +../../../src/hotspot/share/gc/shared/space.inline.hpp +../../../src/hotspot/share/gc/shared/collectorCounters.hpp +../../../src/hotspot/share/gc/shared/referenceProcessor.cpp +../../../src/hotspot/share/gc/shared/accessBarrierSupport.cpp +../../../src/hotspot/share/gc/shared/oopStorage.inline.hpp +../../../src/hotspot/share/gc/shared/taskqueue.hpp +../../../src/hotspot/share/gc/shared/gcTraceTime.hpp +../../../src/hotspot/share/gc/shared/gcThreadLocalData.hpp +../../../src/hotspot/share/gc/shared/gcTraceSend.cpp +../../../src/hotspot/share/gc/shared/weakProcessor.cpp +../../../src/hotspot/share/gc/shared/space.hpp +../../../src/hotspot/share/gc/shared/cardTableRS.hpp +../../../src/hotspot/share/gc/shared/objectCountEventSender.hpp +../../../src/hotspot/share/gc/shared/generationSpec.cpp +../../../src/hotspot/share/gc/shared/cardGeneration.hpp +../../../src/hotspot/share/gc/shared/vmGCOperations.cpp +../../../src/hotspot/share/gc/shared/softRefGenPolicy.cpp +../../../src/hotspot/share/gc/shared/jvmFlagConstraintsGC.cpp +../../../src/hotspot/share/gc/shared/gcArguments.hpp +../../../src/hotspot/share/gc/shared/workerDataArray.hpp +../../../src/hotspot/share/gc/shared/suspendibleThreadSet.hpp +../../../src/hotspot/share/gc/shared/collectorPolicy.cpp +../../../src/hotspot/share/gc/shared/barrierSet.hpp +../../../src/hotspot/share/gc/shared/genMemoryPools.hpp +../../../src/hotspot/share/gc/shared/ageTableTracer.hpp +../../../src/hotspot/share/gc/shared/workerDataArray.inline.hpp +../../../src/hotspot/share/gc/shared/concurrentGCThread.hpp +../../../src/hotspot/share/gc/shared/plab.inline.hpp +../../../src/hotspot/share/gc/shared/cardTable.cpp +../../../src/hotspot/share/gc/shared/softRefPolicy.cpp +../../../src/hotspot/share/gc/shared/genCollectedHeap.cpp +../../../src/hotspot/share/gc/shared/gcLocker.hpp +../../../src/hotspot/share/gc/shared/referenceProcessor.inline.hpp +../../../src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp +../../../src/hotspot/share/gc/shared/preservedMarks.inline.hpp +../../../src/hotspot/share/gc/shared/c1/barrierSetC1.hpp +../../../src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.hpp +../../../src/hotspot/share/gc/shared/c1/modRefBarrierSetC1.cpp +../../../src/hotspot/share/gc/shared/c1/barrierSetC1.cpp +../../../src/hotspot/share/gc/shared/c1/modRefBarrierSetC1.hpp +../../../src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.cpp +../../../src/hotspot/share/gc/shared/cardTableBarrierSet.hpp +../../../src/hotspot/share/gc/shared/oopStorage.hpp +../../../src/hotspot/share/gc/shared/gcConfig.cpp +../../../src/hotspot/share/gc/shared/barrierSetAssembler.hpp +../../../src/hotspot/share/gc/shared/modRefBarrierSet.hpp +../../../src/hotspot/share/gc/shared/memAllocator.cpp +../../../src/hotspot/share/gc/shared/referencePolicy.hpp +../../../src/hotspot/share/gc/shared/gcTrace.hpp +../../../src/hotspot/share/gc/shared/generationCounters.hpp +../../../src/hotspot/share/gc/shared/strongRootsScope.hpp +../../../src/hotspot/share/gc/shared/gcUtil.cpp +../../../src/hotspot/share/gc/shared/generation.hpp +../../../src/hotspot/share/gc/shared/concurrentGCPhaseManager.hpp +../../../src/hotspot/share/gc/shared/gcId.cpp +../../../src/hotspot/share/gc/shared/gcStats.hpp +../../../src/hotspot/share/gc/shared/workgroup.cpp +../../../src/hotspot/share/gc/shared/gcTimer.hpp +../../../src/hotspot/share/gc/shared/preservedMarks.cpp +../../../src/hotspot/share/gc/shared/referenceDiscoverer.hpp +../../../src/hotspot/share/gc/shared/cardGeneration.cpp +../../../src/hotspot/share/gc/shared/generationSpec.hpp +../../../src/hotspot/share/gc/shared/vmGCOperations.hpp +../../../src/hotspot/share/gc/shared/softRefGenPolicy.hpp +../../../src/hotspot/share/gc/shared/collectorPolicy.hpp +../../../src/hotspot/share/gc/shared/cardTableBarrierSet.inline.hpp +../../../src/hotspot/share/gc/shared/barrierSet.cpp +../../../src/hotspot/share/gc/shared/jvmFlagConstraintsGC.hpp +../../../src/hotspot/share/gc/shared/suspendibleThreadSet.cpp +../../../src/hotspot/share/gc/shared/workerDataArray.cpp +../../../src/hotspot/share/gc/shared/gcArguments.cpp +../../../src/hotspot/share/gc/shared/ageTableTracer.cpp +../../../src/hotspot/share/gc/shared/isGCActiveMark.hpp +../../../src/hotspot/share/gc/shared/genMemoryPools.cpp +../../../src/hotspot/share/gc/shared/blockOffsetTable.inline.hpp +../../../src/hotspot/share/gc/shared/stringdedup/stringDedupThread.hpp +../../../src/hotspot/share/gc/shared/stringdedup/stringDedupStat.hpp +../../../src/hotspot/share/gc/shared/stringdedup/stringDedup.hpp +../../../src/hotspot/share/gc/shared/stringdedup/stringDedupQueue.cpp +../../../src/hotspot/share/gc/shared/stringdedup/stringDedupQueue.inline.hpp +../../../src/hotspot/share/gc/shared/stringdedup/stringDedupTable.hpp +../../../src/hotspot/share/gc/shared/stringdedup/stringDedupThread.inline.hpp +../../../src/hotspot/share/gc/shared/stringdedup/stringDedupTable.cpp +../../../src/hotspot/share/gc/shared/stringdedup/stringDedup.inline.hpp +../../../src/hotspot/share/gc/shared/stringdedup/stringDedupThread.cpp +../../../src/hotspot/share/gc/shared/stringdedup/stringDedupStat.cpp +../../../src/hotspot/share/gc/shared/stringdedup/stringDedup.cpp +../../../src/hotspot/share/gc/shared/stringdedup/stringDedupQueue.hpp +../../../src/hotspot/share/gc/shared/softRefPolicy.hpp +../../../src/hotspot/share/gc/shared/oopStorageParState.inline.hpp +../../../src/hotspot/share/gc/shared/genCollectedHeap.hpp +../../../src/hotspot/share/gc/shared/concurrentGCThread.cpp +../../../src/hotspot/share/gc/shared/cardTable.hpp +../../../src/hotspot/share/gc/shared/vmStructs_gc.hpp +../../../src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.hpp +../../../src/hotspot/share/gc/shared/gcLocker.cpp +../../../src/hotspot/share/gc/shared/modRefBarrierSet.inline.hpp +../../../src/hotspot/share/gc/shared/barrierSetConfig.hpp +../../../src/hotspot/share/gc/shared/cardTableBarrierSet.cpp +../../../src/hotspot/share/gc/shared/oopStorage.cpp +../../../src/hotspot/share/gc/shared/gcConfig.hpp +../../../src/hotspot/share/gc/shared/genOopClosures.inline.hpp +../../../src/hotspot/share/gc/shared/gcName.hpp +../../../src/hotspot/share/gc/shared/referencePolicy.cpp +../../../src/hotspot/share/gc/shared/gcArguments.inline.hpp +../../../src/hotspot/share/gc/shared/memAllocator.hpp +../../../src/hotspot/share/gc/shared/strongRootsScope.cpp +../../../src/hotspot/share/gc/shared/generationCounters.cpp +../../../src/hotspot/share/gc/shared/gcUtil.hpp +../../../src/hotspot/share/gc/shared/gcTrace.cpp +../../../src/hotspot/share/gc/shared/memset_with_concurrent_readers.hpp +../../../src/hotspot/share/gc/shared/gcId.hpp +../../../src/hotspot/share/gc/shared/gcStats.cpp +../../../src/hotspot/share/gc/shared/concurrentGCPhaseManager.cpp +../../../src/hotspot/share/gc/shared/workgroup.hpp +../../../src/hotspot/share/gc/shared/generation.cpp +../../../src/hotspot/share/gc/shared/cardGeneration.inline.hpp +../../../src/hotspot/share/gc/shared/preservedMarks.hpp +../../../src/hotspot/share/gc/shared/gcUtil.inline.hpp +../../../src/hotspot/share/gc/shared/gcTimer.cpp +../../../src/hotspot/share/gc/shared/gcCause.hpp +../../../src/hotspot/share/gc/shared/plab.cpp +../../../src/hotspot/share/gc/shared/genOopClosures.hpp +../../../src/hotspot/share/gc/shared/ageTable.inline.hpp +../../../src/hotspot/share/gc/shared/spaceDecorator.hpp +../../../src/hotspot/share/gc/shared/barrierSet.inline.hpp +../../../src/hotspot/share/gc/shared/gcConfiguration.hpp +../../../src/hotspot/share/gc/shared/copyFailedInfo.hpp +../../../src/hotspot/share/gc/shared/allocTracer.hpp +../../../src/hotspot/share/gc/shared/adaptiveSizePolicy.hpp +../../../src/hotspot/share/gc/shared/workerManager.hpp +../../../src/hotspot/share/gc/shared/gcPolicyCounters.cpp +../../../src/hotspot/share/gc/shared/gcLocker.inline.hpp +../../../src/hotspot/share/gc/shared/threadLocalAllocBuffer.inline.hpp +../../../src/hotspot/share/gc/shared/taskqueue.inline.hpp +../../../src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp +../../../src/hotspot/share/gc/shared/c2/barrierSetC2.hpp +../../../src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.hpp +../../../src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.cpp +../../../src/hotspot/share/gc/shared/c2/barrierSetC2.cpp +../../../src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.hpp +../../../src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp +../../../src/hotspot/share/gc/shared/collectedHeap.hpp +../../../src/hotspot/share/gc/shared/ageTable.cpp +../../../src/hotspot/share/gc/shared/gc_globals.hpp +../../../src/hotspot/share/gc/shared/blockOffsetTable.hpp +../../../src/hotspot/share/gc/shared/gcHeapSummary.hpp +../../../src/hotspot/share/gc/shared/hSpaceCounters.cpp +../../../src/hotspot/share/gc/shared/accessBarrierSupport.hpp +../../../src/hotspot/share/gc/shared/referenceProcessor.hpp +../../../src/hotspot/share/gc/shared/collectorCounters.cpp +../../../src/hotspot/share/gc/shared/gcTraceTime.cpp +../../../src/hotspot/share/gc/shared/taskqueue.cpp +../../../src/hotspot/share/gc/shared/cardTableBarrierSetAssembler.hpp +../../../src/hotspot/share/gc/shared/cardTableRS.cpp +../../../src/hotspot/share/gc/shared/weakProcessor.hpp +../../../src/hotspot/share/gc/shared/space.cpp +../../../src/hotspot/share/gc/shared/accessBarrierSupport.inline.hpp +../../../src/hotspot/share/gc/shared/gcWhen.hpp +../../../src/hotspot/share/gc/shared/objectCountEventSender.cpp +../../../src/hotspot/share/gc/shared/modRefBarrierSetAssembler.hpp +../../../src/hotspot/share/gc/cms/concurrentMarkSweepThread.hpp +../../../src/hotspot/share/gc/cms/gSpaceCounters.hpp +../../../src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp +../../../src/hotspot/share/gc/cms/cmsGCStats.cpp +../../../src/hotspot/share/gc/cms/cmsCardTable.cpp +../../../src/hotspot/share/gc/cms/cmsOopClosures.hpp +../../../src/hotspot/share/gc/cms/jvmFlagConstraintsCMS.hpp +../../../src/hotspot/share/gc/cms/compactibleFreeListSpace.hpp +../../../src/hotspot/share/gc/cms/cmsHeap.inline.hpp +../../../src/hotspot/share/gc/cms/vmCMSOperations.hpp +../../../src/hotspot/share/gc/cms/cms_globals.hpp +../../../src/hotspot/share/gc/cms/yieldingWorkgroup.hpp +../../../src/hotspot/share/gc/cms/cmsHeap.hpp +../../../src/hotspot/share/gc/cms/cmsArguments.cpp +../../../src/hotspot/share/gc/cms/adaptiveFreeList.cpp +../../../src/hotspot/share/gc/cms/promotionInfo.cpp +../../../src/hotspot/share/gc/cms/parNewGeneration.cpp +../../../src/hotspot/share/gc/cms/freeChunk.hpp +../../../src/hotspot/share/gc/cms/cmsLockVerifier.cpp +../../../src/hotspot/share/gc/cms/allocationStats.cpp +../../../src/hotspot/share/gc/cms/cmsCollectorPolicy.cpp +../../../src/hotspot/share/gc/cms/parOopClosures.hpp +../../../src/hotspot/share/gc/cms/vmCMSOperations.cpp +../../../src/hotspot/share/gc/cms/yieldingWorkgroup.cpp +../../../src/hotspot/share/gc/cms/cmsOopClosures.inline.hpp +../../../src/hotspot/share/gc/cms/promotionInfo.inline.hpp +../../../src/hotspot/share/gc/cms/cmsHeap.cpp +../../../src/hotspot/share/gc/cms/cmsArguments.hpp +../../../src/hotspot/share/gc/cms/adaptiveFreeList.hpp +../../../src/hotspot/share/gc/cms/promotionInfo.hpp +../../../src/hotspot/share/gc/cms/parOopClosures.inline.hpp +../../../src/hotspot/share/gc/cms/parNewGeneration.hpp +../../../src/hotspot/share/gc/cms/freeChunk.cpp +../../../src/hotspot/share/gc/cms/cmsLockVerifier.hpp +../../../src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.inline.hpp +../../../src/hotspot/share/gc/cms/vmStructs_cms.hpp +../../../src/hotspot/share/gc/cms/cmsCollectorPolicy.hpp +../../../src/hotspot/share/gc/cms/allocationStats.hpp +../../../src/hotspot/share/gc/cms/concurrentMarkSweepThread.cpp +../../../src/hotspot/share/gc/cms/compactibleFreeListSpace.inline.hpp +../../../src/hotspot/share/gc/cms/gSpaceCounters.cpp +../../../src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.hpp +../../../src/hotspot/share/gc/cms/cmsGCStats.hpp +../../../src/hotspot/share/gc/cms/cmsCardTable.hpp +../../../src/hotspot/share/gc/cms/jvmFlagConstraintsCMS.cpp +../../../src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp +../../../src/hotspot/share/gc/cms/parNewGeneration.inline.hpp +../../../src/hotspot/share/gc/serial/markSweep.cpp +../../../src/hotspot/share/gc/serial/cSpaceCounters.hpp +../../../src/hotspot/share/gc/serial/serialHeap.hpp +../../../src/hotspot/share/gc/serial/tenuredGeneration.hpp +../../../src/hotspot/share/gc/serial/genMarkSweep.cpp +../../../src/hotspot/share/gc/serial/defNewGeneration.inline.hpp +../../../src/hotspot/share/gc/serial/serialHeap.inline.hpp +../../../src/hotspot/share/gc/serial/defNewGeneration.cpp +../../../src/hotspot/share/gc/serial/serialArguments.cpp +../../../src/hotspot/share/gc/serial/serial_globals.hpp +../../../src/hotspot/share/gc/serial/tenuredGeneration.cpp +../../../src/hotspot/share/gc/serial/genMarkSweep.hpp +../../../src/hotspot/share/gc/serial/markSweep.inline.hpp +../../../src/hotspot/share/gc/serial/defNewGeneration.hpp +../../../src/hotspot/share/gc/serial/serialArguments.hpp +../../../src/hotspot/share/gc/serial/markSweep.hpp +../../../src/hotspot/share/gc/serial/vmStructs_serial.hpp +../../../src/hotspot/share/gc/serial/tenuredGeneration.inline.hpp +../../../src/hotspot/share/gc/serial/cSpaceCounters.cpp +../../../src/hotspot/share/gc/serial/serialHeap.cpp +../../../src/hotspot/share/oops/objArrayKlass.inline.hpp +../../../src/hotspot/share/oops/cpCache.inline.hpp +../../../src/hotspot/share/oops/annotations.hpp +../../../src/hotspot/share/oops/accessBackend.inline.hpp +../../../src/hotspot/share/oops/typeArrayKlass.inline.hpp +../../../src/hotspot/share/oops/compressedOops.inline.hpp +../../../src/hotspot/share/oops/methodCounters.hpp +../../../src/hotspot/share/oops/generateOopMap.cpp +../../../src/hotspot/share/oops/access.hpp +../../../src/hotspot/share/oops/symbol.cpp +../../../src/hotspot/share/oops/arrayOop.inline.hpp +../../../src/hotspot/share/oops/instanceOop.cpp +../../../src/hotspot/share/oops/methodData.inline.hpp +../../../src/hotspot/share/oops/instanceRefKlass.cpp +../../../src/hotspot/share/oops/method.inline.hpp +../../../src/hotspot/share/oops/arrayKlass.cpp +../../../src/hotspot/share/oops/weakHandle.hpp +../../../src/hotspot/share/oops/klass.hpp +../../../src/hotspot/share/oops/constantPool.hpp +../../../src/hotspot/share/oops/oopHandle.hpp +../../../src/hotspot/share/oops/accessDecorators.hpp +../../../src/hotspot/share/oops/instanceKlass.cpp +../../../src/hotspot/share/oops/typeArrayOop.inline.hpp +../../../src/hotspot/share/oops/instanceMirrorKlass.hpp +../../../src/hotspot/share/oops/objArrayKlass.hpp +../../../src/hotspot/share/oops/array.hpp +../../../src/hotspot/share/oops/typeArrayKlass.hpp +../../../src/hotspot/share/oops/oopHandle.inline.hpp +../../../src/hotspot/share/oops/accessBackend.hpp +../../../src/hotspot/share/oops/oop.cpp +../../../src/hotspot/share/oops/cpCache.hpp +../../../src/hotspot/share/oops/compiledICHolder.hpp +../../../src/hotspot/share/oops/fieldInfo.hpp +../../../src/hotspot/share/oops/reflectionAccessorImplKlassHelper.hpp +../../../src/hotspot/share/oops/verifyOopClosure.hpp +../../../src/hotspot/share/oops/markOop.hpp +../../../src/hotspot/share/oops/methodData.hpp +../../../src/hotspot/share/oops/markOop.inline.hpp +../../../src/hotspot/share/oops/objArrayOop.hpp +../../../src/hotspot/share/oops/constMethod.cpp +../../../src/hotspot/share/oops/klassVtable.hpp +../../../src/hotspot/share/oops/instanceMirrorKlass.inline.hpp +../../../src/hotspot/share/oops/oopsHierarchy.hpp +../../../src/hotspot/share/oops/metadata.hpp +../../../src/hotspot/share/oops/fieldStreams.hpp +../../../src/hotspot/share/oops/method.hpp +../../../src/hotspot/share/oops/objArrayKlass.cpp +../../../src/hotspot/share/oops/instanceMirrorKlass.cpp +../../../src/hotspot/share/oops/typeArrayKlass.cpp +../../../src/hotspot/share/oops/accessBackend.cpp +../../../src/hotspot/share/oops/oop.hpp +../../../src/hotspot/share/oops/weakHandle.inline.hpp +../../../src/hotspot/share/oops/cpCache.cpp +../../../src/hotspot/share/oops/objArrayOop.inline.hpp +../../../src/hotspot/share/oops/compiledICHolder.cpp +../../../src/hotspot/share/oops/reflectionAccessorImplKlassHelper.cpp +../../../src/hotspot/share/oops/klass.inline.hpp +../../../src/hotspot/share/oops/markOop.cpp +../../../src/hotspot/share/oops/instanceKlass.inline.hpp +../../../src/hotspot/share/oops/methodData.cpp +../../../src/hotspot/share/oops/objArrayOop.cpp +../../../src/hotspot/share/oops/constMethod.hpp +../../../src/hotspot/share/oops/oop.inline.hpp +../../../src/hotspot/share/oops/klassVtable.cpp +../../../src/hotspot/share/oops/method.cpp +../../../src/hotspot/share/oops/oopsHierarchy.cpp +../../../src/hotspot/share/oops/metadata.cpp +../../../src/hotspot/share/oops/arrayKlass.inline.hpp +../../../src/hotspot/share/oops/typeArrayOop.hpp +../../../src/hotspot/share/oops/instanceRefKlass.inline.hpp +../../../src/hotspot/share/oops/arrayOop.hpp +../../../src/hotspot/share/oops/annotations.cpp +../../../src/hotspot/share/oops/methodCounters.cpp +../../../src/hotspot/share/oops/generateOopMap.hpp +../../../src/hotspot/share/oops/symbol.hpp +../../../src/hotspot/share/oops/instanceClassLoaderKlass.hpp +../../../src/hotspot/share/oops/access.cpp +../../../src/hotspot/share/oops/instanceClassLoaderKlass.inline.hpp +../../../src/hotspot/share/oops/instanceOop.hpp +../../../src/hotspot/share/oops/arrayKlass.hpp +../../../src/hotspot/share/oops/weakHandle.cpp +../../../src/hotspot/share/oops/constantPool.inline.hpp +../../../src/hotspot/share/oops/instanceRefKlass.hpp +../../../src/hotspot/share/oops/klass.cpp +../../../src/hotspot/share/oops/array.inline.hpp +../../../src/hotspot/share/oops/constantPool.cpp +../../../src/hotspot/share/oops/access.inline.hpp +../../../src/hotspot/share/oops/instanceKlass.hpp +../../../src/hotspot/share/opto/ad.hpp +../../../src/hotspot/share/opto/ifnode.cpp +../../../src/hotspot/share/opto/phase.cpp +../../../src/hotspot/share/opto/parseHelper.cpp +../../../src/hotspot/share/opto/callGenerator.cpp +../../../src/hotspot/share/opto/c2_globals.hpp +../../../src/hotspot/share/opto/replacednodes.hpp +../../../src/hotspot/share/opto/runtime.hpp +../../../src/hotspot/share/opto/chaitin.hpp +../../../src/hotspot/share/opto/subnode.hpp +../../../src/hotspot/share/opto/divnode.hpp +../../../src/hotspot/share/opto/intrinsicnode.cpp +../../../src/hotspot/share/opto/multnode.cpp +../../../src/hotspot/share/opto/live.cpp +../../../src/hotspot/share/opto/macro.cpp +../../../src/hotspot/share/opto/phaseX.hpp +../../../src/hotspot/share/opto/convertnode.cpp +../../../src/hotspot/share/opto/addnode.hpp +../../../src/hotspot/share/opto/graphKit.hpp +../../../src/hotspot/share/opto/type.hpp +../../../src/hotspot/share/opto/connode.cpp +../../../src/hotspot/share/opto/vectornode.cpp +../../../src/hotspot/share/opto/regmask.hpp +../../../src/hotspot/share/opto/escape.cpp +../../../src/hotspot/share/opto/coalesce.cpp +../../../src/hotspot/share/opto/matcher.cpp +../../../src/hotspot/share/opto/cfgnode.hpp +../../../src/hotspot/share/opto/opaquenode.cpp +../../../src/hotspot/share/opto/classes.hpp +../../../src/hotspot/share/opto/idealGraphPrinter.cpp +../../../src/hotspot/share/opto/loopPredicate.cpp +../../../src/hotspot/share/opto/mathexactnode.cpp +../../../src/hotspot/share/opto/loopTransform.cpp +../../../src/hotspot/share/opto/callnode.cpp +../../../src/hotspot/share/opto/doCall.cpp +../../../src/hotspot/share/opto/block.cpp +../../../src/hotspot/share/opto/gcm.cpp +../../../src/hotspot/share/opto/locknode.hpp +../../../src/hotspot/share/opto/movenode.hpp +../../../src/hotspot/share/opto/node.cpp +../../../src/hotspot/share/opto/regalloc.cpp +../../../src/hotspot/share/opto/countbitsnode.cpp +../../../src/hotspot/share/opto/indexSet.cpp +../../../src/hotspot/share/opto/stringopts.hpp +../../../src/hotspot/share/opto/compile.hpp +../../../src/hotspot/share/opto/opcodes.hpp +../../../src/hotspot/share/opto/phasetype.hpp +../../../src/hotspot/share/opto/mulnode.cpp +../../../src/hotspot/share/opto/narrowptrnode.cpp +../../../src/hotspot/share/opto/superword.hpp +../../../src/hotspot/share/opto/memnode.hpp +../../../src/hotspot/share/opto/rootnode.hpp +../../../src/hotspot/share/opto/castnode.hpp +../../../src/hotspot/share/opto/loopnode.cpp +../../../src/hotspot/share/opto/loopopts.cpp +../../../src/hotspot/share/opto/arraycopynode.cpp +../../../src/hotspot/share/opto/c2compiler.hpp +../../../src/hotspot/share/opto/idealKit.hpp +../../../src/hotspot/share/opto/output.cpp +../../../src/hotspot/share/opto/machnode.hpp +../../../src/hotspot/share/opto/generateOptoStub.cpp +../../../src/hotspot/share/opto/split_if.cpp +../../../src/hotspot/share/opto/reg_split.cpp +../../../src/hotspot/share/opto/matcher.hpp +../../../src/hotspot/share/opto/idealGraphPrinter.hpp +../../../src/hotspot/share/opto/mathexactnode.hpp +../../../src/hotspot/share/opto/opaquenode.hpp +../../../src/hotspot/share/opto/cfgnode.cpp +../../../src/hotspot/share/opto/classes.cpp +../../../src/hotspot/share/opto/callnode.hpp +../../../src/hotspot/share/opto/block.hpp +../../../src/hotspot/share/opto/node.hpp +../../../src/hotspot/share/opto/movenode.cpp +../../../src/hotspot/share/opto/regalloc.hpp +../../../src/hotspot/share/opto/locknode.cpp +../../../src/hotspot/share/opto/countbitsnode.hpp +../../../src/hotspot/share/opto/stringopts.cpp +../../../src/hotspot/share/opto/compile.cpp +../../../src/hotspot/share/opto/indexSet.hpp +../../../src/hotspot/share/opto/opcodes.cpp +../../../src/hotspot/share/opto/narrowptrnode.hpp +../../../src/hotspot/share/opto/mulnode.hpp +../../../src/hotspot/share/opto/memnode.cpp +../../../src/hotspot/share/opto/rootnode.cpp +../../../src/hotspot/share/opto/superword.cpp +../../../src/hotspot/share/opto/loopnode.hpp +../../../src/hotspot/share/opto/castnode.cpp +../../../src/hotspot/share/opto/adlcVMDeps.hpp +../../../src/hotspot/share/opto/arraycopynode.hpp +../../../src/hotspot/share/opto/c2compiler.cpp +../../../src/hotspot/share/opto/machnode.cpp +../../../src/hotspot/share/opto/output.hpp +../../../src/hotspot/share/opto/optoreg.hpp +../../../src/hotspot/share/opto/idealKit.cpp +../../../src/hotspot/share/opto/ifg.cpp +../../../src/hotspot/share/opto/phase.hpp +../../../src/hotspot/share/opto/c2_globals.cpp +../../../src/hotspot/share/opto/callGenerator.hpp +../../../src/hotspot/share/opto/domgraph.cpp +../../../src/hotspot/share/opto/macroArrayCopy.cpp +../../../src/hotspot/share/opto/replacednodes.cpp +../../../src/hotspot/share/opto/postaloc.cpp +../../../src/hotspot/share/opto/lcm.cpp +../../../src/hotspot/share/opto/runtime.cpp +../../../src/hotspot/share/opto/subnode.cpp +../../../src/hotspot/share/opto/chaitin.cpp +../../../src/hotspot/share/opto/intrinsicnode.hpp +../../../src/hotspot/share/opto/multnode.hpp +../../../src/hotspot/share/opto/loopUnswitch.cpp +../../../src/hotspot/share/opto/divnode.cpp +../../../src/hotspot/share/opto/buildOopMap.cpp +../../../src/hotspot/share/opto/convertnode.hpp +../../../src/hotspot/share/opto/live.hpp +../../../src/hotspot/share/opto/macro.hpp +../../../src/hotspot/share/opto/parse2.cpp +../../../src/hotspot/share/opto/bytecodeInfo.cpp +../../../src/hotspot/share/opto/phaseX.cpp +../../../src/hotspot/share/opto/parse3.cpp +../../../src/hotspot/share/opto/addnode.cpp +../../../src/hotspot/share/opto/parse.hpp +../../../src/hotspot/share/opto/connode.hpp +../../../src/hotspot/share/opto/type.cpp +../../../src/hotspot/share/opto/graphKit.cpp +../../../src/hotspot/share/opto/parse1.cpp +../../../src/hotspot/share/opto/vectornode.hpp +../../../src/hotspot/share/opto/coalesce.hpp +../../../src/hotspot/share/opto/library_call.cpp +../../../src/hotspot/share/opto/escape.hpp +../../../src/hotspot/share/opto/regmask.cpp +../../../src/hotspot/share/precompiled/precompiled.hpp +../../../src/hotspot/share/compiler/abstractCompiler.cpp +../../../src/hotspot/share/compiler/compilerDefinitions.cpp +../../../src/hotspot/share/compiler/methodMatcher.cpp +../../../src/hotspot/share/compiler/compilerOracle.cpp +../../../src/hotspot/share/compiler/compileTask.hpp +../../../src/hotspot/share/compiler/disassembler.cpp +../../../src/hotspot/share/compiler/oopMap.hpp +../../../src/hotspot/share/compiler/compileLog.hpp +../../../src/hotspot/share/compiler/directivesParser.hpp +../../../src/hotspot/share/compiler/compileBroker.cpp +../../../src/hotspot/share/compiler/compilerDirectives.cpp +../../../src/hotspot/share/compiler/methodLiveness.cpp +../../../src/hotspot/share/compiler/oopMap.cpp +../../../src/hotspot/share/compiler/compileLog.cpp +../../../src/hotspot/share/compiler/directivesParser.cpp +../../../src/hotspot/share/compiler/compileBroker.hpp +../../../src/hotspot/share/compiler/compilerDirectives.hpp +../../../src/hotspot/share/compiler/methodLiveness.hpp +../../../src/hotspot/share/compiler/compilerDefinitions.hpp +../../../src/hotspot/share/compiler/abstractCompiler.hpp +../../../src/hotspot/share/compiler/methodMatcher.hpp +../../../src/hotspot/share/compiler/compilerOracle.hpp +../../../src/hotspot/share/compiler/compileTask.cpp +../../../src/hotspot/share/compiler/disassembler.hpp +../../../src/hotspot/share/logging/logTagSet.cpp +../../../src/hotspot/share/logging/logOutput.hpp +../../../src/hotspot/share/logging/logDecorations.hpp +../../../src/hotspot/share/logging/logFileStreamOutput.hpp +../../../src/hotspot/share/logging/logOutputList.hpp +../../../src/hotspot/share/logging/logSelection.cpp +../../../src/hotspot/share/logging/logLevel.hpp +../../../src/hotspot/share/logging/logStream.cpp +../../../src/hotspot/share/logging/logConfiguration.hpp +../../../src/hotspot/share/logging/logTag.hpp +../../../src/hotspot/share/logging/logDecorators.cpp +../../../src/hotspot/share/logging/logMessage.hpp +../../../src/hotspot/share/logging/logTagSetDescriptions.hpp +../../../src/hotspot/share/logging/logSelectionList.hpp +../../../src/hotspot/share/logging/logFileOutput.cpp +../../../src/hotspot/share/logging/logMessageBuffer.hpp +../../../src/hotspot/share/logging/logDiagnosticCommand.hpp +../../../src/hotspot/share/logging/logTag.cpp +../../../src/hotspot/share/logging/logConfiguration.cpp +../../../src/hotspot/share/logging/logDecorators.hpp +../../../src/hotspot/share/logging/logPrefix.hpp +../../../src/hotspot/share/logging/logTagSetDescriptions.cpp +../../../src/hotspot/share/logging/logMessageBuffer.cpp +../../../src/hotspot/share/logging/logSelectionList.cpp +../../../src/hotspot/share/logging/logFileOutput.hpp +../../../src/hotspot/share/logging/logDiagnosticCommand.cpp +../../../src/hotspot/share/logging/logHandle.hpp +../../../src/hotspot/share/logging/logTagSet.hpp +../../../src/hotspot/share/logging/log.hpp +../../../src/hotspot/share/logging/logOutput.cpp +../../../src/hotspot/share/logging/logFileStreamOutput.cpp +../../../src/hotspot/share/logging/logDecorations.cpp +../../../src/hotspot/share/logging/logOutputList.cpp +../../../src/hotspot/share/logging/logTag_ext.hpp +../../../src/hotspot/share/logging/logSelection.hpp +../../../src/hotspot/share/logging/logLevel.cpp +../../../src/hotspot/share/logging/logStream.hpp +../../../src/hotspot/share/services/gcNotifier.cpp +../../../src/hotspot/share/services/memBaseline.cpp +../../../src/hotspot/share/services/heapDumper.hpp +../../../src/hotspot/share/services/memoryPool.hpp +../../../src/hotspot/share/services/nmtCommon.cpp +../../../src/hotspot/share/services/mallocTracker.hpp +../../../src/hotspot/share/services/nmtDCmd.cpp +../../../src/hotspot/share/services/diagnosticCommand.cpp +../../../src/hotspot/share/services/lowMemoryDetector.cpp +../../../src/hotspot/share/services/writeableFlags.cpp +../../../src/hotspot/share/services/threadService.cpp +../../../src/hotspot/share/services/runtimeService.cpp +../../../src/hotspot/share/services/attachListener.hpp +../../../src/hotspot/share/services/memoryService.cpp +../../../src/hotspot/share/services/memoryManager.hpp +../../../src/hotspot/share/services/management.hpp +../../../src/hotspot/share/services/memReporter.hpp +../../../src/hotspot/share/services/memTracker.hpp +../../../src/hotspot/share/services/allocationSite.hpp +../../../src/hotspot/share/services/classLoadingService.cpp +../../../src/hotspot/share/services/virtualMemoryTracker.hpp +../../../src/hotspot/share/services/mallocSiteTable.cpp +../../../src/hotspot/share/services/dtraceAttacher.hpp +../../../src/hotspot/share/services/diagnosticArgument.cpp +../../../src/hotspot/share/services/diagnosticFramework.hpp +../../../src/hotspot/share/services/runtimeService.hpp +../../../src/hotspot/share/services/threadService.hpp +../../../src/hotspot/share/services/memoryService.hpp +../../../src/hotspot/share/services/attachListener.cpp +../../../src/hotspot/share/services/mallocTracker.inline.hpp +../../../src/hotspot/share/services/memTracker.cpp +../../../src/hotspot/share/services/management.cpp +../../../src/hotspot/share/services/memReporter.cpp +../../../src/hotspot/share/services/memoryManager.cpp +../../../src/hotspot/share/services/classLoadingService.hpp +../../../src/hotspot/share/services/memoryUsage.hpp +../../../src/hotspot/share/services/dtraceAttacher.cpp +../../../src/hotspot/share/services/mallocSiteTable.hpp +../../../src/hotspot/share/services/virtualMemoryTracker.cpp +../../../src/hotspot/share/services/diagnosticFramework.cpp +../../../src/hotspot/share/services/diagnosticArgument.hpp +../../../src/hotspot/share/services/gcNotifier.hpp +../../../src/hotspot/share/services/memBaseline.hpp +../../../src/hotspot/share/services/heapDumper.cpp +../../../src/hotspot/share/services/memoryPool.cpp +../../../src/hotspot/share/services/nmtCommon.hpp +../../../src/hotspot/share/services/mallocTracker.cpp +../../../src/hotspot/share/services/nmtDCmd.hpp +../../../src/hotspot/share/services/lowMemoryDetector.hpp +../../../src/hotspot/share/services/diagnosticCommand.hpp +../../../src/hotspot/share/services/writeableFlags.hpp +../../../src/hotspot/share/services/diagnosticCommand_ext.hpp +../../../src/hotspot/share/aot/aotCodeHeap.cpp +../../../src/hotspot/share/aot/aotCompiledMethod.cpp +../../../src/hotspot/share/aot/aotLoader.hpp +../../../src/hotspot/share/aot/compiledIC_aot.hpp +../../../src/hotspot/share/aot/compiledIC_aot.cpp +../../../src/hotspot/share/aot/aotCompiledMethod.hpp +../../../src/hotspot/share/aot/aotCodeHeap.hpp +../../../src/hotspot/share/aot/aotLoader.cpp +../../../src/hotspot/share/aot/aotLoader.inline.hpp +../../../src/hotspot/share/jvmci/vmStructs_jvmci.hpp +../../../src/hotspot/share/jvmci/compilerRuntime.cpp +../../../src/hotspot/share/jvmci/jvmciCodeInstaller.hpp +../../../src/hotspot/share/jvmci/jvmci_globals.cpp +../../../src/hotspot/share/jvmci/systemDictionary_jvmci.hpp +../../../src/hotspot/share/jvmci/jvmciJavaClasses.hpp +../../../src/hotspot/share/jvmci/jvmciRuntime.cpp +../../../src/hotspot/share/jvmci/jvmciEnv.hpp +../../../src/hotspot/share/jvmci/jvmciCompiler.cpp +../../../src/hotspot/share/jvmci/vmSymbols_jvmci.hpp +../../../src/hotspot/share/jvmci/jvmciCompilerToVM.hpp +../../../src/hotspot/share/jvmci/jvmciEnv.cpp +../../../src/hotspot/share/jvmci/jvmciCompiler.hpp +../../../src/hotspot/share/jvmci/jvmciCompilerToVM.cpp +../../../src/hotspot/share/jvmci/vmStructs_jvmci.cpp +../../../src/hotspot/share/jvmci/compilerRuntime.hpp +../../../src/hotspot/share/jvmci/vmStructs_compiler_runtime.hpp +../../../src/hotspot/share/jvmci/jvmciCodeInstaller.cpp +../../../src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp +../../../src/hotspot/share/jvmci/jvmci_globals.hpp +../../../src/hotspot/share/jvmci/jvmciJavaClasses.cpp +../../../src/hotspot/share/jvmci/jvmciRuntime.hpp) + +add_executable(hotspot ${SOURCE_FILES}) --- /dev/null 2019-05-16 19:16:18.000000000 +0300 +++ new/jb/project/java-common.cmake 2019-05-16 19:16:18.000000000 +0300 @@ -0,0 +1,30 @@ +# common for all OS +set(CMAKE_CXX_STANDARD 98) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE -D_REENTRANT -DVM_LITTLE_ENDIAN -D_LP64 -DTARGET_ARCH_x86 ") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DINCLUDE_SUFFIX_CPU=_x86 -DAMD64 -DHOTSPOT_LIB_ARCH='amd64' -DCOMPILER1 -DCOMPILER2") + +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTARGET_COMPILER_gcc") +endif () + +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLINUX -DTARGET_OS_FAMILY_linux -DTARGET_COMPILER_gcc -D_GNU_SOURCE") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLINUX -DTARGET_OS_FAMILY_linux -DTARGET_COMPILER_gcc -D_GNU_SOURCE") +endif () + +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_ALLBSD_SOURCE -DTARGET_OS_FAMILY_bsd") +endif () + +if ("${CMAKE_SYSTEM_NAME}" MATCHES "CYGWIN") #not shure about TARGET_COMPILER + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTARGET_COMPILER_visCPP -DWIN64 -D_WINDOWS -DTARGET_OS_FAMILY_windows") +endif () + +add_custom_target(configure + COMMAND bash configure + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/../../../) + +add_custom_target(build_images + COMMAND make COMPILER_WARNINGS_FATAL=false images + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/../../../ + DEPENDS ${SOURCE_FILES}) \ No newline at end of file --- /dev/null 2019-05-16 19:16:19.000000000 +0300 +++ new/jb/project/java-gradle/build.gradle 2019-05-16 19:16:19.000000000 +0300 @@ -0,0 +1,135 @@ +apply plugin: 'java' +import org.gradle.internal.os.OperatingSystem + +repositories { + mavenCentral() +} + +def test_jvm = { + if (project.hasProperty('jbsdkhome')) { + file(jbsdkhome + (OperatingSystem.current().isWindows()?"/bin/java.exe" : "/bin/java")).absolutePath + } else { + if (OperatingSystem.current().isMacOsX()) { + file('../../../build/macosx-x86_64-server-release/images/jdk-bundle/jdk-13.jdk/Contents/Home/bin/java').absolutePath + } else if (OperatingSystem.current().isLinux()) { + file('../../../build/linux-x86_64-server-release/images/jdk/bin/java').absolutePath + } else { + file('../../../build/windows-x86_64-server-release/images/j2sdk-image/bin/java.exe').absolutePath + } + } +} + +dependencies { + testCompile('junit:junit:4.12'){ + exclude group: 'org.hamcrest' + } + testCompile 'org.hamcrest:hamcrest-library:1.3' + testCompile 'net.java.dev.jna:jna:4.4.0' + testCompile 'com.twelvemonkeys.imageio:imageio-tiff:3.3.2' + testCompile 'org.apache.commons:commons-lang3:3.0' +} + +def jdk_modules = ["java.base", "java.logging", "java.prefs", + "java.se.ee", "java.sql", "java.datatransfer", + "java.management", "java.rmi", "java.security.jgss", + "java.sql.rowset", "java.desktop", "java.management.rmi", + "java.scripting", "java.security.sasl", "java.transaction", + "java.instrument", "java.naming", "java.se", + "java.smartcardio", "java.xml.crypto"] + +def jdk_class_dirs = [] + +jdk_modules.collect(jdk_class_dirs) { + new File("../../../src/" + it + "/share/classes") +} + +if (OperatingSystem.current().isMacOsX()) + jdk_modules.collect(jdk_class_dirs) { + "../../../src/" + it + "/macosx/classes" + } +else if (OperatingSystem.current().isLinux()) { + jdk_modules.collect(jdk_class_dirs) { + "../../../src/" + it + "/solaris/classes" + } + jdk_modules.collect(jdk_class_dirs) { + "../../../src/" + it + "/unix/classes" + } +} else + jdk_modules.collect(jdk_class_dirs) { + "../../../src/" + it + "/windows/classes" + } + +sourceSets.main.java.srcDirs = jdk_class_dirs + +sourceSets { + test { + java { + srcDir "../../../test/jdk/jbu" + } + } +} + +test.dependsOn.clear() + +test.dependsOn tasks.compileTestJava + +test { + systemProperty "jb.java2d.metal", "true" + systemProperty "testdata", file('../../../test/jdk/jbu/testdata').absolutePath + +// Generate golden images for DroidFontTest and MixedTextTest +// systemProperty "gentestdata", "" + +// Enable Java2D logging (https://confluence.jetbrains.com/display/JRE/Java2D+Rendering+Logging) +// systemProperty "sun.java2d.trace", "log" +// systemProperty "sun.java2d.trace", "log,pimpl" + + outputs.upToDateWhen { false } + executable = test_jvm() + +// Enable async/dtrace profiler + jvmArgs "-XX:+PreserveFramePointer" +// Enable native J2D logging (only in debug build) +// Can be turned on for J2D by adding "#define DEBUG 1" into jdk/src/share/native/sun/java2d/Trace.h + +// environment 'J2D_TRACE_LEVEL', '4' +} + +def buildDir = project.buildscript.sourceFile.parentFile.parentFile.parentFile.parentFile + +def make_cmd = "make" +if (OperatingSystem.current().isWindows()) { + def cyg_make_cmd = new File("c:/cygwin64/bin/make.exe") + if (cyg_make_cmd.exists()) make_cmd = cyg_make_cmd.absolutePath +} +def test_run = false +task make_images { + doLast { + if (!test_run) { + def pb = new ProcessBuilder().command(make_cmd.toString(), "-C", buildDir.absolutePath, "images") + def proc = pb.redirectErrorStream(true).start() + proc.inputStream.eachLine { println it } + assert proc.waitFor() == 0 + } + } +} + +task make_clean { + doLast { + def pb = new ProcessBuilder().command(make_cmd.toString(), "-C", buildDir.absolutePath, "clean") + def proc = pb.redirectErrorStream(true).start() + proc.inputStream.eachLine { println it } + assert proc.waitFor() == 0 + } +} + +task run_test { + doLast { + test_run = true + } +} + +tasks.cleanTest.dependsOn tasks.run_test +classes.dependsOn.clear() +classes.dependsOn tasks.make_images +tasks.cleanClasses.dependsOn tasks.make_clean --- /dev/null 2019-05-16 19:16:20.000000000 +0300 +++ new/jb/project/jdk-cmake/CMakeLists.txt 2019-05-16 19:16:20.000000000 +0300 @@ -0,0 +1,1492 @@ +cmake_minimum_required(VERSION 3.8) +project(jdk) + +include(../java-common.cmake) + +include_directories( + ../../../src/java.base/share/native/include + ../../../src/java.base/share/native/libjava + ../../../src/java.desktop/share/native + ../../../src/java.desktop/share/native/libjsound + ../../../src/java.desktop/share/native/libmlib_image + ../../../src/java.desktop/share/native/libfreetype + ../../../src/java.desktop/share/native/libfreetype/include + ../../../src/java.desktop/share/native/libfreetype/include/freetype + ../../../src/java.desktop/share/native/libfreetype/include/freetype/config + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services + ../../../src/java.desktop/share/native/libfreetype/src + ../../../src/java.desktop/share/native/libfreetype/src/type1 + ../../../src/java.desktop/share/native/libfreetype/src/sfnt + ../../../src/java.desktop/share/native/libfreetype/src/smooth + ../../../src/java.desktop/share/native/libfreetype/src/cff + ../../../src/java.desktop/share/native/libfreetype/src/psaux + ../../../src/java.desktop/share/native/libfreetype/src/cid + ../../../src/java.desktop/share/native/libfreetype/src/autofit + ../../../src/java.desktop/share/native/libfreetype/src/pshinter + ../../../src/java.desktop/share/native/libfreetype/src/truetype + ../../../src/java.desktop/share/native/libfreetype/src/raster + ../../../src/java.desktop/share/native/libfreetype/src/psnames + ../../../src/java.desktop/share/native/libfreetype/src/base + ../../../src/java.desktop/share/native/include + ../../../src/java.desktop/share/native/common + ../../../src/java.desktop/share/native/common/java2d + ../../../src/java.desktop/share/native/common/java2d/opengl + ../../../src/java.desktop/share/native/common/java2d/opengl/J2D_GL + ../../../src/java.desktop/share/native/common/awt + ../../../src/java.desktop/share/native/common/awt/medialib + ../../../src/java.desktop/share/native/common/awt/debug + ../../../src/java.desktop/share/native/common/awt/utility + ../../../src/java.desktop/share/native/common/font + ../../../src/java.desktop/share/native/libawt + ../../../src/java.desktop/share/native/libawt/java2d + ../../../src/java.desktop/share/native/libawt/java2d/pipe + ../../../src/java.desktop/share/native/libawt/java2d/loops + ../../../src/java.desktop/share/native/libawt/awt + ../../../src/java.desktop/share/native/libawt/awt/image + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils + ../../../src/java.desktop/share/native/libawt/awt/image/gif + ../../../src/java.desktop/share/native/libawt/awt/medialib + ../../../src/java.desktop/share/native/libjavajpeg + ../../../src/java.desktop/share/native/libfontmanager + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn + ../../../src/java.desktop/share/native/liblcms + ../../../src/java.desktop/share/native/libsplashscreen + ../../../src/java.desktop/share/native/libsplashscreen/libpng + ../../../src/java.desktop/share/native/libsplashscreen/giflib) + +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux") + include_directories( + ../../../src/hotspot/os/posix/include + ../../../src/java.base/unix/native/include + ../../../src/java.base/unix/native/libjava + ../../../src/java.desktop/unix/native + ../../../src/java.desktop/unix/native/libawt_headless + ../../../src/java.desktop/unix/native/libawt_headless/awt + ../../../src/java.desktop/unix/native/libmlib_image + ../../../src/java.desktop/unix/native/include + ../../../src/java.desktop/unix/native/libjawt + ../../../src/java.desktop/unix/native/common + ../../../src/java.desktop/unix/native/common/java2d + ../../../src/java.desktop/unix/native/common/java2d/x11 + ../../../src/java.desktop/unix/native/common/java2d/opengl + ../../../src/java.desktop/unix/native/common/java2d/opengl/J2D_GL + ../../../src/java.desktop/unix/native/common/awt + ../../../src/java.desktop/unix/native/common/awt/systemscale + ../../../src/java.desktop/unix/native/common/awt/medialib + ../../../src/java.desktop/unix/native/common/awt/utility + ../../../src/java.desktop/unix/native/common/font + ../../../src/java.desktop/unix/native/libawt + ../../../src/java.desktop/unix/native/libawt/java2d + ../../../src/java.desktop/unix/native/libawt/java2d/loops + ../../../src/java.desktop/unix/native/libawt/awt + ../../../src/java.desktop/unix/native/libawt_xawt + ../../../src/java.desktop/unix/native/libawt_xawt/java2d + ../../../src/java.desktop/unix/native/libawt_xawt/java2d/x11 + ../../../src/java.desktop/unix/native/libawt_xawt/awt + ../../../src/java.desktop/unix/native/libawt_xawt/xawt + ../../../src/java.desktop/unix/native/libfontmanager + ../../../src/java.desktop/unix/native/libsplashscreen) +endif() + +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(CMAKE_FRAMEWORK_PATH ${CMAKE_FRAMEWORK_PATH} ${CMAKE_OSX_SYSROOT}/System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/) + find_library(JAVA_NATIVE_FOUNDATION JavaNativeFoundation) + include_directories( + ../../../src/java.desktop/macosx/native/libosxapp + ../../../build/macosx-x86_64-server-release/support/headers/java.desktop + ) + +elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + include_directories( + ../../../build/linux-x86_64-normal-server-release/support/headers/java.desktop) +elseif("${CMAKE_SYSTEM_NAME}" MATCHES "CYGWIN") + include_directories( + ../../../build/windows-x86_64-normal-server-release/support/headers/java.desktop + ../../../src/hotspot/os/windows/include + ../../../src/java.base/windows/native/include + ../../../src/java.base/windows/native/libjava + ../../../src/java.desktop/windows/native/ + ../../../src/java.desktop/windows/native/libjsound + ../../../src/java.desktop/windows/native/include + ../../../src/java.desktop/windows/native/libjawt + ../../../src/java.desktop/windows/native/common + ../../../src/java.desktop/windows/native/common/awt + ../../../src/java.desktop/windows/native/common/awt/systemscale + ../../../src/java.desktop/windows/native/common/awt/utility + ../../../src/java.desktop/windows/native/libawt + ../../../src/java.desktop/windows/native/libawt/java2d + ../../../src/java.desktop/windows/native/libawt/java2d/windows + ../../../src/java.desktop/windows/native/libawt/java2d/opengl + ../../../src/java.desktop/windows/native/libawt/java2d/opengl/J2D_GL + ../../../src/java.desktop/windows/native/libawt/java2d/d3d + ../../../src/java.desktop/windows/native/libawt/windows + ../../../src/java.desktop/windows/native/libfontmanager + ../../../src/java.desktop/windows/native/libsplashscreen) +endif() + +set(SOURCE_FILES + ../../../src/java.desktop/share/native/libjsound/DirectAudio.h + ../../../src/java.desktop/share/native/libjsound/PortMixer.c + ../../../src/java.desktop/share/native/libjsound/Ports.h + ../../../src/java.desktop/share/native/libjsound/MidiOutDevice.c + ../../../src/java.desktop/share/native/libjsound/Utilities.h + ../../../src/java.desktop/share/native/libjsound/Configure.h + ../../../src/java.desktop/share/native/libjsound/PlatformMidi.c + ../../../src/java.desktop/share/native/libjsound/Platform.c + ../../../src/java.desktop/share/native/libjsound/DirectAudioDevice.c + ../../../src/java.desktop/share/native/libjsound/MidiInDeviceProvider.c + ../../../src/java.desktop/share/native/libjsound/MidiOutDeviceProvider.c + ../../../src/java.desktop/share/native/libjsound/SoundDefs.h + ../../../src/java.desktop/share/native/libjsound/Utilities.c + ../../../src/java.desktop/share/native/libjsound/PortMixerProvider.c + ../../../src/java.desktop/share/native/libjsound/MidiInDevice.c + ../../../src/java.desktop/share/native/libjsound/DirectAudioDeviceProvider.c + ../../../src/java.desktop/share/native/libjsound/PlatformMidi.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_image_types.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageUtils.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_c_ImageCopy.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_c_ImageLookUp_f.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_image_proto.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageFilters.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConvCopyEdge_Bit.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_c_ImageAffine_BL.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageLookUp_Bit.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConv_32nw.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_c_ImageAffine_NN.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageClipping.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConvMxN_Fp.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConv_16ext.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_c_ImageLookUp.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageAffineEdge.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_c_ImageConv_f.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_c_ImageConvCopyEdge.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageCreate.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageCheck.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageAffine_BC_D64.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_sys.h + ../../../src/java.desktop/share/native/libmlib_image/j2d_names.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_c_ImageConvClearEdge.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageAffine_BL_S32.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConvClearEdge_Bit.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConvEdge.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_c_ImageAffine_BL_S16.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageAffine_BL_F32.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageAffine.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConv_F32nw.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConvClearEdge_Fp.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConvKernelConvert.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_status.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageLookUp.h + ../../../src/java.desktop/share/native/libmlib_image/mlib.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageDivTables.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConv_u16nw.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_c_ImageAffine_BL_U16.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_types.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageAffine_NN.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConv_8ext.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_c_ImageConv.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConvMxN.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageFilters.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConv_8nw.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_sys_proto.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_c_ImageConvVersion.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageCopy.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConv.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_image.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConv_u16ext.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_c_ImageLookUp.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageScanPoly.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageClipping.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageLookUp_64.c + ../../../src/java.desktop/share/native/libmlib_image/safe_math.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageAffine.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConv_D64nw.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_c_ImageAffine_BC_U16.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_c_ImageAffine_BC.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageAffine_NN_Bit.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConvMxN_ext.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_SysMath.h + ../../../src/java.desktop/share/native/libmlib_image/safe_alloc.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_c_ImageAffine_BC_S16.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageConv_16nw.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageAffine_BC_F32.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageAffine_BC_S32.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageDivTables.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageAffine_BL_D64.c + ../../../src/java.desktop/share/native/libmlib_image/mlib_ImageRowTable.h + ../../../src/java.desktop/share/native/libmlib_image/mlib_image_get.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftsnames.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftsizes.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/fttypes.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftparams.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftmm.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/config/ftstdlib.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/config/ftheader.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/config/ftconfig.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/config/ftoption.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/config/ftmodule.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftmodapi.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/fttrigon.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftbbox.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftgzip.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftdriver.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/sfnt.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/internal.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/ftdrv.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/cffotypes.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/ftdebug.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/psaux.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/t1types.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/pshints.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/autohint.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/ftstream.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/cfftypes.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/tttypes.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/ftvalid.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/ftobjs.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/ftpic.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/fttrace.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/ftmemory.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/fthash.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/ftgloadr.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/ftpsprop.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/ftserv.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svprop.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svmm.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svcfftl.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svwinfnt.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svttcmap.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svotval.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svgldict.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svpscmap.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svkern.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svmetric.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svpsinfo.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svpfr.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svgxval.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svfntfmt.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svbdf.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svsfnt.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svtteng.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svcid.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svttglyf.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/services/svpostnm.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/ftrfork.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/internal/ftcalc.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftoutln.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftadvanc.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftsynth.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/fterrors.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftgasp.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftstroke.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/freetype.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftincrem.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftfntfmt.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/fterrdef.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ttnameid.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftchapters.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/tttags.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftsystem.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/t1tables.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftimage.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/tttables.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftcid.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftglyph.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftmoderr.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftbitmap.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftlist.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftmac.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftlcdfil.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftbdf.h + ../../../src/java.desktop/share/native/libfreetype/include/freetype/ftrender.h + ../../../src/java.desktop/share/native/libfreetype/include/ft2build.h + ../../../src/java.desktop/share/native/libfreetype/src/type1/t1objs.c + ../../../src/java.desktop/share/native/libfreetype/src/type1/t1load.h + ../../../src/java.desktop/share/native/libfreetype/src/type1/t1afm.h + ../../../src/java.desktop/share/native/libfreetype/src/type1/t1driver.h + ../../../src/java.desktop/share/native/libfreetype/src/type1/t1tokens.h + ../../../src/java.desktop/share/native/libfreetype/src/type1/t1errors.h + ../../../src/java.desktop/share/native/libfreetype/src/type1/t1gload.c + ../../../src/java.desktop/share/native/libfreetype/src/type1/t1parse.h + ../../../src/java.desktop/share/native/libfreetype/src/type1/t1afm.c + ../../../src/java.desktop/share/native/libfreetype/src/type1/t1load.c + ../../../src/java.desktop/share/native/libfreetype/src/type1/t1objs.h + ../../../src/java.desktop/share/native/libfreetype/src/type1/t1driver.c + ../../../src/java.desktop/share/native/libfreetype/src/type1/t1parse.c + ../../../src/java.desktop/share/native/libfreetype/src/type1/t1gload.h + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/sfobjs.c + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/ttcmap.h + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/ttpost.h + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/sfntpic.h + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/ttkern.c + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/pngshim.h + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/ttmtx.c + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/ttload.h + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/sfdriver.c + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/ttsbit.c + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/ttcmapc.h + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/ttkern.h + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/ttpost.c + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/sfntpic.c + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/sfobjs.h + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/ttcmap.c + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/ttmtx.h + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/pngshim.c + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/ttsbit.h + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/sfdriver.h + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/ttload.c + ../../../src/java.desktop/share/native/libfreetype/src/sfnt/sferrors.h + ../../../src/java.desktop/share/native/libfreetype/src/smooth/ftgrays.c + ../../../src/java.desktop/share/native/libfreetype/src/smooth/ftsmooth.h + ../../../src/java.desktop/share/native/libfreetype/src/smooth/ftspic.h + ../../../src/java.desktop/share/native/libfreetype/src/smooth/ftsmerrs.h + ../../../src/java.desktop/share/native/libfreetype/src/smooth/ftgrays.h + ../../../src/java.desktop/share/native/libfreetype/src/smooth/ftspic.c + ../../../src/java.desktop/share/native/libfreetype/src/smooth/ftsmooth.c + ../../../src/java.desktop/share/native/libfreetype/src/cff/cffload.h + ../../../src/java.desktop/share/native/libfreetype/src/cff/cffgload.c + ../../../src/java.desktop/share/native/libfreetype/src/cff/cffobjs.c + ../../../src/java.desktop/share/native/libfreetype/src/cff/cffparse.h + ../../../src/java.desktop/share/native/libfreetype/src/cff/cffpic.h + ../../../src/java.desktop/share/native/libfreetype/src/cff/cffcmap.h + ../../../src/java.desktop/share/native/libfreetype/src/cff/cffdrivr.c + ../../../src/java.desktop/share/native/libfreetype/src/cff/cffparse.c + ../../../src/java.desktop/share/native/libfreetype/src/cff/cfftoken.h + ../../../src/java.desktop/share/native/libfreetype/src/cff/cffobjs.h + ../../../src/java.desktop/share/native/libfreetype/src/cff/cffgload.h + ../../../src/java.desktop/share/native/libfreetype/src/cff/cffload.c + ../../../src/java.desktop/share/native/libfreetype/src/cff/cffpic.c + ../../../src/java.desktop/share/native/libfreetype/src/cff/cffdrivr.h + ../../../src/java.desktop/share/native/libfreetype/src/cff/cffcmap.c + ../../../src/java.desktop/share/native/libfreetype/src/cff/cfferrs.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psarrst.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psstack.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/cffdecode.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psblues.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psauxerr.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/pserror.c + ../../../src/java.desktop/share/native/libfreetype/src/psaux/t1decode.c + ../../../src/java.desktop/share/native/libfreetype/src/psaux/pshints.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psfont.c + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psobjs.c + ../../../src/java.desktop/share/native/libfreetype/src/psaux/t1cmap.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psread.c + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psconv.c + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psauxmod.c + ../../../src/java.desktop/share/native/libfreetype/src/psaux/afmparse.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psintrp.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psft.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psglue.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psstack.c + ../../../src/java.desktop/share/native/libfreetype/src/psaux/cffdecode.c + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psblues.c + ../../../src/java.desktop/share/native/libfreetype/src/psaux/pstypes.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psfixed.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psarrst.c + ../../../src/java.desktop/share/native/libfreetype/src/psaux/pshints.c + ../../../src/java.desktop/share/native/libfreetype/src/psaux/pserror.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/t1decode.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/t1cmap.c + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psobjs.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psfont.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psintrp.c + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psft.c + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psconv.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/afmparse.c + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psauxmod.h + ../../../src/java.desktop/share/native/libfreetype/src/psaux/psread.h + ../../../src/java.desktop/share/native/libfreetype/src/cid/cidtoken.h + ../../../src/java.desktop/share/native/libfreetype/src/cid/cidriver.c + ../../../src/java.desktop/share/native/libfreetype/src/cid/cidparse.c + ../../../src/java.desktop/share/native/libfreetype/src/cid/cidgload.h + ../../../src/java.desktop/share/native/libfreetype/src/cid/cidload.c + ../../../src/java.desktop/share/native/libfreetype/src/cid/cidobjs.h + ../../../src/java.desktop/share/native/libfreetype/src/cid/ciderrs.h + ../../../src/java.desktop/share/native/libfreetype/src/cid/cidgload.c + ../../../src/java.desktop/share/native/libfreetype/src/cid/cidriver.h + ../../../src/java.desktop/share/native/libfreetype/src/cid/cidparse.h + ../../../src/java.desktop/share/native/libfreetype/src/cid/cidobjs.c + ../../../src/java.desktop/share/native/libfreetype/src/cid/cidload.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afindic.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afdummy.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afmodule.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afwarp.c + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afpic.c + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afglobal.c + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afcover.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afwrtsys.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afblue.c + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afshaper.c + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afhints.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afangles.c + ../../../src/java.desktop/share/native/libfreetype/src/autofit/aflatin.c + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afloader.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afranges.c + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afcjk.c + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afstyles.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/aferrors.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afdummy.c + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afindic.c + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afpic.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afglobal.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afwarp.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afmodule.c + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afblue.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afshaper.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afscript.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/aftypes.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afcjk.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afranges.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afloader.c + ../../../src/java.desktop/share/native/libfreetype/src/autofit/aflatin.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afangles.h + ../../../src/java.desktop/share/native/libfreetype/src/autofit/afhints.c + ../../../src/java.desktop/share/native/libfreetype/src/pshinter/pshmod.c + ../../../src/java.desktop/share/native/libfreetype/src/pshinter/pshrec.h + ../../../src/java.desktop/share/native/libfreetype/src/pshinter/pshpic.c + ../../../src/java.desktop/share/native/libfreetype/src/pshinter/pshglob.h + ../../../src/java.desktop/share/native/libfreetype/src/pshinter/pshalgo.c + ../../../src/java.desktop/share/native/libfreetype/src/pshinter/pshmod.h + ../../../src/java.desktop/share/native/libfreetype/src/pshinter/pshnterr.h + ../../../src/java.desktop/share/native/libfreetype/src/pshinter/pshpic.h + ../../../src/java.desktop/share/native/libfreetype/src/pshinter/pshrec.c + ../../../src/java.desktop/share/native/libfreetype/src/pshinter/pshalgo.h + ../../../src/java.desktop/share/native/libfreetype/src/pshinter/pshglob.c + ../../../src/java.desktop/share/native/libfreetype/src/truetype/ttinterp.c + ../../../src/java.desktop/share/native/libfreetype/src/truetype/ttpload.c + ../../../src/java.desktop/share/native/libfreetype/src/truetype/ttgxvar.c + ../../../src/java.desktop/share/native/libfreetype/src/truetype/ttsubpix.h + ../../../src/java.desktop/share/native/libfreetype/src/truetype/tterrors.h + ../../../src/java.desktop/share/native/libfreetype/src/truetype/ttdriver.h + ../../../src/java.desktop/share/native/libfreetype/src/truetype/ttpic.h + ../../../src/java.desktop/share/native/libfreetype/src/truetype/ttobjs.c + ../../../src/java.desktop/share/native/libfreetype/src/truetype/ttgload.h + ../../../src/java.desktop/share/native/libfreetype/src/truetype/ttgxvar.h + ../../../src/java.desktop/share/native/libfreetype/src/truetype/ttpload.h + ../../../src/java.desktop/share/native/libfreetype/src/truetype/ttinterp.h + ../../../src/java.desktop/share/native/libfreetype/src/truetype/ttpic.c + ../../../src/java.desktop/share/native/libfreetype/src/truetype/ttdriver.c + ../../../src/java.desktop/share/native/libfreetype/src/truetype/ttsubpix.c + ../../../src/java.desktop/share/native/libfreetype/src/truetype/ttobjs.h + ../../../src/java.desktop/share/native/libfreetype/src/truetype/ttgload.c + ../../../src/java.desktop/share/native/libfreetype/src/raster/ftmisc.h + ../../../src/java.desktop/share/native/libfreetype/src/raster/rasterrs.h + ../../../src/java.desktop/share/native/libfreetype/src/raster/rastpic.c + ../../../src/java.desktop/share/native/libfreetype/src/raster/ftrend1.h + ../../../src/java.desktop/share/native/libfreetype/src/raster/ftraster.h + ../../../src/java.desktop/share/native/libfreetype/src/raster/rastpic.h + ../../../src/java.desktop/share/native/libfreetype/src/raster/ftraster.c + ../../../src/java.desktop/share/native/libfreetype/src/raster/ftrend1.c + ../../../src/java.desktop/share/native/libfreetype/src/psnames/psnamerr.h + ../../../src/java.desktop/share/native/libfreetype/src/psnames/psmodule.c + ../../../src/java.desktop/share/native/libfreetype/src/psnames/pspic.h + ../../../src/java.desktop/share/native/libfreetype/src/psnames/pstables.h + ../../../src/java.desktop/share/native/libfreetype/src/psnames/psmodule.h + ../../../src/java.desktop/share/native/libfreetype/src/psnames/pspic.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftobjs.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftfntfmt.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftinit.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftapi.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftdbgmem.c + ../../../src/java.desktop/share/native/libfreetype/src/base/fthash.c + ../../../src/java.desktop/share/native/libfreetype/src/base/basepic.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftpic.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftbitmap.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftpsprop.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftcid.c + ../../../src/java.desktop/share/native/libfreetype/src/base/md5.h + ../../../src/java.desktop/share/native/libfreetype/src/base/ftglyph.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftgloadr.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftsystem.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftrfork.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftcalc.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftpatent.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftlcdfil.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftutil.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftmac.c + ../../../src/java.desktop/share/native/libfreetype/src/base/fttype1.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftsnames.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftdebug.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftmm.c + ../../../src/java.desktop/share/native/libfreetype/src/base/basepic.h + ../../../src/java.desktop/share/native/libfreetype/src/base/ftbase.h + ../../../src/java.desktop/share/native/libfreetype/src/base/ftfstype.c + ../../../src/java.desktop/share/native/libfreetype/src/base/fttrigon.c + ../../../src/java.desktop/share/native/libfreetype/src/base/md5.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftbbox.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftstroke.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftgasp.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftsynth.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftadvanc.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftstream.c + ../../../src/java.desktop/share/native/libfreetype/src/base/ftoutln.c + ../../../src/java.desktop/share/native/include/jawt.h + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLRenderQueue.h + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLMaskFill.h + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLBlitLoops.c + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLMaskBlit.c + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLVertexCache.h + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLRenderer.c + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLPaints.c + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLSurfaceData.h + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLBufImgOps.h + ../../../src/java.desktop/share/native/common/java2d/opengl/J2D_GL/glext.h + ../../../src/java.desktop/share/native/common/java2d/opengl/J2D_GL/gl.h + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLTextRenderer.c + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLFuncs.c + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLContext.c + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLBlitLoops.h + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLMaskFill.c + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLRenderQueue.c + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLVertexCache.c + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLMaskBlit.h + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLRenderer.h + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLBufImgOps.c + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLFuncMacros.h + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLSurfaceData.c + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLPaints.h + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLContext.h + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLFuncs.h + ../../../src/java.desktop/share/native/common/java2d/opengl/OGLTextRenderer.h + ../../../src/java.desktop/share/native/common/awt/medialib/mlib_ImageCopy_Bit.c + ../../../src/java.desktop/share/native/common/awt/medialib/mlib_ImageCreate.c + ../../../src/java.desktop/share/native/common/awt/medialib/mlib_sys.c + ../../../src/java.desktop/share/native/common/awt/debug/debug_util.h + ../../../src/java.desktop/share/native/common/awt/debug/debug_assert.c + ../../../src/java.desktop/share/native/common/awt/debug/debug_mem.h + ../../../src/java.desktop/share/native/common/awt/debug/debug_trace.h + ../../../src/java.desktop/share/native/common/awt/debug/debug_assert.h + ../../../src/java.desktop/share/native/common/awt/debug/debug_mem.c + ../../../src/java.desktop/share/native/common/awt/debug/debug_util.c + ../../../src/java.desktop/share/native/common/awt/debug/debug_trace.c + ../../../src/java.desktop/share/native/common/awt/utility/rect.c + ../../../src/java.desktop/share/native/common/font/AccelGlyphCache.c + ../../../src/java.desktop/share/native/common/font/sunfontids.h + ../../../src/java.desktop/share/native/common/font/AccelGlyphCache.h + ../../../src/java.desktop/share/native/common/font/fontscalerdefs.h + ../../../src/java.desktop/share/native/libawt/java2d/Trace.c + ../../../src/java.desktop/share/native/libawt/java2d/pipe/BufferedRenderPipe.c + ../../../src/java.desktop/share/native/libawt/java2d/pipe/SpanClipRenderer.c + ../../../src/java.desktop/share/native/libawt/java2d/pipe/BufferedMaskBlit.c + ../../../src/java.desktop/share/native/libawt/java2d/pipe/Region.c + ../../../src/java.desktop/share/native/libawt/java2d/pipe/Region.h + ../../../src/java.desktop/share/native/libawt/java2d/pipe/SpanIterator.h + ../../../src/java.desktop/share/native/libawt/java2d/pipe/PathConsumer2D.h + ../../../src/java.desktop/share/native/libawt/java2d/pipe/ShapeSpanIterator.c + ../../../src/java.desktop/share/native/libawt/java2d/Disposer.h + ../../../src/java.desktop/share/native/libawt/java2d/SurfaceData.h + ../../../src/java.desktop/share/native/libawt/java2d/Trace.h + ../../../src/java.desktop/share/native/libawt/java2d/SurfaceData.c + ../../../src/java.desktop/share/native/libawt/java2d/Disposer.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/AlphaMacros.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/Any4Byte.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/GraphicsPrimitiveMgr.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/AnyByte.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/UshortGray.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/Ushort555Rgbx.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/IntArgb.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/IntArgbPre.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/Index8Gray.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/FourByteAbgrPre.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/ByteIndexed.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/Blit.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/Ushort4444Argb.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/ByteBinary2Bit.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/UshortIndexed.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/TransformHelper.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/Index12Gray.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/Ushort555Rgb.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/LineUtils.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/GlyphImageRef.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/FourByteAbgr.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/AnyShort.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/ScaledBlit.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/ImageData.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/ByteBinary1Bit.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/IntRgb.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/IntRgbx.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/BlitBg.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/ByteGray.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/IntBgr.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/FillRect.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/ProcessPath.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/ThreeByteBgr.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/MaskFill.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/AnyInt.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/DrawPath.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/Any3Byte.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/MapAccelFunc.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/IntArgbBm.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/Ushort565Rgb.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/ByteBinary4Bit.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/Index8Gray.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/IntArgbPre.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/FillParallelogram.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/IntArgb.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/IntDcm.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/Ushort555Rgbx.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/UshortGray.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/DrawLine.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/LoopMacros.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/AnyByte.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/GraphicsPrimitiveMgr.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/Any4Byte.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/AlphaMacros.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/AnyShort.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/AnyByteBinary.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/DrawPolygons.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/Ushort555Rgb.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/FourByteAbgr.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/Ushort4444Argb.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/Index12Gray.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/UshortIndexed.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/ByteBinary2Bit.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/ByteIndexed.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/FourByteAbgrPre.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/DrawRect.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/MaskBlit.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/IntBgr.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/ByteGray.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/FillPath.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/DrawParallelogram.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/IntRgbx.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/IntRgb.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/ByteBinary1Bit.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/ParallelogramUtils.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/Ushort565Rgb.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/FillSpans.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/IntArgbBm.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/ByteBinary4Bit.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/Any3Byte.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/DrawPath.h + ../../../src/java.desktop/share/native/libawt/java2d/loops/AnyInt.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/ThreeByteBgr.c + ../../../src/java.desktop/share/native/libawt/java2d/loops/ProcessPath.c + ../../../src/java.desktop/share/native/libawt/awt/image/dither.h + ../../../src/java.desktop/share/native/libawt/awt/image/imageInitIDs.c + ../../../src/java.desktop/share/native/libawt/awt/image/awt_parseImage.c + ../../../src/java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.h + ../../../src/java.desktop/share/native/libawt/awt/image/awt_ImageRep.c + ../../../src/java.desktop/share/native/libawt/awt/image/DataBufferNative.c + ../../../src/java.desktop/share/native/libawt/awt/image/imageInitIDs.h + ../../../src/java.desktop/share/native/libawt/awt/image/dither.c + ../../../src/java.desktop/share/native/libawt/awt/image/BufImgSurfaceData.c + ../../../src/java.desktop/share/native/libawt/awt/image/awt_parseImage.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_dirdither.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_colors.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_alpha.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_ordclruns.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_output8_16_24.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_opaque.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_fsdither.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_dcm.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_output32.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_output8_32.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_fsgray.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_ordclrsgn.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_scaleloop.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_dir8dither.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_dcm8.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_globals.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_output24.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_orddither.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_colors.c + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_fscolor.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_nodither.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_noscale.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_replscale.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_output8_16_32.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_ordgray.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_util.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_icm.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_input8.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_output16.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_output16_32.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_fsutil.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_input32.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_globals.c + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_input8_32.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_anycm.h + ../../../src/java.desktop/share/native/libawt/awt/image/cvutils/img_output8.h + ../../../src/java.desktop/share/native/libawt/awt/image/gif/gifdecoder.c + ../../../src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.h + ../../../src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c + ../../../src/java.desktop/share/native/libjavajpeg/jpeglib.h + ../../../src/java.desktop/share/native/libjavajpeg/jddctmgr.c + ../../../src/java.desktop/share/native/libjavajpeg/jdphuff.c + ../../../src/java.desktop/share/native/libjavajpeg/jerror.h + ../../../src/java.desktop/share/native/libjavajpeg/jidctfst.c + ../../../src/java.desktop/share/native/libjavajpeg/jdhuff.c + ../../../src/java.desktop/share/native/libjavajpeg/jdinput.c + ../../../src/java.desktop/share/native/libjavajpeg/jdtrans.c + ../../../src/java.desktop/share/native/libjavajpeg/jcmaster.c + ../../../src/java.desktop/share/native/libjavajpeg/jdapistd.c + ../../../src/java.desktop/share/native/libjavajpeg/jcapimin.c + ../../../src/java.desktop/share/native/libjavajpeg/jdmarker.c + ../../../src/java.desktop/share/native/libjavajpeg/jdmerge.c + ../../../src/java.desktop/share/native/libjavajpeg/jdcolor.c + ../../../src/java.desktop/share/native/libjavajpeg/jfdctflt.c + ../../../src/java.desktop/share/native/libjavajpeg/jcparam.c + ../../../src/java.desktop/share/native/libjavajpeg/jccoefct.c + ../../../src/java.desktop/share/native/libjavajpeg/jfdctint.c + ../../../src/java.desktop/share/native/libjavajpeg/jcsample.c + ../../../src/java.desktop/share/native/libjavajpeg/jcmainct.c + ../../../src/java.desktop/share/native/libjavajpeg/jchuff.c + ../../../src/java.desktop/share/native/libjavajpeg/jmemnobs.c + ../../../src/java.desktop/share/native/libjavajpeg/jcprepct.c + ../../../src/java.desktop/share/native/libjavajpeg/jdhuff.h + ../../../src/java.desktop/share/native/libjavajpeg/jmemsys.h + ../../../src/java.desktop/share/native/libjavajpeg/jccolor.c + ../../../src/java.desktop/share/native/libjavajpeg/jerror.c + ../../../src/java.desktop/share/native/libjavajpeg/jquant1.c + ../../../src/java.desktop/share/native/libjavajpeg/jcdctmgr.c + ../../../src/java.desktop/share/native/libjavajpeg/jutils.c + ../../../src/java.desktop/share/native/libjavajpeg/jconfig.h + ../../../src/java.desktop/share/native/libjavajpeg/jcapistd.c + ../../../src/java.desktop/share/native/libjavajpeg/jmorecfg.h + ../../../src/java.desktop/share/native/libjavajpeg/jfdctfst.c + ../../../src/java.desktop/share/native/libjavajpeg/jdmaster.c + ../../../src/java.desktop/share/native/libjavajpeg/jdct.h + ../../../src/java.desktop/share/native/libjavajpeg/jversion.h + ../../../src/java.desktop/share/native/libjavajpeg/jinclude.h + ../../../src/java.desktop/share/native/libjavajpeg/jcomapi.c + ../../../src/java.desktop/share/native/libjavajpeg/jcphuff.c + ../../../src/java.desktop/share/native/libjavajpeg/jmemmgr.c + ../../../src/java.desktop/share/native/libjavajpeg/jpegdecoder.c + ../../../src/java.desktop/share/native/libjavajpeg/jcmarker.c + ../../../src/java.desktop/share/native/libjavajpeg/jquant2.c + ../../../src/java.desktop/share/native/libjavajpeg/jidctint.c + ../../../src/java.desktop/share/native/libjavajpeg/jdapimin.c + ../../../src/java.desktop/share/native/libjavajpeg/jctrans.c + ../../../src/java.desktop/share/native/libjavajpeg/imageioJPEG.c + ../../../src/java.desktop/share/native/libjavajpeg/jidctflt.c + ../../../src/java.desktop/share/native/libjavajpeg/jcinit.c + ../../../src/java.desktop/share/native/libjavajpeg/jchuff.h + ../../../src/java.desktop/share/native/libjavajpeg/jdmainct.c + ../../../src/java.desktop/share/native/libjavajpeg/jdcoefct.c + ../../../src/java.desktop/share/native/libjavajpeg/jdsample.c + ../../../src/java.desktop/share/native/libjavajpeg/jidctred.c + ../../../src/java.desktop/share/native/libjavajpeg/jpegint.h + ../../../src/java.desktop/share/native/libjavajpeg/jdpostct.c + ../../../src/java.desktop/share/native/libfontmanager/DrawGlyphList.c + ../../../src/java.desktop/share/native/libfontmanager/HBShaper.c + ../../../src/java.desktop/share/native/libfontmanager/scriptMapping.c + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-version.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-coretext.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-tag.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-deprecated.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn/ucdn.c + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn/ucdn.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn/ucdn_db.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape-plan.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-font.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-unicode.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-map.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-subset.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-math.h + ../../../src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ft.h + ../../../src/java.desktop/share/native/libfontmanager/glyphblitting.h + ../../../src/java.desktop/share/native/libfontmanager/hb-jdk.h + ../../../src/java.desktop/share/native/libfontmanager/freetypeScaler.c + ../../../src/java.desktop/share/native/libfontmanager/scriptMapping.h + ../../../src/java.desktop/share/native/libfontmanager/sunFont.c + ../../../src/java.desktop/share/native/libfontmanager/fontscaler.h + ../../../src/java.desktop/share/native/liblcms/cmsps2.c + ../../../src/java.desktop/share/native/liblcms/cmstypes.c + ../../../src/java.desktop/share/native/liblcms/cmscgats.c + ../../../src/java.desktop/share/native/liblcms/cmslut.c + ../../../src/java.desktop/share/native/liblcms/cmsopt.c + ../../../src/java.desktop/share/native/liblcms/cmssamp.c + ../../../src/java.desktop/share/native/liblcms/cmscnvrt.c + ../../../src/java.desktop/share/native/liblcms/cmsmtrx.c + ../../../src/java.desktop/share/native/liblcms/lcms2.h + ../../../src/java.desktop/share/native/liblcms/cmsplugin.c + ../../../src/java.desktop/share/native/liblcms/cmswtpnt.c + ../../../src/java.desktop/share/native/liblcms/LCMS.c + ../../../src/java.desktop/share/native/liblcms/cmsnamed.c + ../../../src/java.desktop/share/native/liblcms/cmsalpha.c + ../../../src/java.desktop/share/native/liblcms/cmsio0.c + ../../../src/java.desktop/share/native/liblcms/cmsgamma.c + ../../../src/java.desktop/share/native/liblcms/cmscam02.c + ../../../src/java.desktop/share/native/liblcms/cmssm.c + ../../../src/java.desktop/share/native/liblcms/cmsxform.c + ../../../src/java.desktop/share/native/liblcms/cmsvirt.c + ../../../src/java.desktop/share/native/liblcms/cmserr.c + ../../../src/java.desktop/share/native/liblcms/cmsio1.c + ../../../src/java.desktop/share/native/liblcms/lcms2_internal.h + ../../../src/java.desktop/share/native/liblcms/cmsgmt.c + ../../../src/java.desktop/share/native/liblcms/cmspcs.c + ../../../src/java.desktop/share/native/liblcms/cmspack.c + ../../../src/java.desktop/share/native/liblcms/lcms2_plugin.h + ../../../src/java.desktop/share/native/liblcms/cmsmd5.c + ../../../src/java.desktop/share/native/liblcms/cmsintrp.c + ../../../src/java.desktop/share/native/liblcms/cmshalf.c + ../../../src/java.desktop/share/native/libsplashscreen/libpng/pnginfo.h + ../../../src/java.desktop/share/native/libsplashscreen/libpng/pngrio.c + ../../../src/java.desktop/share/native/libsplashscreen/libpng/pngerror.c + ../../../src/java.desktop/share/native/libsplashscreen/libpng/pngstruct.h + ../../../src/java.desktop/share/native/libsplashscreen/libpng/pngtrans.c + ../../../src/java.desktop/share/native/libsplashscreen/libpng/pngpriv.h + ../../../src/java.desktop/share/native/libsplashscreen/libpng/png.h + ../../../src/java.desktop/share/native/libsplashscreen/libpng/pnglibconf.h + ../../../src/java.desktop/share/native/libsplashscreen/libpng/pngconf.h + ../../../src/java.desktop/share/native/libsplashscreen/libpng/pngpread.c + ../../../src/java.desktop/share/native/libsplashscreen/libpng/pngdebug.h + ../../../src/java.desktop/share/native/libsplashscreen/libpng/pngread.c + ../../../src/java.desktop/share/native/libsplashscreen/libpng/pngmem.c + ../../../src/java.desktop/share/native/libsplashscreen/libpng/pngget.c + ../../../src/java.desktop/share/native/libsplashscreen/libpng/png.c + ../../../src/java.desktop/share/native/libsplashscreen/libpng/pngrtran.c + ../../../src/java.desktop/share/native/libsplashscreen/libpng/pngrutil.c + ../../../src/java.desktop/share/native/libsplashscreen/libpng/pngset.c + ../../../src/java.desktop/share/native/libsplashscreen/splashscreen_gfx_impl.h + ../../../src/java.desktop/share/native/libsplashscreen/splashscreen_gfx.h + ../../../src/java.desktop/share/native/libsplashscreen/splashscreen_impl.h + ../../../src/java.desktop/share/native/libsplashscreen/splashscreen_png.c + ../../../src/java.desktop/share/native/libsplashscreen/splashscreen_gif.c + ../../../src/java.desktop/share/native/libsplashscreen/splashscreen_jpeg.c + ../../../src/java.desktop/share/native/libsplashscreen/giflib/dgif_lib.c + ../../../src/java.desktop/share/native/libsplashscreen/giflib/gif_hash.h + ../../../src/java.desktop/share/native/libsplashscreen/giflib/gif_lib_private.h + ../../../src/java.desktop/share/native/libsplashscreen/giflib/openbsd-reallocarray.c + ../../../src/java.desktop/share/native/libsplashscreen/giflib/gifalloc.c + ../../../src/java.desktop/share/native/libsplashscreen/giflib/gif_lib.h + ../../../src/java.desktop/share/native/libsplashscreen/giflib/gif_err.c + ../../../src/java.desktop/share/native/libsplashscreen/java_awt_SplashScreen.c + ../../../src/java.desktop/share/native/libsplashscreen/splashscreen_gfx_impl.c + ../../../src/java.desktop/share/native/libsplashscreen/splashscreen_impl.c + ../../../src/jdk.jdwp.agent/share/native/include/jdwpTransport.h + ../../../src/hotspot/share/include/jmm.h + ../../../src/java.base/share/native/include/jni.h + ../../../src/java.base/share/native/include/jvmticmlr.h) + +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(SOURCE_FILES + ${SOURCE_FILES} + + ../../../src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiOut.c + ../../../src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Utils.cpp + ../../../src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp + ../../../src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.h + ../../../src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Utils.h + ../../../src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiIn.c + ../../../src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_PCM.cpp + ../../../src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c + ../../../src/java.desktop/macosx/native/include/jawt_md.h + ../../../src/java.desktop/macosx/native/libosx/CFileManager.m + ../../../src/java.desktop/macosx/native/libjawt/jawt.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBufImgOps.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLGraphicsConfig.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLContext.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPaints.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLVertexCache.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderQueue.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLMaskFill.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTextRenderer.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBlitLoops.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLSurfaceData.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLFuncs.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderer.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLMaskBlit.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLVertexCache.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPaints.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLContext.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLGraphicsConfig.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBufImgOps.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLSurfaceDataBase.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderQueue.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBlitLoops.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTextRenderer.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLMaskFill.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLMaskBlit.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderer.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLFuncs.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLSurfaceData.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLUtils.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLUtils.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTexturePool.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTexturePool.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPipelineStatesStorage.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPipelineStatesStorage.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLSurfaceData.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/J2D_GL/cglext.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLGraphicsConfig.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLLayer.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLSurfaceData.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLGraphicsConfig.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/CGLLayer.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/java2d/opengl/OGLFuncs_md.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/DnDUtilities.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/ImageSurfaceData.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CDragSource.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CMenu.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuBar.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/QuartzSurfaceData.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/PrinterSurfaceData.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CSystemColors.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/JavaTextAccessibility.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CDataTransferer.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsEnv.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CRobotKeyCode.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CClipboard.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CPopupMenu.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CInputMethod.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/awt_DrawingSurface.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuItem.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityUtilities.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuComponent.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/GeomUtilities.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/AWTSurfaceLayers.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CDragSourceContextPeer.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/PrinterView.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/ApplicationDelegate.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/InitIDs.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CDropTarget.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityAction.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/OSVersion.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CGraphicsDevice.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CFileDialog.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CDesktopPeer.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/PrintModel.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuItem.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CPopupMenu.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/QuartzRenderer.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CImage.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CRobotKeyCode.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CDataTransferer.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CSystemColors.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/JavaTextAccessibility.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/PrinterSurfaceData.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CPrinterJob.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuBar.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/QuartzSurfaceData.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/common.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CMenu.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/ImageSurfaceData.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CDragSource.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CCursorManager.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/DnDUtilities.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CRobot.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/AWTSurfaceLayers.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CFRetainedResource.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/GeomUtilities.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuComponent.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityUtilities.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CWrapper.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/OSVersion.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/JavaAccessibilityAction.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/AWTEvent.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CDropTarget.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/InitIDs.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/ApplicationDelegate.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CTextPipe.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/PrinterView.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/PrintModel.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CTrayIcon.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CDropTargetContextPeer.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/LWCToolkit.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/CFileDialog.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/awt/JavaComponentAccessibility.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/font/AWTFont.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/font/CoreTextSupport.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphOutlines.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/font/AWTStrike.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/font/CCharToGlyphMapper.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/font/AWTFont.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphOutlines.h + ../../../src/java.desktop/macosx/native/libawt_lwawt/font/CoreTextSupport.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/font/AWTStrike.m + ../../../src/java.desktop/macosx/native/libawt_lwawt/font/CGGlyphImages.h + ../../../src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.h + ../../../src/java.desktop/macosx/native/libosxapp/ThreadUtilities.m + ../../../src/java.desktop/macosx/native/libosxapp/QueuingApplicationDelegate.m + ../../../src/java.desktop/macosx/native/libosxapp/AWT_debug.m + ../../../src/java.desktop/macosx/native/libosxapp/PropertiesUtilities.m + ../../../src/java.desktop/macosx/native/libosxapp/ThreadUtilities.h + ../../../src/java.desktop/macosx/native/libosxapp/NSApplicationAWT.m + ../../../src/java.desktop/macosx/native/libosxapp/QueuingApplicationDelegate.h + ../../../src/java.desktop/macosx/native/libosxapp/PropertiesUtilities.h + ../../../src/java.desktop/macosx/native/libosxapp/AWT_debug.h + ../../../src/java.desktop/macosx/native/libsplashscreen/splashscreen_config.h + ../../../src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m + ../../../src/java.desktop/macosx/native/libosxui/JRSUIController.m + ../../../src/java.desktop/macosx/native/libosxui/AquaFileView.m + ../../../src/java.desktop/macosx/native/libosxui/AquaNativeResources.m + ../../../src/java.desktop/macosx/native/libosxui/JRSUIConstantSync.h + ../../../src/java.desktop/macosx/native/libosxui/ScreenMenu.h + ../../../src/java.desktop/macosx/native/libosxui/JRSUIFocus.m + ../../../src/java.desktop/macosx/native/libosxui/JRSUIConstantSync.m + ../../../src/java.desktop/macosx/native/libosxui/AquaLookAndFeel.m + ../../../src/java.desktop/macosx/native/libosxui/ScreenMenu.m) +endif() + +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux") + set(SOURCE_FILES + ${SOURCE_FILES} + ../../../src/java.desktop/unix/native/include/jawt_md.h + + ../../../src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_MidiUtils.c + ../../../src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_PCMUtils.h + ../../../src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_Ports.c + ../../../src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_MidiIn.c + ../../../src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_MidiOut.c + ../../../src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_PCM.c + ../../../src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_CommonUtils.h + ../../../src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_PCMUtils.c + ../../../src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_MidiUtils.h + ../../../src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_CommonUtils.c + + ../../../src/java.desktop/unix/native/libawt_headless/awt/HeadlessToolkit.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageConvMxN_8ext.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageAffine_BL_U16.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpSIS32U16Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageConvCopyEdge.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpU8S32Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpSIU8S32Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageConvMxN_8.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpSIU8S16Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpU8S16Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpSIS32U8Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageFilters.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpS32U8Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpSIU16S16Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageAffine_BL_S16.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpSIU16S32Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpFunc.h + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpS16S16Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUp.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageChannelExtract_43.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpS16S32Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageConvClearEdge.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpU16U16Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpSIU8U8Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpSIS16U16Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpU8U8Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageAffine_NN.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageConvVersion.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpS16U8Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpSIS16U8Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageAffine_BL.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpS32S32Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpS32S16Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpSIU16U8Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpU16U8Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageAffine_BC.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpSIU16U16Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_ImageConvCopyEdge_Fp.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpS16U16Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageAffine_BC_S16.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpSIS32S16Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpSIS32S32Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageAffine_BL_S16.h + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpSIU8U16Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpU8U16Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageChannelInsert.h + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageFilters.h + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageAffine_BC_U16.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpS32U16Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageChannelExtract_1.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpU16S32Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageConv.h + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageConv_8nw.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpU16S16Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageChannelExtract.h + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageChannelInsert_1.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpSIS16S32Func.c + ../../../src/java.desktop/unix/native/libmlib_image/mlib_v_ImageLookUpSIS16S16Func.c + ../../../src/java.desktop/unix/native/include/jawt_md.h + ../../../src/java.desktop/unix/native/libjawt/jawt.c + ../../../src/java.desktop/unix/native/common/java2d/x11/X11SurfaceData.c + ../../../src/java.desktop/unix/native/common/java2d/x11/X11TextRenderer_md.c + ../../../src/java.desktop/unix/native/common/java2d/x11/X11FontScaler_md.c + ../../../src/java.desktop/unix/native/common/java2d/x11/X11SurfaceData.h + ../../../src/java.desktop/unix/native/common/java2d/x11/X11PMBlitLoops.c + ../../../src/java.desktop/unix/native/common/java2d/x11/X11Renderer.c + ../../../src/java.desktop/unix/native/common/java2d/opengl/GLXSurfaceData.c + ../../../src/java.desktop/unix/native/common/java2d/opengl/GLXGraphicsConfig.h + ../../../src/java.desktop/unix/native/common/java2d/opengl/J2D_GL/glxext.h + ../../../src/java.desktop/unix/native/common/java2d/opengl/J2D_GL/glx.h + ../../../src/java.desktop/unix/native/common/java2d/opengl/GLXGraphicsConfig.c + ../../../src/java.desktop/unix/native/common/java2d/opengl/GLXSurfaceData.h + ../../../src/java.desktop/unix/native/common/java2d/opengl/OGLFuncs_md.h + ../../../src/java.desktop/unix/native/common/awt/fontpath.c + ../../../src/java.desktop/unix/native/common/awt/awt_util.h + ../../../src/java.desktop/unix/native/common/awt/X11Color.c + ../../../src/java.desktop/unix/native/common/awt/systemscale/systemScale.c + ../../../src/java.desktop/unix/native/common/awt/systemscale/systemScale.h + ../../../src/java.desktop/unix/native/common/awt/CUPSfuncs.c + ../../../src/java.desktop/unix/native/common/awt/img_util_md.h + ../../../src/java.desktop/unix/native/common/awt/color.h + ../../../src/java.desktop/unix/native/common/awt/awt_GraphicsEnv.h + ../../../src/java.desktop/unix/native/common/awt/awt_Font.h + ../../../src/java.desktop/unix/native/common/awt/awt.h + ../../../src/java.desktop/unix/native/common/awt/awt_DrawingSurface.h + ../../../src/java.desktop/unix/native/common/awt/awt_p.h + ../../../src/java.desktop/unix/native/common/awt/colordata.h + ../../../src/java.desktop/unix/native/common/awt/medialib/mlib_v_ImageCopy_f.h + ../../../src/java.desktop/unix/native/common/awt/medialib/mlib_v_ImageCopy_f.c + ../../../src/java.desktop/unix/native/common/awt/medialib/vis_proto.h + ../../../src/java.desktop/unix/native/common/awt/awt_Mlib.h + ../../../src/java.desktop/unix/native/common/awt/awt_Component.h + ../../../src/java.desktop/unix/native/common/awt/awt_Font.c + ../../../src/java.desktop/unix/native/common/awt/utility/rect.h + ../../../src/java.desktop/unix/native/common/font/X11FontScaler.h + ../../../src/java.desktop/unix/native/libawt/java2d/j2d_md.h + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_UshortGray_FromRgb.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_Interp.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_ByteGray.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_ThreeByteBgr.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/mlib_v_ImageLogic.h + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_AlphaMacros.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_IntBgr.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_GlyphListXor.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/java2d_Mlib.h + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_IntArgbPre_Mask.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_GlyphList.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/mlib_v_ImageConstLogic.h + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_SrcOverMaskFill.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/mlib_v_ImageClear.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_SrcMaskFill.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/mlib_ImageLogic_proto.h + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_IntArgb.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/mlib_v_ImageClear_f.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_FourByteAbgr.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_IntArgbPre.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_XorBlit.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_FourByteAbgrPre.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_AlphaMaskBlit.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/mlib_v_ImageLogic_proto.h + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_IntRgbx.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_ByteGray_FromRgb.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/mlib_v_ImageZoom_NN_f.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_AlphaMacros.h + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_FuncArray.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/mlib_ImageCopy.h + ../../../src/java.desktop/unix/native/libawt/java2d/loops/mlib_v_ImageXor.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_IntRgb.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_SrcOverMaskBlit.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_ByteIndexed.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/java2d_Mlib.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_IntArgbBm.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_AlphaMaskFill.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_DrawLine.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_UshortGray.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/mlib_v_ImageClear_f.h + ../../../src/java.desktop/unix/native/libawt/java2d/loops/mlib_ImageZoom.h + ../../../src/java.desktop/unix/native/libawt/java2d/loops/mlib_ImageZoom_NN.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/vis_ByteGray_Mask.c + ../../../src/java.desktop/unix/native/libawt/java2d/loops/mlib_v_ImageConstXor.c + ../../../src/java.desktop/unix/native/libawt/awt/awt_Mlib.c + ../../../src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c + ../../../src/java.desktop/unix/native/libawt/awt/initIDs.c + ../../../src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRBackendNative.c + ../../../src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRSurfaceData.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/list.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/awt_DrawingSurface.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/swing_GTKStyle.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/awt_UNIXToolkit.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/swing_GTKEngine.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/wsutils.h + ../../../src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h + ../../../src/java.desktop/unix/native/libawt_xawt/awt/awt_Insets.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/awt_AWTEvent.h + ../../../src/java.desktop/unix/native/libawt_xawt/awt/awt_MenuComponent.h + ../../../src/java.desktop/unix/native/libawt_xawt/awt/multi_font.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/multiVis.h + ../../../src/java.desktop/unix/native/libawt_xawt/awt/awt_Event.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/awt_util.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/list.h + ../../../src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.h + ../../../src/java.desktop/unix/native/libawt_xawt/awt/awt_Insets.h + ../../../src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.h + ../../../src/java.desktop/unix/native/libawt_xawt/awt/awt_Robot.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/awt_Event.h + ../../../src/java.desktop/unix/native/libawt_xawt/awt/multiVis.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/canvas.h + ../../../src/java.desktop/unix/native/libawt_xawt/awt/awt_AWTEvent.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/multi_font.h + ../../../src/java.desktop/unix/native/libawt_xawt/awt/sun_awt_X11_GtkFileDialogPeer.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c + ../../../src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c + ../../../src/java.desktop/unix/native/libawt_xawt/xawt/awt_Desktop.c + ../../../src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c + ../../../src/java.desktop/unix/native/libawt_xawt/xawt/awt_Taskbar.c + ../../../src/java.desktop/unix/native/libawt_xawt/xawt/gnome_interface.c + ../../../src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c + ../../../src/java.desktop/unix/native/libawt_xawt/xawt/gnome_interface.h + ../../../src/java.desktop/unix/native/libawt_xawt/xawt/awt_Taskbar.h + ../../../src/java.desktop/unix/native/libawt_xawt/xawt/XWindow.c + ../../../src/java.desktop/unix/native/libfontmanager/X11FontScaler.c + ../../../src/java.desktop/unix/native/libfontmanager/X11TextRenderer.c + ../../../src/java.desktop/unix/native/libsplashscreen/splashscreen_config.h + ../../../src/java.desktop/unix/native/libsplashscreen/splashscreen_sys.c +) + +elseif("${CMAKE_SYSTEM_NAME}" MATCHES "CYGWIN") + set(SOURCE_FILES + ${SOURCE_FILES} + ../../../src/hotspot/os/windows/include/jvm_md.h + ../../../src/java.base/windows/native/include/jni_md.h + ../../../src/java.desktop/windows/native/include/jawt_md.h + + ../../../src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_Util.c + ../../../src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_MidiOut.c + ../../../src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_DirectSound.cpp + ../../../src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_Charset_Util.cpp + ../../../src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_Util.h + ../../../src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_MidiIn.cpp + ../../../src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_Charset_Util.h + ../../../src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_Ports.c + ../../../src/java.desktop/windows/native/include/jawt_md.h + ../../../src/java.desktop/windows/native/libjawt/jawt.cpp + ../../../src/java.desktop/windows/native/common/awt/systemscale/systemScale.h + ../../../src/java.desktop/windows/native/common/awt/systemscale/systemScale.cpp + ../../../src/java.desktop/windows/native/common/awt/utility/rect.h + ../../../src/java.desktop/windows/native/libawt/java2d/j2d_md.h + ../../../src/java.desktop/windows/native/libawt/java2d/windows/GDIWindowSurfaceData.h + ../../../src/java.desktop/windows/native/libawt/java2d/windows/WindowsFlags.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/windows/GDIBlitLoops.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/windows/WindowsFlags.h + ../../../src/java.desktop/windows/native/libawt/java2d/windows/GDIRenderer.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/windows/GDIWindowSurfaceData.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/opengl/J2D_GL/wglext.h + ../../../src/java.desktop/windows/native/libawt/java2d/opengl/WGLGraphicsConfig.c + ../../../src/java.desktop/windows/native/libawt/java2d/opengl/WGLSurfaceData.c + ../../../src/java.desktop/windows/native/libawt/java2d/opengl/WGLGraphicsConfig.h + ../../../src/java.desktop/windows/native/libawt/java2d/opengl/WGLSurfaceData.h + ../../../src/java.desktop/windows/native/libawt/java2d/opengl/OGLFuncs_md.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DBufImgOps.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DBufImgOps.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DTextRenderer.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DSurfaceData.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DContext.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DRenderQueue.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DGraphicsDevice.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DBlitLoops.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DPaints.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DVertexCacher.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DShaders.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DTextRenderer.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DPipelineManager.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DMaskFill.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DGlyphCache.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/ShaderList.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DRenderer.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DResourceManager.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DRenderQueue.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DPipeline.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DContext.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DMaskCache.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DMaskFill.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DBadHardware.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DGlyphCache.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DGraphicsDevice.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DVertexCacher.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/ShaderList.c + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DSurfaceData.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DMaskBlit.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DPaints.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DBlitLoops.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DResourceManager.cpp + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DPipelineManager.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DRenderer.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DMaskBlit.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DMaskCache.h + ../../../src/java.desktop/windows/native/libawt/java2d/d3d/D3DShaderGen.c + ../../../src/java.desktop/windows/native/libawt/windows/awt_FileDialog.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Pen.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_InputEvent.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Toolkit.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Menu.h + ../../../src/java.desktop/windows/native/libawt/windows/Devices.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Brush.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Clipboard.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_ScrollPane.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsDevice.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_DCHolder.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_PopupMenu.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_PrintControl.h + ../../../src/java.desktop/windows/native/libawt/windows/GDIHashtable.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_List.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Canvas.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Object.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_InputMethod.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_InputTextInfor.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_InputEvent.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp + ../../../src/java.desktop/windows/native/libawt/windows/ComCtl32Util.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Mlib.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_TextComponent.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Robot.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_DataTransferer.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Button.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Container.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_List.cpp + ../../../src/java.desktop/windows/native/libawt/windows/ObjectList.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_MenuBar.h + ../../../src/java.desktop/windows/native/libawt/windows/Hashtable.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Button.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_DesktopProperties.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Dimension.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_AWTEvent.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Rectangle.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_TextComponent.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Object.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Canvas.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsDevice.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_new.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_KeyEvent.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_PopupMenu.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Dialog.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_MouseEvent.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Choice.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_DCHolder.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_ole.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Window.cpp + ../../../src/java.desktop/windows/native/libawt/windows/img_util_md.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_CustomPaletteDef.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsConfig.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Pen.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Checkbox.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Container.h + ../../../src/java.desktop/windows/native/libawt/windows/CmdIDList.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_PrintControl.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_InputTextInfor.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Font.h + ../../../src/java.desktop/windows/native/libawt/windows/MouseInfo.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Color.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Panel.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_MenuBar.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Panel.h + ../../../src/java.desktop/windows/native/libawt/windows/stdhdrs.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_IconCursor.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_new.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_DrawingSurface.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Palette.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Color.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_TrayIcon.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Clipboard.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsEnv.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Taskbar.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_MenuItem.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_TextField.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_TextField.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Label.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_DataTransferer.cpp + ../../../src/java.desktop/windows/native/libawt/windows/Devices.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_ScrollPane.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Debug.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_PrintDialog.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Insets.h + ../../../src/java.desktop/windows/native/libawt/windows/awtmsg.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_KeyboardFocusManager.cpp + ../../../src/java.desktop/windows/native/libawt/windows/ComCtl32Util.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Scrollbar.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_KeyEvent.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_MouseEvent.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Component.cpp + ../../../src/java.desktop/windows/native/libawt/windows/Hashtable.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Frame.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_DnDDS.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_IconCursor.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Dialog.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Insets.cpp + ../../../src/java.desktop/windows/native/libawt/windows/colordata.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Font.cpp + ../../../src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp + ../../../src/java.desktop/windows/native/libawt/windows/DllUtil.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_DnDDS.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Event.cpp + ../../../src/java.desktop/windows/native/libawt/windows/initIDs.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_FileDialog.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Mlib.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_PrintDialog.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_DesktopProperties.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Cursor.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Scrollbar.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Dimension.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_ole.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Choice.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Event.h + ../../../src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp + ../../../src/java.desktop/windows/native/libawt/windows/CmdIDList.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Menu.cpp + ../../../src/java.desktop/windows/native/libawt/windows/GDIHashtable.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_AWTEvent.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_BitmapUtil.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_GDIObject.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Desktop.cpp + ../../../src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_BitmapUtil.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsConfig.cpp + ../../../src/java.desktop/windows/native/libawt/windows/mlib_types_md.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_TextArea.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Cursor.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_DrawingSurface.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_TrayIcon.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Brush.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Component.h + ../../../src/java.desktop/windows/native/libawt/windows/DllUtil.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_MenuItem.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_DnDDT.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_DnDDT.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Taskbar.h + ../../../src/java.desktop/windows/native/libawt/windows/alloc.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_TextArea.cpp + ../../../src/java.desktop/windows/native/libawt/windows/ObjectList.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Rectangle.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Label.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Debug.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_GDIObject.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Window.h + ../../../src/java.desktop/windows/native/libawt/windows/awt_Checkbox.cpp + ../../../src/java.desktop/windows/native/libawt/windows/awt_Palette.cpp + ../../../src/java.desktop/windows/native/libfontmanager/fontpath.c + ../../../src/java.desktop/windows/native/libfontmanager/lcdglyph.c + ../../../src/java.desktop/windows/native/libsplashscreen/splashscreen_config.h + ../../../src/java.desktop/windows/native/libsplashscreen/splashscreen_sys.c) +endif() + +add_executable(jdk ${SOURCE_FILES}) + +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + target_link_libraries(jdk ${JAVA_NATIVE_FOUNDATION}) +endif() + +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux") + target_link_libraries(jdk ${CMAKE_DL_LIBS}) +endif() --- /dev/null 2019-05-16 19:16:22.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/macos/MacOSFlags.java 2019-05-16 19:16:21.000000000 +0300 @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.macos; + +import java.security.PrivilegedAction; + +public class MacOSFlags { + + /** + * Description of command-line flags. All flags with [true|false] + * values + * metalEnabled: usage: "-Djb.java2d.metal=[true|false]" + */ + + private static boolean metalEnabled; + + static { + initJavaFlags(); + initNativeFlags(); + } + + private static native boolean initNativeFlags(); + + private static boolean getBooleanProp(String p, boolean defaultVal) { + String propString = System.getProperty(p); + boolean returnVal = defaultVal; + if (propString != null) { + if (propString.equals("true") || + propString.equals("t") || + propString.equals("True") || + propString.equals("T") || + propString.equals("")) // having the prop name alone + { // is equivalent to true + returnVal = true; + } else if (propString.equals("false") || + propString.equals("f") || + propString.equals("False") || + propString.equals("F")) + { + returnVal = false; + } + } + return returnVal; + } + + + private static boolean getPropertySet(String p) { + String propString = System.getProperty(p); + return (propString != null) ? true : false; + } + + private static void initJavaFlags() { + java.security.AccessController.doPrivileged( + (PrivilegedAction) () -> { + metalEnabled = getBooleanProp("jb.java2d.metal", false); + return null; + }); + } + + public static boolean isMetalEnabled() { + return metalEnabled; + } +} --- /dev/null 2019-05-16 19:16:23.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/metal/MTLBlitLoops.java 2019-05-16 19:16:22.000000000 +0300 @@ -0,0 +1,945 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.metal; + +import sun.java2d.SurfaceData; +import sun.java2d.loops.*; +import sun.java2d.pipe.Region; +import sun.java2d.pipe.RenderBuffer; +import sun.java2d.pipe.RenderQueue; +import sun.java2d.pipe.hw.AccelSurface; + +import java.awt.*; +import java.awt.geom.AffineTransform; +import java.awt.image.AffineTransformOp; +import java.awt.image.BufferedImage; +import java.awt.image.BufferedImageOp; +import java.lang.annotation.Native; +import java.lang.ref.WeakReference; + +import static sun.java2d.pipe.BufferedOpCodes.BLIT; +import static sun.java2d.pipe.BufferedOpCodes.SURFACE_TO_SW_BLIT; + +final class MTLBlitLoops { + + static void register() { + Blit blitIntArgbPreToSurface = + new MTLSwToSurfaceBlit(SurfaceType.IntArgbPre, + MTLSurfaceData.PF_INT_ARGB_PRE); + Blit blitIntArgbPreToTexture = + new MTLSwToTextureBlit(SurfaceType.IntArgbPre, + MTLSurfaceData.PF_INT_ARGB_PRE); + TransformBlit transformBlitIntArgbPreToSurface = + new MTLSwToSurfaceTransform(SurfaceType.IntArgbPre, + MTLSurfaceData.PF_INT_ARGB_PRE); + MTLSurfaceToSwBlit blitSurfaceToIntArgbPre = + new MTLSurfaceToSwBlit(SurfaceType.IntArgbPre, + MTLSurfaceData.PF_INT_ARGB_PRE); + + GraphicsPrimitive[] primitives = { + // surface->surface ops + new MTLSurfaceToSurfaceBlit(), + new MTLSurfaceToSurfaceScale(), + new MTLSurfaceToSurfaceTransform(), + + // render-to-texture surface->surface ops + new MTLRTTSurfaceToSurfaceBlit(), + new MTLRTTSurfaceToSurfaceScale(), + new MTLRTTSurfaceToSurfaceTransform(), + + // surface->sw ops + new MTLSurfaceToSwBlit(SurfaceType.IntArgb, + MTLSurfaceData.PF_INT_ARGB), + blitSurfaceToIntArgbPre, + + // sw->surface ops + blitIntArgbPreToSurface, + new MTLSwToSurfaceBlit(SurfaceType.IntRgb, + MTLSurfaceData.PF_INT_RGB), + new MTLSwToSurfaceBlit(SurfaceType.IntRgbx, + MTLSurfaceData.PF_INT_RGBX), + new MTLSwToSurfaceBlit(SurfaceType.IntBgr, + MTLSurfaceData.PF_INT_BGR), + new MTLSwToSurfaceBlit(SurfaceType.IntBgrx, + MTLSurfaceData.PF_INT_BGRX), + new MTLSwToSurfaceBlit(SurfaceType.ThreeByteBgr, + MTLSurfaceData.PF_3BYTE_BGR), + new MTLSwToSurfaceBlit(SurfaceType.Ushort565Rgb, + MTLSurfaceData.PF_USHORT_565_RGB), + new MTLSwToSurfaceBlit(SurfaceType.Ushort555Rgb, + MTLSurfaceData.PF_USHORT_555_RGB), + new MTLSwToSurfaceBlit(SurfaceType.Ushort555Rgbx, + MTLSurfaceData.PF_USHORT_555_RGBX), + new MTLSwToSurfaceBlit(SurfaceType.ByteGray, + MTLSurfaceData.PF_BYTE_GRAY), + new MTLSwToSurfaceBlit(SurfaceType.UshortGray, + MTLSurfaceData.PF_USHORT_GRAY), + new MTLGeneralBlit(MTLSurfaceData.MTLSurface, + CompositeType.AnyAlpha, + blitIntArgbPreToSurface), + + new MTLAnyCompositeBlit(MTLSurfaceData.MTLSurface, + blitSurfaceToIntArgbPre, + blitSurfaceToIntArgbPre, + blitIntArgbPreToSurface), + new MTLAnyCompositeBlit(SurfaceType.Any, + null, + blitSurfaceToIntArgbPre, + blitIntArgbPreToSurface), + + new MTLSwToSurfaceScale(SurfaceType.IntRgb, + MTLSurfaceData.PF_INT_RGB), + new MTLSwToSurfaceScale(SurfaceType.IntRgbx, + MTLSurfaceData.PF_INT_RGBX), + new MTLSwToSurfaceScale(SurfaceType.IntBgr, + MTLSurfaceData.PF_INT_BGR), + new MTLSwToSurfaceScale(SurfaceType.IntBgrx, + MTLSurfaceData.PF_INT_BGRX), + new MTLSwToSurfaceScale(SurfaceType.ThreeByteBgr, + MTLSurfaceData.PF_3BYTE_BGR), + new MTLSwToSurfaceScale(SurfaceType.Ushort565Rgb, + MTLSurfaceData.PF_USHORT_565_RGB), + new MTLSwToSurfaceScale(SurfaceType.Ushort555Rgb, + MTLSurfaceData.PF_USHORT_555_RGB), + new MTLSwToSurfaceScale(SurfaceType.Ushort555Rgbx, + MTLSurfaceData.PF_USHORT_555_RGBX), + new MTLSwToSurfaceScale(SurfaceType.ByteGray, + MTLSurfaceData.PF_BYTE_GRAY), + new MTLSwToSurfaceScale(SurfaceType.UshortGray, + MTLSurfaceData.PF_USHORT_GRAY), + new MTLSwToSurfaceScale(SurfaceType.IntArgbPre, + MTLSurfaceData.PF_INT_ARGB_PRE), + + new MTLSwToSurfaceTransform(SurfaceType.IntRgb, + MTLSurfaceData.PF_INT_RGB), + new MTLSwToSurfaceTransform(SurfaceType.IntRgbx, + MTLSurfaceData.PF_INT_RGBX), + new MTLSwToSurfaceTransform(SurfaceType.IntBgr, + MTLSurfaceData.PF_INT_BGR), + new MTLSwToSurfaceTransform(SurfaceType.IntBgrx, + MTLSurfaceData.PF_INT_BGRX), + new MTLSwToSurfaceTransform(SurfaceType.ThreeByteBgr, + MTLSurfaceData.PF_3BYTE_BGR), + new MTLSwToSurfaceTransform(SurfaceType.Ushort565Rgb, + MTLSurfaceData.PF_USHORT_565_RGB), + new MTLSwToSurfaceTransform(SurfaceType.Ushort555Rgb, + MTLSurfaceData.PF_USHORT_555_RGB), + new MTLSwToSurfaceTransform(SurfaceType.Ushort555Rgbx, + MTLSurfaceData.PF_USHORT_555_RGBX), + new MTLSwToSurfaceTransform(SurfaceType.ByteGray, + MTLSurfaceData.PF_BYTE_GRAY), + new MTLSwToSurfaceTransform(SurfaceType.UshortGray, + MTLSurfaceData.PF_USHORT_GRAY), + transformBlitIntArgbPreToSurface, + + new MTLGeneralTransformedBlit(transformBlitIntArgbPreToSurface), + + // texture->surface ops + new MTLTextureToSurfaceBlit(), + new MTLTextureToSurfaceScale(), + new MTLTextureToSurfaceTransform(), + + // sw->texture ops + blitIntArgbPreToTexture, + new MTLSwToTextureBlit(SurfaceType.IntRgb, + MTLSurfaceData.PF_INT_RGB), + new MTLSwToTextureBlit(SurfaceType.IntRgbx, + MTLSurfaceData.PF_INT_RGBX), + new MTLSwToTextureBlit(SurfaceType.IntBgr, + MTLSurfaceData.PF_INT_BGR), + new MTLSwToTextureBlit(SurfaceType.IntBgrx, + MTLSurfaceData.PF_INT_BGRX), + new MTLSwToTextureBlit(SurfaceType.ThreeByteBgr, + MTLSurfaceData.PF_3BYTE_BGR), + new MTLSwToTextureBlit(SurfaceType.Ushort565Rgb, + MTLSurfaceData.PF_USHORT_565_RGB), + new MTLSwToTextureBlit(SurfaceType.Ushort555Rgb, + MTLSurfaceData.PF_USHORT_555_RGB), + new MTLSwToTextureBlit(SurfaceType.Ushort555Rgbx, + MTLSurfaceData.PF_USHORT_555_RGBX), + new MTLSwToTextureBlit(SurfaceType.ByteGray, + MTLSurfaceData.PF_BYTE_GRAY), + new MTLSwToTextureBlit(SurfaceType.UshortGray, + MTLSurfaceData.PF_USHORT_GRAY), + new MTLGeneralBlit(MTLSurfaceData.MTLTexture, + CompositeType.SrcNoEa, + blitIntArgbPreToTexture), + }; + GraphicsPrimitiveMgr.register(primitives); + } + + /** + * The following offsets are used to pack the parameters in + * createPackedParams(). (They are also used at the native level when + * unpacking the params.) + */ + @Native private static final int OFFSET_SRCTYPE = 16; + @Native private static final int OFFSET_HINT = 8; + @Native private static final int OFFSET_TEXTURE = 3; + @Native private static final int OFFSET_RTT = 2; + @Native private static final int OFFSET_XFORM = 1; + @Native private static final int OFFSET_ISOBLIT = 0; + + /** + * Packs the given parameters into a single int value in order to save + * space on the rendering queue. + */ + private static int createPackedParams(boolean isoblit, boolean texture, + boolean rtt, boolean xform, + int hint, int srctype) + { + return + ((srctype << OFFSET_SRCTYPE) | + (hint << OFFSET_HINT ) | + ((texture ? 1 : 0) << OFFSET_TEXTURE) | + ((rtt ? 1 : 0) << OFFSET_RTT ) | + ((xform ? 1 : 0) << OFFSET_XFORM ) | + ((isoblit ? 1 : 0) << OFFSET_ISOBLIT)); + } + + /** + * Enqueues a BLIT operation with the given parameters. Note that the + * RenderQueue lock must be held before calling this method. + */ + private static void enqueueBlit(RenderQueue rq, + SurfaceData src, SurfaceData dst, + int packedParams, + int sx1, int sy1, + int sx2, int sy2, + double dx1, double dy1, + double dx2, double dy2) + { + // assert rq.lock.isHeldByCurrentThread(); + RenderBuffer buf = rq.getBuffer(); + rq.ensureCapacityAndAlignment(72, 24); + buf.putInt(BLIT); + buf.putInt(packedParams); + buf.putInt(sx1).putInt(sy1); + buf.putInt(sx2).putInt(sy2); + buf.putDouble(dx1).putDouble(dy1); + buf.putDouble(dx2).putDouble(dy2); + buf.putLong(src.getNativeOps()); + buf.putLong(dst.getNativeOps()); + } + + static void Blit(SurfaceData srcData, SurfaceData dstData, + Composite comp, Region clip, + AffineTransform xform, int hint, + int sx1, int sy1, + int sx2, int sy2, + double dx1, double dy1, + double dx2, double dy2, + int srctype, boolean texture) + { + int ctxflags = 0; + if (srcData.getTransparency() == Transparency.OPAQUE) { + ctxflags |= MTLContext.SRC_IS_OPAQUE; + } + + MTLRenderQueue rq = MTLRenderQueue.getInstance(); + rq.lock(); + try { + // make sure the RenderQueue keeps a hard reference to the + // source (sysmem) SurfaceData to prevent it from being + // disposed while the operation is processed on the QFT + rq.addReference(srcData); + + MTLSurfaceData oglDst = (MTLSurfaceData)dstData; + if (texture) { + // make sure we have a current context before uploading + // the sysmem data to the texture object + MTLGraphicsConfig gc = oglDst.getMTLGraphicsConfig(); + MTLContext.setScratchSurface(gc); + } else { + MTLContext.validateContext(oglDst, oglDst, + clip, comp, xform, null, null, + ctxflags); + } + + int packedParams = createPackedParams(false, texture, + false, xform != null, + hint, srctype); + enqueueBlit(rq, srcData, dstData, + packedParams, + sx1, sy1, sx2, sy2, + dx1, dy1, dx2, dy2); + + // always flush immediately, since we (currently) have no means + // of tracking changes to the system memory surface + rq.flushNow(); + } finally { + rq.unlock(); + } + } + + /** + * Note: The srcImg and biop parameters are only used when invoked + * from the MTLBufImgOps.renderImageWithOp() method; in all other cases, + * this method can be called with null values for those two parameters, + * and they will be effectively ignored. + */ + static void IsoBlit(SurfaceData srcData, SurfaceData dstData, + BufferedImage srcImg, BufferedImageOp biop, + Composite comp, Region clip, + AffineTransform xform, int hint, + int sx1, int sy1, + int sx2, int sy2, + double dx1, double dy1, + double dx2, double dy2, + boolean texture) + { + int ctxflags = 0; + if (srcData.getTransparency() == Transparency.OPAQUE) { + ctxflags |= MTLContext.SRC_IS_OPAQUE; + } + + MTLRenderQueue rq = MTLRenderQueue.getInstance(); + rq.lock(); + try { + MTLSurfaceData oglSrc = (MTLSurfaceData)srcData; + MTLSurfaceData oglDst = (MTLSurfaceData)dstData; + int srctype = oglSrc.getType(); + boolean rtt; + MTLSurfaceData srcCtxData; + if (srctype == MTLSurfaceData.TEXTURE) { + // the source is a regular texture object; we substitute + // the destination surface for the purposes of making a + // context current + rtt = false; + srcCtxData = oglDst; + } else { + // the source is a pbuffer, backbuffer, or render-to-texture + // surface; we set rtt to true to differentiate this kind + // of surface from a regular texture object + rtt = true; + if (srctype == AccelSurface.RT_TEXTURE) { + srcCtxData = oglDst; + } else { + srcCtxData = oglSrc; + } + } + + MTLContext.validateContext(srcCtxData, oglDst, + clip, comp, xform, null, null, + ctxflags); + + if (biop != null) { + MTLBufImgOps.enableBufImgOp(rq, oglSrc, srcImg, biop); + } + + int packedParams = createPackedParams(true, texture, + rtt, xform != null, + hint, 0 /*unused*/); + enqueueBlit(rq, srcData, dstData, + packedParams, + sx1, sy1, sx2, sy2, + dx1, dy1, dx2, dy2); + + if (biop != null) { + MTLBufImgOps.disableBufImgOp(rq, biop); + } + + if (rtt && oglDst.isOnScreen()) { + // we only have to flush immediately when copying from a + // (non-texture) surface to the screen; otherwise Swing apps + // might appear unresponsive until the auto-flush completes + rq.flushNow(); + } + } finally { + rq.unlock(); + } + } +} + +class MTLSurfaceToSurfaceBlit extends Blit { + + MTLSurfaceToSurfaceBlit() { + super(MTLSurfaceData.MTLSurface, + CompositeType.AnyAlpha, + MTLSurfaceData.MTLSurface); + } + + public void Blit(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + int sx, int sy, int dx, int dy, int w, int h) + { + MTLBlitLoops.IsoBlit(src, dst, + null, null, + comp, clip, null, + AffineTransformOp.TYPE_NEAREST_NEIGHBOR, + sx, sy, sx+w, sy+h, + dx, dy, dx+w, dy+h, + false); + } +} + +class MTLSurfaceToSurfaceScale extends ScaledBlit { + + MTLSurfaceToSurfaceScale() { + super(MTLSurfaceData.MTLSurface, + CompositeType.AnyAlpha, + MTLSurfaceData.MTLSurface); + } + + public void Scale(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + int sx1, int sy1, + int sx2, int sy2, + double dx1, double dy1, + double dx2, double dy2) + { + MTLBlitLoops.IsoBlit(src, dst, + null, null, + comp, clip, null, + AffineTransformOp.TYPE_NEAREST_NEIGHBOR, + sx1, sy1, sx2, sy2, + dx1, dy1, dx2, dy2, + false); + } +} + +class MTLSurfaceToSurfaceTransform extends TransformBlit { + + MTLSurfaceToSurfaceTransform() { + super(MTLSurfaceData.MTLSurface, + CompositeType.AnyAlpha, + MTLSurfaceData.MTLSurface); + } + + public void Transform(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + AffineTransform at, int hint, + int sx, int sy, int dx, int dy, + int w, int h) + { + MTLBlitLoops.IsoBlit(src, dst, + null, null, + comp, clip, at, hint, + sx, sy, sx+w, sy+h, + dx, dy, dx+w, dy+h, + false); + } +} + +class MTLRTTSurfaceToSurfaceBlit extends Blit { + + MTLRTTSurfaceToSurfaceBlit() { + super(MTLSurfaceData.MTLSurfaceRTT, + CompositeType.AnyAlpha, + MTLSurfaceData.MTLSurface); + } + + public void Blit(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + int sx, int sy, int dx, int dy, int w, int h) + { + MTLBlitLoops.IsoBlit(src, dst, + null, null, + comp, clip, null, + AffineTransformOp.TYPE_NEAREST_NEIGHBOR, + sx, sy, sx+w, sy+h, + dx, dy, dx+w, dy+h, + true); + } +} + +class MTLRTTSurfaceToSurfaceScale extends ScaledBlit { + + MTLRTTSurfaceToSurfaceScale() { + super(MTLSurfaceData.MTLSurfaceRTT, + CompositeType.AnyAlpha, + MTLSurfaceData.MTLSurface); + } + + public void Scale(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + int sx1, int sy1, + int sx2, int sy2, + double dx1, double dy1, + double dx2, double dy2) + { + MTLBlitLoops.IsoBlit(src, dst, + null, null, + comp, clip, null, + AffineTransformOp.TYPE_NEAREST_NEIGHBOR, + sx1, sy1, sx2, sy2, + dx1, dy1, dx2, dy2, + true); + } +} + +class MTLRTTSurfaceToSurfaceTransform extends TransformBlit { + + MTLRTTSurfaceToSurfaceTransform() { + super(MTLSurfaceData.MTLSurfaceRTT, + CompositeType.AnyAlpha, + MTLSurfaceData.MTLSurface); + } + + public void Transform(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + AffineTransform at, int hint, + int sx, int sy, int dx, int dy, int w, int h) + { + MTLBlitLoops.IsoBlit(src, dst, + null, null, + comp, clip, at, hint, + sx, sy, sx+w, sy+h, + dx, dy, dx+w, dy+h, + true); + } +} + +final class MTLSurfaceToSwBlit extends Blit { + + private final int typeval; + private WeakReference srcTmp; + + // destination will actually be ArgbPre or Argb + MTLSurfaceToSwBlit(final SurfaceType dstType, final int typeval) { + super(MTLSurfaceData.MTLSurface, + CompositeType.SrcNoEa, + dstType); + this.typeval = typeval; + } + + private synchronized void complexClipBlit(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + int sx, int sy, int dx, int dy, + int w, int h) { + SurfaceData cachedSrc = null; + if (srcTmp != null) { + // use cached intermediate surface, if available + cachedSrc = srcTmp.get(); + } + + // We can convert argb_pre data from MTL surface in two places: + // - During MTL surface -> SW blit + // - During SW -> SW blit + // The first one is faster when we use opaque MTL surface, because in + // this case we simply skip conversion and use color components as is. + // Because of this we align intermediate buffer type with type of + // destination not source. + final int type = typeval == MTLSurfaceData.PF_INT_ARGB_PRE ? + BufferedImage.TYPE_INT_ARGB_PRE : + BufferedImage.TYPE_INT_ARGB; + + src = convertFrom(this, src, sx, sy, w, h, cachedSrc, type); + + // copy intermediate SW to destination SW using complex clip + final Blit performop = Blit.getFromCache(src.getSurfaceType(), + CompositeType.SrcNoEa, + dst.getSurfaceType()); + performop.Blit(src, dst, comp, clip, 0, 0, dx, dy, w, h); + + if (src != cachedSrc) { + // cache the intermediate surface + srcTmp = new WeakReference<>(src); + } + } + + public void Blit(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + int sx, int sy, int dx, int dy, + int w, int h) + { + if (clip != null) { + clip = clip.getIntersectionXYWH(dx, dy, w, h); + // At the end this method will flush the RenderQueue, we should exit + // from it as soon as possible. + if (clip.isEmpty()) { + return; + } + sx += clip.getLoX() - dx; + sy += clip.getLoY() - dy; + dx = clip.getLoX(); + dy = clip.getLoY(); + w = clip.getWidth(); + h = clip.getHeight(); + + if (!clip.isRectangular()) { + complexClipBlit(src, dst, comp, clip, sx, sy, dx, dy, w, h); + return; + } + } + + MTLRenderQueue rq = MTLRenderQueue.getInstance(); + rq.lock(); + try { + // make sure the RenderQueue keeps a hard reference to the + // destination (sysmem) SurfaceData to prevent it from being + // disposed while the operation is processed on the QFT + rq.addReference(dst); + + RenderBuffer buf = rq.getBuffer(); + MTLContext.validateContext((MTLSurfaceData)src); + + rq.ensureCapacityAndAlignment(48, 32); + buf.putInt(SURFACE_TO_SW_BLIT); + buf.putInt(sx).putInt(sy); + buf.putInt(dx).putInt(dy); + buf.putInt(w).putInt(h); + buf.putInt(typeval); + buf.putLong(src.getNativeOps()); + buf.putLong(dst.getNativeOps()); + + // always flush immediately + rq.flushNow(); + } finally { + rq.unlock(); + } + } +} + +class MTLSwToSurfaceBlit extends Blit { + + private int typeval; + + MTLSwToSurfaceBlit(SurfaceType srcType, int typeval) { + super(srcType, + CompositeType.AnyAlpha, + MTLSurfaceData.MTLSurface); + this.typeval = typeval; + } + + public void Blit(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + int sx, int sy, int dx, int dy, int w, int h) + { + MTLBlitLoops.Blit(src, dst, + comp, clip, null, + AffineTransformOp.TYPE_NEAREST_NEIGHBOR, + sx, sy, sx+w, sy+h, + dx, dy, dx+w, dy+h, + typeval, false); + } +} + +class MTLSwToSurfaceScale extends ScaledBlit { + + private int typeval; + + MTLSwToSurfaceScale(SurfaceType srcType, int typeval) { + super(srcType, + CompositeType.AnyAlpha, + MTLSurfaceData.MTLSurface); + this.typeval = typeval; + } + + public void Scale(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + int sx1, int sy1, + int sx2, int sy2, + double dx1, double dy1, + double dx2, double dy2) + { + MTLBlitLoops.Blit(src, dst, + comp, clip, null, + AffineTransformOp.TYPE_NEAREST_NEIGHBOR, + sx1, sy1, sx2, sy2, + dx1, dy1, dx2, dy2, + typeval, false); + } +} + +class MTLSwToSurfaceTransform extends TransformBlit { + + private int typeval; + + MTLSwToSurfaceTransform(SurfaceType srcType, int typeval) { + super(srcType, + CompositeType.AnyAlpha, + MTLSurfaceData.MTLSurface); + this.typeval = typeval; + } + + public void Transform(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + AffineTransform at, int hint, + int sx, int sy, int dx, int dy, int w, int h) + { + MTLBlitLoops.Blit(src, dst, + comp, clip, at, hint, + sx, sy, sx+w, sy+h, + dx, dy, dx+w, dy+h, + typeval, false); + } +} + +class MTLSwToTextureBlit extends Blit { + + private int typeval; + + MTLSwToTextureBlit(SurfaceType srcType, int typeval) { + super(srcType, + CompositeType.SrcNoEa, + MTLSurfaceData.MTLTexture); + this.typeval = typeval; + } + + public void Blit(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + int sx, int sy, int dx, int dy, int w, int h) + { + MTLBlitLoops.Blit(src, dst, + comp, clip, null, + AffineTransformOp.TYPE_NEAREST_NEIGHBOR, + sx, sy, sx+w, sy+h, + dx, dy, dx+w, dy+h, + typeval, true); + } +} + +class MTLTextureToSurfaceBlit extends Blit { + + MTLTextureToSurfaceBlit() { + super(MTLSurfaceData.MTLTexture, + CompositeType.AnyAlpha, + MTLSurfaceData.MTLSurface); + } + + public void Blit(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + int sx, int sy, int dx, int dy, int w, int h) + { + MTLBlitLoops.IsoBlit(src, dst, + null, null, + comp, clip, null, + AffineTransformOp.TYPE_NEAREST_NEIGHBOR, + sx, sy, sx+w, sy+h, + dx, dy, dx+w, dy+h, + true); + } +} + +class MTLTextureToSurfaceScale extends ScaledBlit { + + MTLTextureToSurfaceScale() { + super(MTLSurfaceData.MTLTexture, + CompositeType.AnyAlpha, + MTLSurfaceData.MTLSurface); + } + + public void Scale(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + int sx1, int sy1, + int sx2, int sy2, + double dx1, double dy1, + double dx2, double dy2) + { + MTLBlitLoops.IsoBlit(src, dst, + null, null, + comp, clip, null, + AffineTransformOp.TYPE_NEAREST_NEIGHBOR, + sx1, sy1, sx2, sy2, + dx1, dy1, dx2, dy2, + true); + } +} + +class MTLTextureToSurfaceTransform extends TransformBlit { + + MTLTextureToSurfaceTransform() { + super(MTLSurfaceData.MTLTexture, + CompositeType.AnyAlpha, + MTLSurfaceData.MTLSurface); + } + + public void Transform(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + AffineTransform at, int hint, + int sx, int sy, int dx, int dy, + int w, int h) + { + MTLBlitLoops.IsoBlit(src, dst, + null, null, + comp, clip, at, hint, + sx, sy, sx+w, sy+h, + dx, dy, dx+w, dy+h, + true); + } +} + +/** + * This general Blit implementation converts any source surface to an + * intermediate IntArgbPre surface, and then uses the more specific + * IntArgbPre->MTLSurface/Texture loop to get the intermediate + * (premultiplied) surface down to OpenGL using simple blit. + */ +class MTLGeneralBlit extends Blit { + + private final Blit performop; + private WeakReference srcTmp; + + MTLGeneralBlit(SurfaceType dstType, + CompositeType compType, + Blit performop) + { + super(SurfaceType.Any, compType, dstType); + this.performop = performop; + } + + public synchronized void Blit(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + int sx, int sy, int dx, int dy, + int w, int h) + { + Blit convertsrc = Blit.getFromCache(src.getSurfaceType(), + CompositeType.SrcNoEa, + SurfaceType.IntArgbPre); + + SurfaceData cachedSrc = null; + if (srcTmp != null) { + // use cached intermediate surface, if available + cachedSrc = srcTmp.get(); + } + + // convert source to IntArgbPre + src = convertFrom(convertsrc, src, sx, sy, w, h, + cachedSrc, BufferedImage.TYPE_INT_ARGB_PRE); + + // copy IntArgbPre intermediate surface to OpenGL surface + performop.Blit(src, dst, comp, clip, + 0, 0, dx, dy, w, h); + + if (src != cachedSrc) { + // cache the intermediate surface + srcTmp = new WeakReference<>(src); + } + } +} + +/** + * This general TransformedBlit implementation converts any source surface to an + * intermediate IntArgbPre surface, and then uses the more specific + * IntArgbPre->MTLSurface/Texture loop to get the intermediate + * (premultiplied) surface down to OpenGL using simple transformBlit. + */ +final class MTLGeneralTransformedBlit extends TransformBlit { + + private final TransformBlit performop; + private WeakReference srcTmp; + + MTLGeneralTransformedBlit(final TransformBlit performop) { + super(SurfaceType.Any, CompositeType.AnyAlpha, + MTLSurfaceData.MTLSurface); + this.performop = performop; + } + + @Override + public synchronized void Transform(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + AffineTransform at, int hint, int srcx, + int srcy, int dstx, int dsty, int width, + int height){ + Blit convertsrc = Blit.getFromCache(src.getSurfaceType(), + CompositeType.SrcNoEa, + SurfaceType.IntArgbPre); + // use cached intermediate surface, if available + final SurfaceData cachedSrc = srcTmp != null ? srcTmp.get() : null; + // convert source to IntArgbPre + src = convertFrom(convertsrc, src, srcx, srcy, width, height, cachedSrc, + BufferedImage.TYPE_INT_ARGB_PRE); + + // transform IntArgbPre intermediate surface to OpenGL surface + performop.Transform(src, dst, comp, clip, at, hint, 0, 0, dstx, dsty, + width, height); + + if (src != cachedSrc) { + // cache the intermediate surface + srcTmp = new WeakReference<>(src); + } + } +} + +/** + * This general MTLAnyCompositeBlit implementation can convert any source/target + * surface to an intermediate surface using convertsrc/convertdst loops, applies + * necessary composite operation, and then uses convertresult loop to get the + * intermediate surface down to OpenGL. + */ +final class MTLAnyCompositeBlit extends Blit { + + private WeakReference dstTmp; + private WeakReference srcTmp; + private final Blit convertsrc; + private final Blit convertdst; + private final Blit convertresult; + + MTLAnyCompositeBlit(SurfaceType srctype, Blit convertsrc, Blit convertdst, + Blit convertresult) { + super(srctype, CompositeType.Any, MTLSurfaceData.MTLSurface); + this.convertsrc = convertsrc; + this.convertdst = convertdst; + this.convertresult = convertresult; + } + + public synchronized void Blit(SurfaceData src, SurfaceData dst, + Composite comp, Region clip, + int sx, int sy, int dx, int dy, + int w, int h) + { + if (convertsrc != null) { + SurfaceData cachedSrc = null; + if (srcTmp != null) { + // use cached intermediate surface, if available + cachedSrc = srcTmp.get(); + } + // convert source to IntArgbPre + src = convertFrom(convertsrc, src, sx, sy, w, h, cachedSrc, + BufferedImage.TYPE_INT_ARGB_PRE); + if (src != cachedSrc) { + // cache the intermediate surface + srcTmp = new WeakReference<>(src); + } + } + + SurfaceData cachedDst = null; + + if (dstTmp != null) { + // use cached intermediate surface, if available + cachedDst = dstTmp.get(); + } + + // convert destination to IntArgbPre + SurfaceData dstBuffer = convertFrom(convertdst, dst, dx, dy, w, h, + cachedDst, BufferedImage.TYPE_INT_ARGB_PRE); + Region bufferClip = + clip == null ? null : clip.getTranslatedRegion(-dx, -dy); + + Blit performop = Blit.getFromCache(src.getSurfaceType(), + CompositeType.Any, dstBuffer.getSurfaceType()); + performop.Blit(src, dstBuffer, comp, bufferClip, sx, sy, 0, 0, w, h); + + if (dstBuffer != cachedDst) { + // cache the intermediate surface + dstTmp = new WeakReference<>(dstBuffer); + } + // now blit the buffer back to the destination + convertresult.Blit(dstBuffer, dst, AlphaComposite.Src, clip, 0, 0, dx, + dy, w, h); + } +} --- /dev/null 2019-05-16 19:16:24.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/metal/MTLBufImgOps.java 2019-05-16 19:16:24.000000000 +0300 @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.metal; + +import sun.java2d.SunGraphics2D; +import sun.java2d.SurfaceData; +import sun.java2d.loops.CompositeType; +import sun.java2d.pipe.BufferedBufImgOps; + +import java.awt.image.*; + +import static sun.java2d.metal.MTLContext.MTLContextCaps.CAPS_EXT_BIOP_SHADER; + +class MTLBufImgOps extends BufferedBufImgOps { + + /** + * This method is called from MTLDrawImage.transformImage() only. It + * validates the provided BufferedImageOp to determine whether the op + * is one that can be accelerated by the MTL pipeline. If the operation + * cannot be completed for any reason, this method returns false; + * otherwise, the given BufferedImage is rendered to the destination + * using the provided BufferedImageOp and this method returns true. + */ + static boolean renderImageWithOp(SunGraphics2D sg, BufferedImage img, + BufferedImageOp biop, int x, int y) + { + // Validate the provided BufferedImage (make sure it is one that + // is supported, and that its properties are acceleratable) + if (biop instanceof ConvolveOp) { + if (!isConvolveOpValid((ConvolveOp)biop)) { + return false; + } + } else if (biop instanceof RescaleOp) { + if (!isRescaleOpValid((RescaleOp)biop, img)) { + return false; + } + } else if (biop instanceof LookupOp) { + if (!isLookupOpValid((LookupOp)biop, img)) { + return false; + } + } else { + // No acceleration for other BufferedImageOps (yet) + return false; + } + + SurfaceData dstData = sg.surfaceData; + if (!(dstData instanceof MTLSurfaceData) || + (sg.interpolationType == AffineTransformOp.TYPE_BICUBIC) || + (sg.compositeState > SunGraphics2D.COMP_ALPHA)) + { + return false; + } + + SurfaceData srcData = + dstData.getSourceSurfaceData(img, SunGraphics2D.TRANSFORM_ISIDENT, + CompositeType.SrcOver, null); + if (!(srcData instanceof MTLSurfaceData)) { + // REMIND: this hack tries to ensure that we have a cached texture + srcData = + dstData.getSourceSurfaceData(img, SunGraphics2D.TRANSFORM_ISIDENT, + CompositeType.SrcOver, null); + if (!(srcData instanceof MTLSurfaceData)) { + return false; + } + } + + // Verify that the source surface is actually a texture and + // that the operation is supported + MTLSurfaceData mtlSrc = (MTLSurfaceData)srcData; + MTLGraphicsConfig gc = mtlSrc.getMTLGraphicsConfig(); + if (mtlSrc.getType() != MTLSurfaceData.TEXTURE || + !gc.isCapPresent(CAPS_EXT_BIOP_SHADER)) + { + return false; + } + + int sw = img.getWidth(); + int sh = img.getHeight(); + MTLBlitLoops.IsoBlit(srcData, dstData, + img, biop, + sg.composite, sg.getCompClip(), + sg.transform, sg.interpolationType, + 0, 0, sw, sh, + x, y, x+sw, y+sh, + true); + + return true; + } +} --- /dev/null 2019-05-16 19:16:25.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/metal/MTLContext.java 2019-05-16 19:16:25.000000000 +0300 @@ -0,0 +1,222 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.metal; + +import sun.java2d.pipe.BufferedContext; +import sun.java2d.pipe.RenderBuffer; +import sun.java2d.pipe.RenderQueue; +import sun.java2d.pipe.hw.ContextCapabilities; + +import java.lang.annotation.Native; + +import static sun.java2d.pipe.BufferedOpCodes.*; + +/** + * Note that the RenderQueue lock must be acquired before calling any of + * the methods in this class. + */ +public class MTLContext extends BufferedContext { + + private final MTLGraphicsConfig config; + + public MTLContext(RenderQueue rq, MTLGraphicsConfig config) { + super(rq); + this.config = config; + } + + /** + * Convenience method that delegates to setScratchSurface() below. + */ + static void setScratchSurface(MTLGraphicsConfig gc) { + setScratchSurface(gc.getNativeConfigInfo()); + } + + /** + * Makes the given GraphicsConfig's context current to its associated + * "scratch surface". Each GraphicsConfig maintains a native context + * (MTLDevice) as well as a native pbuffer + * known as the "scratch surface". By making the context current to the + * scratch surface, we are assured that we have a current context for + * the relevant GraphicsConfig, and can therefore perform operations + * depending on the capabilities of that GraphicsConfig. + * This method should be used for operations with an MTL texture + * as the destination surface (e.g. a sw->texture blit loop), or in those + * situations where we may not otherwise have a current context (e.g. + * when disposing a texture-based surface). + */ + public static void setScratchSurface(long pConfigInfo) { + // assert MTLRenderQueue.getInstance().lock.isHeldByCurrentThread(); + + // invalidate the current context + currentContext = null; + + // set the scratch context + MTLRenderQueue rq = MTLRenderQueue.getInstance(); + RenderBuffer buf = rq.getBuffer(); + rq.ensureCapacityAndAlignment(12, 4); + buf.putInt(SET_SCRATCH_SURFACE); + buf.putLong(pConfigInfo); + } + + /** + * Invalidates the currentContext field to ensure that we properly + * revalidate the MTLContext (make it current, etc.) next time through + * the validate() method. This is typically invoked from methods + * that affect the current context state (e.g. disposing a context or + * surface). + */ + public static void invalidateCurrentContext() { + // assert MTLRenderQueue.getInstance().lock.isHeldByCurrentThread(); + + // invalidate the current Java-level context so that we + // revalidate everything the next time around + if (currentContext != null) { + currentContext.invalidateContext(); + currentContext = null; + } + + // invalidate the context reference at the native level, and + // then flush the queue so that we have no pending operations + // dependent on the current context + MTLRenderQueue rq = MTLRenderQueue.getInstance(); + rq.ensureCapacity(4); + rq.getBuffer().putInt(INVALIDATE_CONTEXT); + rq.flushNow(); + } + + public RenderQueue getRenderQueue() { + return MTLRenderQueue.getInstance(); + } + + /** + * Returns a string representing adapter id (vendor, renderer, version). + * Must be called on the rendering thread. + * + * @return an id string for the adapter + */ + public static final native String getMTLIdString(); + + @Override + public void saveState() { + // assert rq.lock.isHeldByCurrentThread(); + + // reset all attributes of this and current contexts + invalidateContext(); + invalidateCurrentContext(); + + setScratchSurface(config); + + // save the state on the native level + rq.ensureCapacity(4); + buf.putInt(SAVE_STATE); + rq.flushNow(); + } + + @Override + public void restoreState() { + // assert rq.lock.isHeldByCurrentThread(); + + // reset all attributes of this and current contexts + invalidateContext(); + invalidateCurrentContext(); + + setScratchSurface(config); + + // restore the state on the native level + rq.ensureCapacity(4); + buf.putInt(RESTORE_STATE); + rq.flushNow(); + } + + public static class MTLContextCaps extends ContextCapabilities { + /** + * This cap will only be set if the fbobject system property has been + * enabled and we are able to create an FBO with depth buffer. + */ + @Native + public static final int CAPS_EXT_FBOBJECT = + (CAPS_RT_TEXTURE_ALPHA | CAPS_RT_TEXTURE_OPAQUE); + /** Indicates that the context is doublebuffered. */ + @Native + public static final int CAPS_DOUBLEBUFFERED = (FIRST_PRIVATE_CAP << 0); + /** + * This cap will only be set if the lcdshader system property has been + * enabled and the hardware supports the minimum number of texture units + */ + @Native + static final int CAPS_EXT_LCD_SHADER = (FIRST_PRIVATE_CAP << 1); + /** + * This cap will only be set if the biopshader system property has been + * enabled and the hardware meets our minimum requirements. + */ + @Native + static final int CAPS_EXT_BIOP_SHADER = (FIRST_PRIVATE_CAP << 2); + /** + * This cap will only be set if the gradshader system property has been + * enabled and the hardware meets our minimum requirements. + */ + @Native + static final int CAPS_EXT_GRAD_SHADER = (FIRST_PRIVATE_CAP << 3); + /** Indicates the presence of the GL_ARB_texture_rectangle extension. */ + @Native + static final int CAPS_EXT_TEXRECT = (FIRST_PRIVATE_CAP << 4); + /** Indicates the presence of the GL_NV_texture_barrier extension. */ + @Native + static final int CAPS_EXT_TEXBARRIER = (FIRST_PRIVATE_CAP << 5); + + + public MTLContextCaps(int caps, String adapterId) { + super(caps, adapterId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(super.toString()); + if ((caps & CAPS_EXT_FBOBJECT) != 0) { + sb.append("CAPS_EXT_FBOBJECT|"); + } + if ((caps & CAPS_DOUBLEBUFFERED) != 0) { + sb.append("CAPS_DOUBLEBUFFERED|"); + } + if ((caps & CAPS_EXT_LCD_SHADER) != 0) { + sb.append("CAPS_EXT_LCD_SHADER|"); + } + if ((caps & CAPS_EXT_BIOP_SHADER) != 0) { + sb.append("CAPS_BIOP_SHADER|"); + } + if ((caps & CAPS_EXT_GRAD_SHADER) != 0) { + sb.append("CAPS_EXT_GRAD_SHADER|"); + } + if ((caps & CAPS_EXT_TEXRECT) != 0) { + sb.append("CAPS_EXT_TEXRECT|"); + } + if ((caps & CAPS_EXT_TEXBARRIER) != 0) { + sb.append("CAPS_EXT_TEXBARRIER|"); + } + return sb.toString(); + } + } +} --- /dev/null 2019-05-16 19:16:26.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/metal/MTLDrawImage.java 2019-05-16 19:16:26.000000000 +0300 @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.metal; + +import sun.java2d.SunGraphics2D; +import sun.java2d.SurfaceData; +import sun.java2d.loops.SurfaceType; +import sun.java2d.loops.TransformBlit; +import sun.java2d.pipe.DrawImage; + +import java.awt.*; +import java.awt.geom.AffineTransform; +import java.awt.image.AffineTransformOp; +import java.awt.image.BufferedImage; +import java.awt.image.BufferedImageOp; + +public class MTLDrawImage extends DrawImage { + + @Override + protected void renderImageXform(SunGraphics2D sg, Image img, + AffineTransform tx, int interpType, + int sx1, int sy1, int sx2, int sy2, + Color bgColor) + { + // punt to the MediaLib-based transformImage() in the superclass if: + // - bicubic interpolation is specified + // - a background color is specified and will be used + // - the source surface is neither a texture nor render-to-texture + // surface, and a non-default interpolation hint is specified + // (we can only control the filtering for texture->surface + // copies) + // REMIND: we should tweak the sw->texture->surface + // transform case to handle filtering appropriately + // (see 4841762)... + // - an appropriate TransformBlit primitive could not be found + if (interpType != AffineTransformOp.TYPE_BICUBIC) { + SurfaceData dstData = sg.surfaceData; + SurfaceData srcData = + dstData.getSourceSurfaceData(img, + SunGraphics2D.TRANSFORM_GENERIC, + sg.imageComp, + bgColor); + + if (srcData != null && + !isBgOperation(srcData, bgColor) && + (srcData.getSurfaceType() == MTLSurfaceData.MTLTexture || + srcData.getSurfaceType() == MTLSurfaceData.MTLSurfaceRTT || + interpType == AffineTransformOp.TYPE_NEAREST_NEIGHBOR)) + { + SurfaceType srcType = srcData.getSurfaceType(); + SurfaceType dstType = dstData.getSurfaceType(); + TransformBlit blit = TransformBlit.getFromCache(srcType, + sg.imageComp, + dstType); + + if (blit != null) { + blit.Transform(srcData, dstData, + sg.composite, sg.getCompClip(), + tx, interpType, + sx1, sy1, 0, 0, sx2-sx1, sy2-sy1); + return; + } + } + } + + super.renderImageXform(sg, img, tx, interpType, + sx1, sy1, sx2, sy2, bgColor); + } + + @Override + public void transformImage(SunGraphics2D sg, BufferedImage img, + BufferedImageOp op, int x, int y) + { + if (op != null) { + if (op instanceof AffineTransformOp) { + AffineTransformOp atop = (AffineTransformOp) op; + transformImage(sg, img, x, y, + atop.getTransform(), + atop.getInterpolationType()); + return; + } else { + if (MTLBufImgOps.renderImageWithOp(sg, img, op, x, y)) { + return; + } + } + img = op.filter(img, null); + } + copyImage(sg, img, x, y, null); + } +} --- /dev/null 2019-05-16 19:16:27.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/metal/MTLGraphicsConfig.java 2019-05-16 19:16:27.000000000 +0300 @@ -0,0 +1,439 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.metal; + +import sun.awt.CGraphicsConfig; +import sun.awt.CGraphicsDevice; +import sun.awt.image.OffScreenImage; +import sun.awt.image.SunVolatileImage; +import sun.awt.image.SurfaceManager; +import sun.java2d.Disposer; +import sun.java2d.DisposerRecord; +import sun.java2d.Surface; +import sun.java2d.SurfaceData; +import sun.java2d.pipe.hw.AccelGraphicsConfig; +import sun.java2d.pipe.hw.AccelSurface; +import sun.java2d.pipe.hw.AccelTypedVolatileImage; +import sun.java2d.pipe.hw.ContextCapabilities; +import sun.lwawt.LWComponentPeer; +import sun.lwawt.macosx.CFRetainedResource; +import sun.lwawt.macosx.CPlatformView; + +import java.awt.*; +import java.awt.color.ColorSpace; +import java.awt.image.*; +import java.io.File; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.HashMap; + +import static sun.java2d.opengl.OGLSurfaceData.TEXTURE; +import static sun.java2d.pipe.hw.AccelSurface.RT_TEXTURE; +import static sun.java2d.pipe.hw.ContextCapabilities.*; + +public final class MTLGraphicsConfig extends CGraphicsConfig + implements AccelGraphicsConfig, SurfaceManager.ProxiedGraphicsConfig +{ + //private static final int kOpenGLSwapInterval = + // RuntimeOptions.getCurrentOptions().OpenGLSwapInterval; + private static final int kOpenGLSwapInterval = 0; // TODO + private static boolean mtlAvailable; + private static ImageCapabilities imageCaps = new MTLImageCaps(); + + private static final String mtlShadersLib = AccessController.doPrivileged( + (PrivilegedAction) () -> + System.getProperty("java.home", "") + File.separator + + "lib" + File.separator + "shaders.metallib"); + + + private int pixfmt; + private BufferCapabilities bufferCaps; + private long pConfigInfo; + private ContextCapabilities mtlCaps; + private MTLContext context; + private final Object disposerReferent = new Object(); + private final int maxTextureSize; + + private static native boolean initMTL(); + private static native long getMTLConfigInfo(int displayID, String mtlShadersLib); + + /** + * Returns GL_MAX_TEXTURE_SIZE from the shared opengl context. Must be + * called under OGLRQ lock, because this method change current context. + * + * @return GL_MAX_TEXTURE_SIZE + */ + private static native int nativeGetMaxTextureSize(); + + private static final HashMap pGCRefCounts = new HashMap<>(); + + static { + mtlAvailable = initMTL(); + } + + private MTLGraphicsConfig(CGraphicsDevice device, int pixfmt, + long configInfo, int maxTextureSize, + ContextCapabilities mtlCaps) { + super(device); + + this.pixfmt = pixfmt; + this.pConfigInfo = configInfo; + this.mtlCaps = mtlCaps; + this.maxTextureSize = maxTextureSize; + context = new MTLContext(MTLRenderQueue.getInstance(), this); + refPConfigInfo(pConfigInfo); + // add a record to the Disposer so that we destroy the native + // MTLGraphicsConfigInfo data when this object goes away + Disposer.addRecord(disposerReferent, + new MTLGCDisposerRecord(pConfigInfo)); + } + + @Override + public Object getProxyKey() { + return this; + } + + public SurfaceData createManagedSurface(int w, int h, int transparency) { + return MTLSurfaceData.createData(this, w, h, + getColorModel(transparency), + null, + MTLSurfaceData.TEXTURE); + } + + public static MTLGraphicsConfig getConfig(CGraphicsDevice device, + int displayID, int pixfmt) + { + if (!mtlAvailable) { + return null; + } + + long cfginfo = 0; + int textureSize = 0; + final String[] ids = new String[1]; + MTLRenderQueue rq = MTLRenderQueue.getInstance(); + rq.lock(); + try { + // getCGLConfigInfo() creates and destroys temporary + // surfaces/contexts, so we should first invalidate the current + // Java-level context and flush the queue... + MTLContext.invalidateCurrentContext(); + cfginfo = getMTLConfigInfo(displayID, mtlShadersLib); + if (cfginfo != 0L) { + textureSize = nativeGetMaxTextureSize(); + // 7160609: GL still fails to create a square texture of this + // size. Half should be safe enough. + // Explicitly not support a texture more than 2^14, see 8010999. + textureSize = textureSize <= 16384 ? textureSize / 2 : 8192; + MTLContext.setScratchSurface(cfginfo); + rq.flushAndInvokeNow(() -> { + ids[0] = MTLContext.getMTLIdString(); + }); + } + } finally { + rq.unlock(); + } + if (cfginfo == 0) { + return null; + } + + ContextCapabilities caps = new MTLContext.MTLContextCaps( + CAPS_PS30 | CAPS_PS20 | CAPS_RT_PLAIN_ALPHA | + CAPS_RT_TEXTURE_ALPHA | CAPS_RT_TEXTURE_OPAQUE | + CAPS_MULTITEXTURE | CAPS_TEXNONPOW2 | CAPS_TEXNONSQUARE, + ids[0]); + return new MTLGraphicsConfig(device, pixfmt, cfginfo, textureSize, caps); + } + + static void refPConfigInfo(long pConfigInfo) { + synchronized (pGCRefCounts) { + Integer count = pGCRefCounts.get(pConfigInfo); + if (count == null) { + count = 1; + } + else { + count++; + } + pGCRefCounts.put(pConfigInfo, count); + } + } + + static void deRefPConfigInfo(long pConfigInfo) { + synchronized (pGCRefCounts) { + Integer count = pGCRefCounts.get(pConfigInfo); + if (count != null) { + count--; + pGCRefCounts.put(pConfigInfo, count); + if (count == 0) { + MTLRenderQueue.disposeGraphicsConfig(pConfigInfo); + pGCRefCounts.remove(pConfigInfo); + } + } + } + } + + /** + * Returns true if the provided capability bit is present for this config. + * See MTLContext.java for a list of supported capabilities. + */ + public boolean isCapPresent(int cap) { + return ((mtlCaps.getCaps() & cap) != 0); + } + + public long getNativeConfigInfo() { + return pConfigInfo; + } + + /** + * {@inheritDoc} + * + * @see sun.java2d.pipe.hw.BufferedContextProvider#getContext + */ + @Override + public MTLContext getContext() { + return context; + } + + @Override + public BufferedImage createCompatibleImage(int width, int height) { + ColorModel model = new DirectColorModel(24, 0xff0000, 0xff00, 0xff); + WritableRaster + raster = model.createCompatibleWritableRaster(width, height); + return new BufferedImage(model, raster, model.isAlphaPremultiplied(), + null); + } + + @Override + public ColorModel getColorModel(int transparency) { + switch (transparency) { + case Transparency.OPAQUE: + // REMIND: once the ColorModel spec is changed, this should be + // an opaque premultiplied DCM... + return new DirectColorModel(24, 0xff0000, 0xff00, 0xff); + case Transparency.BITMASK: + return new DirectColorModel(25, 0xff0000, 0xff00, 0xff, 0x1000000); + case Transparency.TRANSLUCENT: + ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_sRGB); + return new DirectColorModel(cs, 32, + 0xff0000, 0xff00, 0xff, 0xff000000, + true, DataBuffer.TYPE_INT); + default: + return null; + } + } + + public boolean isDoubleBuffered() { + return true; + } + + private static class MTLGCDisposerRecord implements DisposerRecord { + private long pCfgInfo; + public MTLGCDisposerRecord(long pCfgInfo) { + this.pCfgInfo = pCfgInfo; + } + public void dispose() { + if (pCfgInfo != 0) { + deRefPConfigInfo(pCfgInfo); + pCfgInfo = 0; + } + } + } + + // TODO: CGraphicsConfig doesn't implement displayChanged() yet + //@Override + public synchronized void displayChanged() { + //super.displayChanged(); + + // the context could hold a reference to a MTLSurfaceData, which in + // turn has a reference back to this MTLGraphicsConfig, so in order + // for this instance to be disposed we need to break the connection + MTLRenderQueue rq = MTLRenderQueue.getInstance(); + rq.lock(); + try { + MTLContext.invalidateCurrentContext(); + } finally { + rq.unlock(); + } + } + + @Override + public String toString() { + return ("MTLGraphicsConfig[" + getDevice().getIDstring() + + ",pixfmt="+pixfmt+"]"); + } + + @Override + public SurfaceData createSurfaceData(CPlatformView pView) { + return MTLSurfaceData.createData(pView); + } + + @Override + public SurfaceData createSurfaceData(CFRetainedResource layer) { + return MTLSurfaceData.createData((MTLLayer) layer); + } + + @Override + public Image createAcceleratedImage(Component target, + int width, int height) + { + ColorModel model = getColorModel(Transparency.OPAQUE); + WritableRaster wr = model.createCompatibleWritableRaster(width, height); + return new OffScreenImage(target, model, wr, + model.isAlphaPremultiplied()); + } + + @Override + public void assertOperationSupported(final int numBuffers, + final BufferCapabilities caps) + throws AWTException { + // Assume this method is never called with numBuffers != 2, as 0 is + // unsupported, and 1 corresponds to a SingleBufferStrategy which + // doesn't depend on the peer. Screen is considered as a separate + // "buffer". + if (numBuffers != 2) { + throw new AWTException("Only double buffering is supported"); + } + final BufferCapabilities configCaps = getBufferCapabilities(); + if (!configCaps.isPageFlipping()) { + throw new AWTException("Page flipping is not supported"); + } + if (caps.getFlipContents() == BufferCapabilities.FlipContents.PRIOR) { + throw new AWTException("FlipContents.PRIOR is not supported"); + } + } + + @Override + public Image createBackBuffer(final LWComponentPeer peer) { + final Rectangle r = peer.getBounds(); + // It is possible for the component to have size 0x0, adjust it to + // be at least 1x1 to avoid IAE + final int w = Math.max(1, r.width); + final int h = Math.max(1, r.height); + final int transparency = peer.isTranslucent() ? Transparency.TRANSLUCENT + : Transparency.OPAQUE; + return new SunVolatileImage(this, w, h, transparency, null); + } + + @Override + public void destroyBackBuffer(final Image backBuffer) { + if (backBuffer != null) { + backBuffer.flush(); + } + } + + @Override + public void flip(final LWComponentPeer peer, final Image backBuffer, + final int x1, final int y1, final int x2, final int y2, + final BufferCapabilities.FlipContents flipAction) { + final Graphics g = peer.getGraphics(); + try { + g.drawImage(backBuffer, x1, y1, x2, y2, x1, y1, x2, y2, null); + } finally { + g.dispose(); + } + if (flipAction == BufferCapabilities.FlipContents.BACKGROUND) { + final Graphics2D bg = (Graphics2D) backBuffer.getGraphics(); + try { + bg.setBackground(peer.getBackground()); + bg.clearRect(0, 0, backBuffer.getWidth(null), + backBuffer.getHeight(null)); + } finally { + bg.dispose(); + } + } + } + + private static class MTLBufferCaps extends BufferCapabilities { + public MTLBufferCaps(boolean dblBuf) { + super(imageCaps, imageCaps, + dblBuf ? FlipContents.UNDEFINED : null); + } + } + + @Override + public BufferCapabilities getBufferCapabilities() { + if (bufferCaps == null) { + bufferCaps = new MTLBufferCaps(isDoubleBuffered()); + } + return bufferCaps; + } + + private static class MTLImageCaps extends ImageCapabilities { + private MTLImageCaps() { + super(true); + } + public boolean isTrueVolatile() { + return true; + } + } + + @Override + public ImageCapabilities getImageCapabilities() { + return imageCaps; + } + + @Override + public VolatileImage createCompatibleVolatileImage(int width, int height, + int transparency, + int type) { + if (type != RT_TEXTURE && type != TEXTURE) { + return null; + } + + SunVolatileImage vi = new AccelTypedVolatileImage(this, width, height, + transparency, type); + Surface sd = vi.getDestSurface(); + if (!(sd instanceof AccelSurface) || + ((AccelSurface)sd).getType() != type) + { + vi.flush(); + vi = null; + } + + return vi; + } + + /** + * {@inheritDoc} + * + * @see sun.java2d.pipe.hw.AccelGraphicsConfig#getContextCapabilities + */ + @Override + public ContextCapabilities getContextCapabilities() { + return mtlCaps; + } + + @Override + public int getMaxTextureWidth() { + return Math.max(maxTextureSize / getDevice().getScaleFactor(), + getBounds().width); + } + + @Override + public int getMaxTextureHeight() { + return Math.max(maxTextureSize / getDevice().getScaleFactor(), + getBounds().height); + } +} --- /dev/null 2019-05-16 19:16:28.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/metal/MTLLayer.java 2019-05-16 19:16:28.000000000 +0300 @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.metal; + +import sun.java2d.NullSurfaceData; +import sun.java2d.SurfaceData; +import sun.lwawt.LWWindowPeer; +import sun.lwawt.macosx.CFRetainedResource; + +import java.awt.*; + +public class MTLLayer extends CFRetainedResource { + + private native long nativeCreateLayer(); + private static native void nativeSetScale(long layerPtr, double scale); + private static native void validate(long layerPtr, MTLSurfaceData cglsd); + + private LWWindowPeer peer; + private int scale = 1; + + private SurfaceData surfaceData; // represents intermediate buffer (texture) + + public MTLLayer(LWWindowPeer peer) { + super(0, true); + + setPtr(nativeCreateLayer()); + this.peer = peer; + } + + public long getPointer() { + return ptr; + } + + public Rectangle getBounds() { + return peer.getBounds(); + } + + public GraphicsConfiguration getGraphicsConfiguration() { + return peer.getGraphicsConfiguration(); + } + + public boolean isOpaque() { + return !peer.isTranslucent(); + } + + public int getTransparency() { + return isOpaque() ? Transparency.OPAQUE : Transparency.TRANSLUCENT; + } + + public Object getDestination() { + return peer.getTarget(); + } + + public SurfaceData replaceSurfaceData() { + if (getBounds().isEmpty()) { + surfaceData = NullSurfaceData.theInstance; + return surfaceData; + } + + // the layer redirects all painting to the buffer's graphics + // and blits the buffer to the layer surface (in drawInCGLContext callback) + MTLGraphicsConfig gc = (MTLGraphicsConfig)getGraphicsConfiguration(); + surfaceData = gc.createSurfaceData(this); + setScale(gc.getDevice().getScaleFactor()); + // the layer holds a reference to the buffer, which in + // turn has a reference back to this layer + if (surfaceData instanceof MTLSurfaceData) { + validate((MTLSurfaceData)surfaceData); + } + + return surfaceData; + } + + public SurfaceData getSurfaceData() { + return surfaceData; + } + + public void validate(final MTLSurfaceData cglsd) { + MTLRenderQueue rq = MTLRenderQueue.getInstance(); + rq.lock(); + try { + execute(ptr -> validate(ptr, cglsd)); + } finally { + rq.unlock(); + } + } + + @Override + public void dispose() { + // break the connection between the layer and the buffer + validate(null); + super.dispose(); + } + + private void setScale(final int _scale) { + if (scale != _scale) { + scale = _scale; + execute(ptr -> nativeSetScale(ptr, scale)); + } + } +} --- /dev/null 2019-05-16 19:16:30.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/metal/MTLMaskBlit.java 2019-05-16 19:16:29.000000000 +0300 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.metal; + +import sun.java2d.SurfaceData; +import sun.java2d.loops.CompositeType; +import sun.java2d.loops.GraphicsPrimitive; +import sun.java2d.loops.GraphicsPrimitiveMgr; +import sun.java2d.loops.SurfaceType; +import sun.java2d.pipe.BufferedMaskBlit; +import sun.java2d.pipe.Region; + +import java.awt.*; + +import static sun.java2d.loops.CompositeType.SrcNoEa; +import static sun.java2d.loops.CompositeType.SrcOver; +import static sun.java2d.loops.SurfaceType.*; + +class MTLMaskBlit extends BufferedMaskBlit { + + static void register() { + GraphicsPrimitive[] primitives = { + new MTLMaskBlit(IntArgb, SrcOver), + new MTLMaskBlit(IntArgbPre, SrcOver), + new MTLMaskBlit(IntRgb, SrcOver), + new MTLMaskBlit(IntRgb, SrcNoEa), + new MTLMaskBlit(IntBgr, SrcOver), + new MTLMaskBlit(IntBgr, SrcNoEa), + }; + GraphicsPrimitiveMgr.register(primitives); + } + + private MTLMaskBlit(SurfaceType srcType, + CompositeType compType) + { + super(MTLRenderQueue.getInstance(), + srcType, compType, MTLSurfaceData.MTLSurface); + } + + @Override + protected void validateContext(SurfaceData dstData, + Composite comp, Region clip) + { + MTLSurfaceData oglDst = (MTLSurfaceData)dstData; + MTLContext.validateContext(oglDst, oglDst, + clip, comp, null, null, null, + MTLContext.NO_CONTEXT_FLAGS); + } +} --- /dev/null 2019-05-16 19:16:31.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/metal/MTLMaskFill.java 2019-05-16 19:16:30.000000000 +0300 @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.java2d.metal; + +import sun.java2d.InvalidPipeException; +import sun.java2d.SunGraphics2D; +import sun.java2d.loops.CompositeType; +import sun.java2d.loops.GraphicsPrimitive; +import sun.java2d.loops.GraphicsPrimitiveMgr; +import sun.java2d.loops.SurfaceType; +import sun.java2d.pipe.BufferedMaskFill; + +import java.awt.*; + +import static sun.java2d.loops.CompositeType.SrcNoEa; +import static sun.java2d.loops.CompositeType.SrcOver; +import static sun.java2d.loops.SurfaceType.*; + +class MTLMaskFill extends BufferedMaskFill { + + static void register() { + GraphicsPrimitive[] primitives = { + new MTLMaskFill(AnyColor, SrcOver), + new MTLMaskFill(OpaqueColor, SrcNoEa), + new MTLMaskFill(GradientPaint, SrcOver), + new MTLMaskFill(OpaqueGradientPaint, SrcNoEa), + new MTLMaskFill(LinearGradientPaint, SrcOver), + new MTLMaskFill(OpaqueLinearGradientPaint, SrcNoEa), + new MTLMaskFill(RadialGradientPaint, SrcOver), + new MTLMaskFill(OpaqueRadialGradientPaint, SrcNoEa), + new MTLMaskFill(TexturePaint, SrcOver), + new MTLMaskFill(OpaqueTexturePaint, SrcNoEa), + }; + GraphicsPrimitiveMgr.register(primitives); + } + + protected MTLMaskFill(SurfaceType srcType, CompositeType compType) { + super(MTLRenderQueue.getInstance(), + srcType, compType, MTLSurfaceData.MTLSurface); + } + + @Override + protected native void maskFill(int x, int y, int w, int h, + int maskoff, int maskscan, int masklen, + byte[] mask); + + @Override + protected void validateContext(SunGraphics2D sg2d, + Composite comp, int ctxflags) + { + MTLSurfaceData dstData; + try { + dstData = (MTLSurfaceData) sg2d.surfaceData; + } catch (ClassCastException e) { + throw new InvalidPipeException("wrong surface data type: " + + sg2d.surfaceData); + } + + MTLContext.validateContext(dstData, dstData, + sg2d.getCompClip(), comp, + null, sg2d.paint, sg2d, ctxflags); + } +} --- /dev/null 2019-05-16 19:16:32.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/metal/MTLPaints.java 2019-05-16 19:16:32.000000000 +0300 @@ -0,0 +1,208 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.java2d.metal; + +import sun.java2d.SunGraphics2D; +import sun.java2d.SurfaceData; +import sun.java2d.loops.CompositeType; + +import java.awt.*; +import java.awt.MultipleGradientPaint.ColorSpaceType; +import java.awt.MultipleGradientPaint.CycleMethod; +import java.awt.image.BufferedImage; +import java.util.HashMap; +import java.util.Map; + +import static sun.java2d.metal.MTLContext.MTLContextCaps.CAPS_EXT_GRAD_SHADER; +import static sun.java2d.pipe.BufferedPaints.MULTI_MAX_FRACTIONS; + +abstract class MTLPaints { + + /** + * Holds all registered implementations, using the corresponding + * SunGraphics2D.PAINT_* constant as the hash key. + */ + private static Map impls = + new HashMap(4, 1.0f); + + static { + impls.put(SunGraphics2D.PAINT_GRADIENT, new Gradient()); + impls.put(SunGraphics2D.PAINT_LIN_GRADIENT, new LinearGradient()); + impls.put(SunGraphics2D.PAINT_RAD_GRADIENT, new RadialGradient()); + impls.put(SunGraphics2D.PAINT_TEXTURE, new Texture()); + } + + /** + * Attempts to locate an implementation corresponding to the paint state + * of the provided SunGraphics2D object. If no implementation can be + * found, or if the paint cannot be accelerated under the conditions + * of the SunGraphics2D, this method returns false; otherwise, returns + * true. + */ + static boolean isValid(SunGraphics2D sg2d) { + MTLPaints impl = impls.get(sg2d.paintState); + return (impl != null && impl.isPaintValid(sg2d)); + } + + /** + * Returns true if this implementation is able to accelerate the + * Paint object associated with, and under the conditions of, the + * provided SunGraphics2D instance; otherwise returns false. + */ + abstract boolean isPaintValid(SunGraphics2D sg2d); + +/************************* GradientPaint support ****************************/ + + private static class Gradient extends MTLPaints { + private Gradient() {} + + /** + * There are no restrictions for accelerating GradientPaint, so + * this method always returns true. + */ + @Override + boolean isPaintValid(SunGraphics2D sg2d) { + return true; + } + } + +/************************** TexturePaint support ****************************/ + + private static class Texture extends MTLPaints { + private Texture() {} + + /** + * Returns true if the given TexturePaint instance can be used by the + * accelerated MTLPaints.Texture implementation. A TexturePaint is + * considered valid if the following conditions are met: + * - the texture image dimensions are power-of-two (or the + * GL_ARB_texture_non_power_of_two extension is present) + * - the texture image can be (or is already) cached in an OpenGL + * texture object + */ + @Override + boolean isPaintValid(SunGraphics2D sg2d) { + TexturePaint paint = (TexturePaint)sg2d.paint; + MTLSurfaceData dstData = (MTLSurfaceData)sg2d.surfaceData; + BufferedImage bi = paint.getImage(); + + // see if texture-non-pow2 extension is available + if (!dstData.isTexNonPow2Available()) { + int imgw = bi.getWidth(); + int imgh = bi.getHeight(); + + // verify that the texture image dimensions are pow2 + if ((imgw & (imgw - 1)) != 0 || (imgh & (imgh - 1)) != 0) { + return false; + } + } + + SurfaceData srcData = + dstData.getSourceSurfaceData(bi, + SunGraphics2D.TRANSFORM_ISIDENT, + CompositeType.SrcOver, null); + if (!(srcData instanceof MTLSurfaceData)) { + // REMIND: this is a hack that attempts to cache the system + // memory image from the TexturePaint instance into an + // OpenGL texture... + srcData = + dstData.getSourceSurfaceData(bi, + SunGraphics2D.TRANSFORM_ISIDENT, + CompositeType.SrcOver, null); + if (!(srcData instanceof MTLSurfaceData)) { + return false; + } + } + + // verify that the source surface is actually a texture + MTLSurfaceData oglData = (MTLSurfaceData)srcData; + if (oglData.getType() != MTLSurfaceData.TEXTURE) { + return false; + } + + return true; + } + } + +/****************** Shared MultipleGradientPaint support ********************/ + + private abstract static class MultiGradient extends MTLPaints { + protected MultiGradient() {} + + /** + * Returns true if the given MultipleGradientPaint instance can be + * used by the accelerated MTLPaints.MultiGradient implementation. + * A MultipleGradientPaint is considered valid if the following + * conditions are met: + * - the number of gradient "stops" is <= MAX_FRACTIONS + * - the destination has support for fragment shaders + */ + @Override + boolean isPaintValid(SunGraphics2D sg2d) { + MultipleGradientPaint paint = (MultipleGradientPaint)sg2d.paint; + // REMIND: ugh, this creates garbage; would be nicer if + // we had a MultipleGradientPaint.getNumStops() method... + if (paint.getFractions().length > MULTI_MAX_FRACTIONS) { + return false; + } + + MTLSurfaceData dstData = (MTLSurfaceData)sg2d.surfaceData; + MTLGraphicsConfig gc = dstData.getMTLGraphicsConfig(); + if (!gc.isCapPresent(CAPS_EXT_GRAD_SHADER)) { + return false; + } + + return true; + } + } + +/********************** LinearGradientPaint support *************************/ + + private static class LinearGradient extends MultiGradient { + private LinearGradient() {} + + @Override + boolean isPaintValid(SunGraphics2D sg2d) { + LinearGradientPaint paint = (LinearGradientPaint)sg2d.paint; + + if (paint.getFractions().length == 2 && + paint.getCycleMethod() != CycleMethod.REPEAT && + paint.getColorSpace() != ColorSpaceType.LINEAR_RGB) + { + // we can delegate to the optimized two-color gradient + // codepath, which does not require fragment shader support + return true; + } + + return super.isPaintValid(sg2d); + } + } + +/********************** RadialGradientPaint support *************************/ + + private static class RadialGradient extends MultiGradient { + private RadialGradient() {} + } +} --- /dev/null 2019-05-16 19:16:33.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/metal/MTLRenderQueue.java 2019-05-16 19:16:33.000000000 +0300 @@ -0,0 +1,254 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.metal; + +import sun.awt.util.ThreadGroupUtils; +import sun.java2d.pipe.RenderBuffer; +import sun.java2d.pipe.RenderQueue; + +import java.security.AccessController; +import java.security.PrivilegedAction; + +import static sun.java2d.pipe.BufferedOpCodes.DISPOSE_CONFIG; +import static sun.java2d.pipe.BufferedOpCodes.SYNC; + +/** + * OGL-specific implementation of RenderQueue. This class provides a + * single (daemon) thread that is responsible for periodically flushing + * the queue, thus ensuring that only one thread communicates with the native + * OpenGL libraries for the entire process. + */ +public class MTLRenderQueue extends RenderQueue { + + private static MTLRenderQueue theInstance; + private final QueueFlusher flusher; + + private MTLRenderQueue() { + /* + * The thread must be a member of a thread group + * which will not get GCed before VM exit. + */ + flusher = AccessController.doPrivileged((PrivilegedAction) QueueFlusher::new); + } + + /** + * Returns the single MTLRenderQueue instance. If it has not yet been + * initialized, this method will first construct the single instance + * before returning it. + */ + public static synchronized MTLRenderQueue getInstance() { + if (theInstance == null) { + theInstance = new MTLRenderQueue(); + } + return theInstance; + } + + /** + * Flushes the single MTLRenderQueue instance synchronously. If an + * MTLRenderQueue has not yet been instantiated, this method is a no-op. + * This method is useful in the case of Toolkit.sync(), in which we want + * to flush the OGL pipeline, but only if the OGL pipeline is currently + * enabled. Since this class has few external dependencies, callers need + * not be concerned that calling this method will trigger initialization + * of the OGL pipeline and related classes. + */ + public static void sync() { + if (theInstance != null) { + theInstance.lock(); + try { + theInstance.ensureCapacity(4); + theInstance.getBuffer().putInt(SYNC); + theInstance.flushNow(); + } finally { + theInstance.unlock(); + } + } + } + + /** + * Disposes the native memory associated with the given native + * graphics config info pointer on the single queue flushing thread. + */ + public static void disposeGraphicsConfig(long pConfigInfo) { + MTLRenderQueue rq = getInstance(); + rq.lock(); + try { + // make sure we make the context associated with the given + // GraphicsConfig current before disposing the native resources + MTLContext.setScratchSurface(pConfigInfo); + + RenderBuffer buf = rq.getBuffer(); + rq.ensureCapacityAndAlignment(12, 4); + buf.putInt(DISPOSE_CONFIG); + buf.putLong(pConfigInfo); + + // this call is expected to complete synchronously, so flush now + rq.flushNow(); + } finally { + rq.unlock(); + } + } + + /** + * Returns true if the current thread is the OGL QueueFlusher thread. + */ + public static boolean isQueueFlusherThread() { + return (Thread.currentThread() == getInstance().flusher.thread); + } + + + @Override + public void flushNow() { + // assert lock.isHeldByCurrentThread(); + try { + flusher.flushNow(); + } catch (Exception e) { + System.err.println("exception in flushNow:"); + e.printStackTrace(); + } + } + + public void flushAndInvokeNow(Runnable r) { + // assert lock.isHeldByCurrentThread(); + try { + flusher.flushAndInvokeNow(r); + } catch (Exception e) { + System.err.println("exception in flushAndInvokeNow:"); + e.printStackTrace(); + } + } + + private native void flushBuffer(long buf, int limit); + + private void flushBuffer() { + // assert lock.isHeldByCurrentThread(); + int limit = buf.position(); + if (limit > 0) { + // process the queue + flushBuffer(buf.getAddress(), limit); + } + // reset the buffer position + buf.clear(); + // clear the set of references, since we no longer need them + refSet.clear(); + } + + private class QueueFlusher implements Runnable { + private boolean needsFlush; + private Runnable task; + private Error error; + private final Thread thread; + + public QueueFlusher() { + String name = "Java2D Queue Flusher"; + thread = new Thread(ThreadGroupUtils.getRootThreadGroup(), + this, name, 0, false); + thread.setDaemon(true); + thread.setPriority(Thread.MAX_PRIORITY); + thread.start(); + } + + public synchronized void flushNow() { + // wake up the flusher + needsFlush = true; + notify(); + + // wait for flush to complete + while (needsFlush) { + try { + wait(); + } catch (InterruptedException e) { + } + } + + // re-throw any error that may have occurred during the flush + if (error != null) { + throw error; + } + } + + public synchronized void flushAndInvokeNow(Runnable task) { + this.task = task; + flushNow(); + } + + public synchronized void run() { + boolean timedOut = false; + while (true) { + while (!needsFlush) { + try { + timedOut = false; + /* + * Wait until we're woken up with a flushNow() call, + * or the timeout period elapses (so that we can + * flush the queue periodically). + */ + wait(100); + /* + * We will automatically flush the queue if the + * following conditions apply: + * - the wait() timed out + * - we can lock the queue (without blocking) + * - there is something in the queue to flush + * Otherwise, just continue (we'll flush eventually). + */ + if (!needsFlush && (timedOut = tryLock())) { + if (buf.position() > 0) { + needsFlush = true; + } else { + unlock(); + } + } + } catch (InterruptedException e) { + } + } + try { + // reset the throwable state + error = null; + // flush the buffer now + flushBuffer(); + // if there's a task, invoke that now as well + if (task != null) { + task.run(); + } + } catch (Error e) { + error = e; + } catch (Exception x) { + System.err.println("exception in QueueFlusher:"); + x.printStackTrace(); + } finally { + if (timedOut) { + unlock(); + } + task = null; + // allow the waiting thread to continue + needsFlush = false; + notify(); + } + } + } + } +} --- /dev/null 2019-05-16 19:16:34.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/metal/MTLRenderer.java 2019-05-16 19:16:34.000000000 +0300 @@ -0,0 +1,223 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.java2d.metal; + +import sun.java2d.InvalidPipeException; +import sun.java2d.SunGraphics2D; +import sun.java2d.loops.GraphicsPrimitive; +import sun.java2d.pipe.BufferedRenderPipe; +import sun.java2d.pipe.ParallelogramPipe; +import sun.java2d.pipe.RenderQueue; +import sun.java2d.pipe.SpanIterator; + +import java.awt.*; +import java.awt.geom.Path2D; + +import static sun.java2d.pipe.BufferedOpCodes.COPY_AREA; + +class MTLRenderer extends BufferedRenderPipe { + + MTLRenderer(RenderQueue rq) { + super(rq); + } + + @Override + protected void validateContext(SunGraphics2D sg2d) { + int ctxflags = + sg2d.paint.getTransparency() == Transparency.OPAQUE ? + MTLContext.SRC_IS_OPAQUE : MTLContext.NO_CONTEXT_FLAGS; + MTLSurfaceData dstData; + try { + dstData = (MTLSurfaceData)sg2d.surfaceData; + } catch (ClassCastException e) { + throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); + } + MTLContext.validateContext(dstData, dstData, + sg2d.getCompClip(), sg2d.composite, + null, sg2d.paint, sg2d, ctxflags); + } + + @Override + protected void validateContextAA(SunGraphics2D sg2d) { + int ctxflags = MTLContext.NO_CONTEXT_FLAGS; + MTLSurfaceData dstData; + try { + dstData = (MTLSurfaceData)sg2d.surfaceData; + } catch (ClassCastException e) { + throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); + } + MTLContext.validateContext(dstData, dstData, + sg2d.getCompClip(), sg2d.composite, + null, sg2d.paint, sg2d, ctxflags); + } + + void copyArea(SunGraphics2D sg2d, + int x, int y, int w, int h, int dx, int dy) + { + rq.lock(); + try { + int ctxflags = + sg2d.surfaceData.getTransparency() == Transparency.OPAQUE ? + MTLContext.SRC_IS_OPAQUE : MTLContext.NO_CONTEXT_FLAGS; + MTLSurfaceData dstData; + try { + dstData = (MTLSurfaceData)sg2d.surfaceData; + } catch (ClassCastException e) { + throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData); + } + MTLContext.validateContext(dstData, dstData, + sg2d.getCompClip(), sg2d.composite, + null, null, null, ctxflags); + + rq.ensureCapacity(28); + buf.putInt(COPY_AREA); + buf.putInt(x).putInt(y).putInt(w).putInt(h); + buf.putInt(dx).putInt(dy); + } finally { + rq.unlock(); + } + } + + @Override + protected native void drawPoly(int[] xPoints, int[] yPoints, + int nPoints, boolean isClosed, + int transX, int transY); + + MTLRenderer traceWrap() { + return new Tracer(this); + } + + private class Tracer extends MTLRenderer { + private MTLRenderer mtlr; + Tracer(MTLRenderer mtlr) { + super(mtlr.rq); + this.mtlr = mtlr; + } + public ParallelogramPipe getAAParallelogramPipe() { + final ParallelogramPipe realpipe = mtlr.getAAParallelogramPipe(); + return new ParallelogramPipe() { + public void fillParallelogram(SunGraphics2D sg2d, + double ux1, double uy1, + double ux2, double uy2, + double x, double y, + double dx1, double dy1, + double dx2, double dy2) + { + GraphicsPrimitive.tracePrimitive("MTLFillAAParallelogram"); + realpipe.fillParallelogram(sg2d, + ux1, uy1, ux2, uy2, + x, y, dx1, dy1, dx2, dy2); + } + public void drawParallelogram(SunGraphics2D sg2d, + double ux1, double uy1, + double ux2, double uy2, + double x, double y, + double dx1, double dy1, + double dx2, double dy2, + double lw1, double lw2) + { + GraphicsPrimitive.tracePrimitive("MTLDrawAAParallelogram"); + realpipe.drawParallelogram(sg2d, + ux1, uy1, ux2, uy2, + x, y, dx1, dy1, dx2, dy2, + lw1, lw2); + } + }; + } + protected void validateContext(SunGraphics2D sg2d) { + mtlr.validateContext(sg2d); + } + public void drawLine(SunGraphics2D sg2d, + int x1, int y1, int x2, int y2) + { + GraphicsPrimitive.tracePrimitive("MTLDrawLine"); + mtlr.drawLine(sg2d, x1, y1, x2, y2); + } + public void drawRect(SunGraphics2D sg2d, int x, int y, int w, int h) { + GraphicsPrimitive.tracePrimitive("MTLDrawRect"); + mtlr.drawRect(sg2d, x, y, w, h); + } + protected void drawPoly(SunGraphics2D sg2d, + int[] xPoints, int[] yPoints, + int nPoints, boolean isClosed) + { + GraphicsPrimitive.tracePrimitive("MTLDrawPoly"); + mtlr.drawPoly(sg2d, xPoints, yPoints, nPoints, isClosed); + } + public void fillRect(SunGraphics2D sg2d, int x, int y, int w, int h) { + GraphicsPrimitive.tracePrimitive("MTLFillRect"); + mtlr.fillRect(sg2d, x, y, w, h); + } + protected void drawPath(SunGraphics2D sg2d, + Path2D.Float p2df, int transx, int transy) + { + GraphicsPrimitive.tracePrimitive("MTLDrawPath"); + mtlr.drawPath(sg2d, p2df, transx, transy); + } + protected void fillPath(SunGraphics2D sg2d, + Path2D.Float p2df, int transx, int transy) + { + GraphicsPrimitive.tracePrimitive("MTLFillPath"); + mtlr.fillPath(sg2d, p2df, transx, transy); + } + protected void fillSpans(SunGraphics2D sg2d, SpanIterator si, + int transx, int transy) + { + GraphicsPrimitive.tracePrimitive("MTLFillSpans"); + mtlr.fillSpans(sg2d, si, transx, transy); + } + public void fillParallelogram(SunGraphics2D sg2d, + double ux1, double uy1, + double ux2, double uy2, + double x, double y, + double dx1, double dy1, + double dx2, double dy2) + { + GraphicsPrimitive.tracePrimitive("MTLFillParallelogram"); + mtlr.fillParallelogram(sg2d, + ux1, uy1, ux2, uy2, + x, y, dx1, dy1, dx2, dy2); + } + public void drawParallelogram(SunGraphics2D sg2d, + double ux1, double uy1, + double ux2, double uy2, + double x, double y, + double dx1, double dy1, + double dx2, double dy2, + double lw1, double lw2) + { + GraphicsPrimitive.tracePrimitive("MTLDrawParallelogram"); + mtlr.drawParallelogram(sg2d, + ux1, uy1, ux2, uy2, + x, y, dx1, dy1, dx2, dy2, lw1, lw2); + } + public void copyArea(SunGraphics2D sg2d, + int x, int y, int w, int h, int dx, int dy) + { + GraphicsPrimitive.tracePrimitive("MTLCopyArea"); + mtlr.copyArea(sg2d, x, y, w, h, dx, dy); + } + } +} --- /dev/null 2019-05-16 19:16:35.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/metal/MTLSurfaceData.java 2019-05-16 19:16:35.000000000 +0300 @@ -0,0 +1,885 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.metal; + +import sun.awt.SunHints; +import sun.awt.image.PixelConverter; +import sun.java2d.SunGraphics2D; +import sun.java2d.SurfaceData; +import sun.java2d.SurfaceDataProxy; +import sun.java2d.loops.CompositeType; +import sun.java2d.loops.GraphicsPrimitive; +import sun.java2d.loops.MaskFill; +import sun.java2d.loops.SurfaceType; +import sun.java2d.pipe.ParallelogramPipe; +import sun.java2d.pipe.PixelToParallelogramConverter; +import sun.java2d.pipe.RenderBuffer; +import sun.java2d.pipe.TextPipe; +import sun.java2d.pipe.hw.AccelSurface; +import sun.lwawt.macosx.CPlatformView; + +import java.awt.*; +import java.awt.image.ColorModel; +import java.awt.image.Raster; + +import static sun.java2d.metal.MTLContext.MTLContextCaps.CAPS_EXT_LCD_SHADER; +import static sun.java2d.metal.MTLContext.MTLContextCaps.CAPS_EXT_TEXRECT; +import static sun.java2d.pipe.BufferedOpCodes.FLUSH_SURFACE; +import static sun.java2d.pipe.BufferedOpCodes.SWAP_BUFFERS; +import static sun.java2d.pipe.hw.ContextCapabilities.*; + +public abstract class MTLSurfaceData extends SurfaceData + implements AccelSurface { + + /** + * Pixel formats + */ + public static final int PF_INT_ARGB = 0; + public static final int PF_INT_ARGB_PRE = 1; + public static final int PF_INT_RGB = 2; + public static final int PF_INT_RGBX = 3; + public static final int PF_INT_BGR = 4; + public static final int PF_INT_BGRX = 5; + public static final int PF_USHORT_565_RGB = 6; + public static final int PF_USHORT_555_RGB = 7; + public static final int PF_USHORT_555_RGBX = 8; + public static final int PF_BYTE_GRAY = 9; + public static final int PF_USHORT_GRAY = 10; + public static final int PF_3BYTE_BGR = 11; + /** + * SurfaceTypes + */ + + private static final String DESC_MTL_SURFACE = "MTL Surface"; + private static final String DESC_MTL_SURFACE_RTT = + "MTL Surface (render-to-texture)"; + private static final String DESC_MTL_TEXTURE = "MTL Texture"; + + + static final SurfaceType MTLSurface = + SurfaceType.Any.deriveSubType(DESC_MTL_SURFACE, + PixelConverter.ArgbPre.instance); + static final SurfaceType MTLSurfaceRTT = + MTLSurface.deriveSubType(DESC_MTL_SURFACE_RTT); + static final SurfaceType MTLTexture = + SurfaceType.Any.deriveSubType(DESC_MTL_TEXTURE); + + protected static MTLRenderer mtlRenderPipe; + protected static PixelToParallelogramConverter mtlTxRenderPipe; + protected static ParallelogramPipe mtlAAPgramPipe; + protected static MTLTextRenderer mtlTextPipe; + protected static MTLDrawImage mtlImagePipe; + /** This will be true if the fbobject system property has been enabled. */ + private static boolean isFBObjectEnabled; + /** This will be true if the lcdshader system property has been enabled.*/ + private static boolean isLCDShaderEnabled; + /** This will be true if the biopshader system property has been enabled.*/ + private static boolean isBIOpShaderEnabled; + /** This will be true if the gradshader system property has been enabled.*/ + private static boolean isGradShaderEnabled; + + static { + if (!GraphicsEnvironment.isHeadless()) { + // fbobject currently enabled by default; use "false" to disable + String fbo = java.security.AccessController.doPrivileged( + new sun.security.action.GetPropertyAction( + "java2d.metal.fbobject")); + isFBObjectEnabled = !"false".equals(fbo); + + // lcdshader currently enabled by default; use "false" to disable + String lcd = java.security.AccessController.doPrivileged( + new sun.security.action.GetPropertyAction( + "java2d.metal.lcdshader")); + isLCDShaderEnabled = !"false".equals(lcd); + + // biopshader currently enabled by default; use "false" to disable + String biop = java.security.AccessController.doPrivileged( + new sun.security.action.GetPropertyAction( + "java2d.metal.biopshader")); + isBIOpShaderEnabled = !"false".equals(biop); + + // gradshader currently enabled by default; use "false" to disable + String grad = java.security.AccessController.doPrivileged( + new sun.security.action.GetPropertyAction( + "java2d.metal.gradshader")); + isGradShaderEnabled = !"false".equals(grad); + + MTLRenderQueue rq = MTLRenderQueue.getInstance(); + mtlImagePipe = new MTLDrawImage(); + mtlTextPipe = new MTLTextRenderer(rq); + mtlRenderPipe = new MTLRenderer(rq); + if (GraphicsPrimitive.tracingEnabled()) { + mtlTextPipe = mtlTextPipe.traceWrap(); + //The wrapped mtlRenderPipe will wrap the AA pipe as well... + //mtlAAPgramPipe = mtlRenderPipe.traceWrap(); + } + mtlAAPgramPipe = mtlRenderPipe.getAAParallelogramPipe(); + mtlTxRenderPipe = + new PixelToParallelogramConverter(mtlRenderPipe, + mtlRenderPipe, + 1.0, 0.25, true); + + MTLBlitLoops.register(); + MTLMaskFill.register(); + MTLMaskBlit.register(); + } + } + + protected final int scale; + protected final int width; + protected final int height; + protected CPlatformView pView; + protected int type; + private MTLGraphicsConfig graphicsConfig; + // these fields are set from the native code when the surface is + // initialized + private int nativeWidth; + private int nativeHeight; + + /** + * Returns the appropriate SurfaceType corresponding to the given OpenGL + * surface type constant (e.g. TEXTURE -> MTLTexture). + */ + private static SurfaceType getCustomSurfaceType(int oglType) { + switch (oglType) { + case TEXTURE: + return MTLTexture; + case RT_TEXTURE: + return MTLSurfaceRTT; + default: + return MTLSurface; + } + } + + static void swapBuffers(long window) { + MTLRenderQueue rq = MTLRenderQueue.getInstance(); + rq.lock(); + try { + RenderBuffer buf = rq.getBuffer(); + rq.ensureCapacityAndAlignment(12, 4); + buf.putInt(SWAP_BUFFERS); + buf.putLong(window); + rq.flushNow(); + } finally { + rq.unlock(); + } + } + + native void validate(int xoff, int yoff, int width, int height, boolean isOpaque); + + private native void initOps(long pConfigInfo, long pPeerData, long layerPtr, + int xoff, int yoff, boolean isOpaque); + + protected MTLSurfaceData(MTLGraphicsConfig gc, ColorModel cm, int type, + int width, int height) { + super(getCustomSurfaceType(type), cm); + this.graphicsConfig = gc; + this.type = type; + setBlitProxyKey(gc.getProxyKey()); + + // TEXTURE shouldn't be scaled, it is used for managed BufferedImages. + scale = type == TEXTURE ? 1 : gc.getDevice().getScaleFactor(); + this.width = width * scale; + this.height = height * scale; + } + + protected MTLSurfaceData(CPlatformView pView, MTLGraphicsConfig gc, + ColorModel cm, int type, int width, int height) + { + this(gc, cm, type, width, height); + this.pView = pView; + this.graphicsConfig = gc; + + long pConfigInfo = gc.getNativeConfigInfo(); + long pPeerData = 0L; + boolean isOpaque = true; + if (pView != null) { + pPeerData = pView.getAWTView(); + isOpaque = pView.isOpaque(); + } + MTLGraphicsConfig.refPConfigInfo(pConfigInfo); + initOps(pConfigInfo, pPeerData, 0, 0, 0, isOpaque); + } + + protected MTLSurfaceData(MTLLayer layer, MTLGraphicsConfig gc, + ColorModel cm, int type, int width, int height) + { + this(gc, cm, type, width, height); + this.graphicsConfig = gc; + + long pConfigInfo = gc.getNativeConfigInfo(); + long layerPtr = 0L; + boolean isOpaque = true; + if (layer != null) { + layerPtr = layer.getPointer(); + isOpaque = layer.isOpaque(); + } + MTLGraphicsConfig.refPConfigInfo(pConfigInfo); + initOps(pConfigInfo, 0, layerPtr, 0, 0, isOpaque); + } + + @Override //SurfaceData + public GraphicsConfiguration getDeviceConfiguration() { + return graphicsConfig; + } + + /** + * Creates a SurfaceData object representing the primary (front) buffer of + * an on-screen Window. + */ + public static MTLWindowSurfaceData createData(CPlatformView pView) { + MTLGraphicsConfig gc = getGC(pView); + return new MTLWindowSurfaceData(pView, gc); + } + + /** + * Creates a SurfaceData object representing the intermediate buffer + * between the Java2D flusher thread and the AppKit thread. + */ + public static MTLLayerSurfaceData createData(MTLLayer layer) { + MTLGraphicsConfig gc = getGC(layer); + Rectangle r = layer.getBounds(); + return new MTLLayerSurfaceData(layer, gc, r.width, r.height); + } + + /** + * Creates a SurfaceData object representing the back buffer of a + * double-buffered on-screen Window. + */ + public static MTLOffScreenSurfaceData createData(CPlatformView pView, + Image image, int type) { + MTLGraphicsConfig gc = getGC(pView); + Rectangle r = pView.getBounds(); + if (type == FLIP_BACKBUFFER) { + return new MTLOffScreenSurfaceData(pView, gc, r.width, r.height, + image, gc.getColorModel(), FLIP_BACKBUFFER); + } else { + return new MTLVSyncOffScreenSurfaceData(pView, gc, r.width, + r.height, image, gc.getColorModel(), type); + } + } + + /** + * Creates a SurfaceData object representing an off-screen buffer (either a + * FBO or Texture). + */ + public static MTLOffScreenSurfaceData createData(MTLGraphicsConfig gc, + int width, int height, ColorModel cm, Image image, int type) { + return new MTLOffScreenSurfaceData(null, gc, width, height, image, cm, + type); + } + + public static MTLGraphicsConfig getGC(CPlatformView pView) { + if (pView != null) { + return (MTLGraphicsConfig)pView.getGraphicsConfiguration(); + } else { + // REMIND: this should rarely (never?) happen, but what if + // default config is not CGL? + GraphicsEnvironment env = GraphicsEnvironment + .getLocalGraphicsEnvironment(); + GraphicsDevice gd = env.getDefaultScreenDevice(); + return (MTLGraphicsConfig) gd.getDefaultConfiguration(); + } + } + + public static MTLGraphicsConfig getGC(MTLLayer layer) { + return (MTLGraphicsConfig)layer.getGraphicsConfiguration(); + } + + public void validate() { + // Overridden in MTLWindowSurfaceData below + } + + @Override + public double getDefaultScaleX() { + return scale; + } + + @Override + public double getDefaultScaleY() { + return scale; + } + + protected native void clearWindow(); + + protected native boolean initTexture(long pData, + boolean isOpaque, boolean texNonPow2, + boolean texRect, + int width, int height); + + protected native boolean initRTexture(long pData, + boolean isOpaque, boolean texNonPow2, + boolean texRect, + int width, int height); + + protected native boolean initFlipBackbuffer(long pData); + + @Override + public SurfaceDataProxy makeProxyFor(SurfaceData srcData) { + return MTLSurfaceDataProxy.createProxy(srcData, graphicsConfig); + } + + /** + * Note: This should only be called from the QFT under the AWT lock. + * This method is kept separate from the initSurface() method below just + * to keep the code a bit cleaner. + */ + private void initSurfaceNow(int width, int height) { + boolean isOpaque = (getTransparency() == Transparency.OPAQUE); + boolean success = false; + + switch (type) { + case TEXTURE: + success = initTexture(getNativeOps(), + isOpaque, isTexNonPow2Available(), + isTexRectAvailable(), + width, height); + break; + + case RT_TEXTURE: + success = initRTexture(getNativeOps(), + isOpaque, isTexNonPow2Available(), + isTexRectAvailable(), + width, height); + break; + + case FLIP_BACKBUFFER: + success = initFlipBackbuffer(getNativeOps()); + break; + + default: + break; + } + + if (!success) { + throw new OutOfMemoryError("can't create offscreen surface"); + } + } + + /** + * Initializes the appropriate OpenGL offscreen surface based on the value + * of the type parameter. If the surface creation fails for any reason, + * an OutOfMemoryError will be thrown. + */ + protected void initSurface(final int width, final int height) { + MTLRenderQueue rq = MTLRenderQueue.getInstance(); + rq.lock(); + try { + switch (type) { + case TEXTURE: + case RT_TEXTURE: + // need to make sure the context is current before + // creating the texture or fbobject + MTLContext.setScratchSurface(graphicsConfig); + break; + default: + break; + } + rq.flushAndInvokeNow(new Runnable() { + public void run() { + initSurfaceNow(width, height); + } + }); + } finally { + rq.unlock(); + } + } + + /** + * Returns the MTLContext for the GraphicsConfig associated with this + * surface. + */ + public final MTLContext getContext() { + return graphicsConfig.getContext(); + } + + /** + * Returns the MTLGraphicsConfig associated with this surface. + */ + final MTLGraphicsConfig getMTLGraphicsConfig() { + return graphicsConfig; + } + + /** + * Returns one of the surface type constants defined above. + */ + public final int getType() { + return type; + } + + /** + * For now, we can only render LCD text if: + * - the fragment shader extension is available, and + * - the source color is opaque, and + * - blending is SrcOverNoEa or disabled + * - and the destination is opaque + * + * Eventually, we could enhance the native OGL text rendering code + * and remove the above restrictions, but that would require significantly + * more code just to support a few uncommon cases. + */ + public boolean canRenderLCDText(SunGraphics2D sg2d) { + return + graphicsConfig.isCapPresent(CAPS_EXT_LCD_SHADER) && + sg2d.surfaceData.getTransparency() == Transparency.OPAQUE && + sg2d.paintState <= SunGraphics2D.PAINT_OPAQUECOLOR && + (sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY || + (sg2d.compositeState <= SunGraphics2D.COMP_ALPHA && canHandleComposite(sg2d.composite))); + } + + private boolean canHandleComposite(Composite c) { + if (c instanceof AlphaComposite) { + AlphaComposite ac = (AlphaComposite)c; + + return ac.getRule() == AlphaComposite.SRC_OVER && ac.getAlpha() >= 1f; + } + return false; + } + + public void validatePipe(SunGraphics2D sg2d) { + TextPipe textpipe; + boolean validated = false; + + // MTLTextRenderer handles both AA and non-AA text, but + // only works with the following modes: + // (Note: For LCD text we only enter this code path if + // canRenderLCDText() has already validated that the mode is + // CompositeType.SrcNoEa (opaque color), which will be subsumed + // by the CompositeType.SrcNoEa (any color) test below.) + + if (/* CompositeType.SrcNoEa (any color) */ + (sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY && + sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR) || + + /* CompositeType.SrcOver (any color) */ + (sg2d.compositeState == SunGraphics2D.COMP_ALPHA && + sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR && + (((AlphaComposite)sg2d.composite).getRule() == + AlphaComposite.SRC_OVER)) || + + /* CompositeType.Xor (any color) */ + (sg2d.compositeState == SunGraphics2D.COMP_XOR && + sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR)) + { + textpipe = mtlTextPipe; + } else { + // do this to initialize textpipe correctly; we will attempt + // to override the non-text pipes below + super.validatePipe(sg2d); + textpipe = sg2d.textpipe; + validated = true; + } + + PixelToParallelogramConverter txPipe = null; + MTLRenderer nonTxPipe = null; + + if (sg2d.antialiasHint != SunHints.INTVAL_ANTIALIAS_ON) { + if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR) { + if (sg2d.compositeState <= SunGraphics2D.COMP_XOR) { + txPipe = mtlTxRenderPipe; + nonTxPipe = mtlRenderPipe; + } + } else if (sg2d.compositeState <= SunGraphics2D.COMP_ALPHA) { + if (MTLPaints.isValid(sg2d)) { + txPipe = mtlTxRenderPipe; + nonTxPipe = mtlRenderPipe; + } + // custom paints handled by super.validatePipe() below + } + } else { + if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR) { + if (graphicsConfig.isCapPresent(CAPS_PS30) && + (sg2d.imageComp == CompositeType.SrcOverNoEa || + sg2d.imageComp == CompositeType.SrcOver)) + { + if (!validated) { + super.validatePipe(sg2d); + validated = true; + } + PixelToParallelogramConverter aaConverter = + new PixelToParallelogramConverter(sg2d.shapepipe, + mtlAAPgramPipe, + 1.0/8.0, 0.499, + false); + sg2d.drawpipe = aaConverter; + sg2d.fillpipe = aaConverter; + sg2d.shapepipe = aaConverter; + } else if (sg2d.compositeState == SunGraphics2D.COMP_XOR) { + // install the solid pipes when AA and XOR are both enabled + txPipe = mtlTxRenderPipe; + nonTxPipe = mtlRenderPipe; + } + } + // other cases handled by super.validatePipe() below + } + + if (txPipe != null) { + if (sg2d.transformState >= SunGraphics2D.TRANSFORM_TRANSLATESCALE) { + sg2d.drawpipe = txPipe; + sg2d.fillpipe = txPipe; + } else if (sg2d.strokeState != SunGraphics2D.STROKE_THIN) { + sg2d.drawpipe = txPipe; + sg2d.fillpipe = nonTxPipe; + } else { + sg2d.drawpipe = nonTxPipe; + sg2d.fillpipe = nonTxPipe; + } + // Note that we use the transforming pipe here because it + // will examine the shape and possibly perform an optimized + // operation if it can be simplified. The simplifications + // will be valid for all STROKE and TRANSFORM types. + sg2d.shapepipe = txPipe; + } else { + if (!validated) { + super.validatePipe(sg2d); + } + } + + // install the text pipe based on our earlier decision + sg2d.textpipe = textpipe; + + // always override the image pipe with the specialized OGL pipe + sg2d.imagepipe = mtlImagePipe; + } + + @Override + protected MaskFill getMaskFill(SunGraphics2D sg2d) { + if (sg2d.paintState > SunGraphics2D.PAINT_ALPHACOLOR) { + /* + * We can only accelerate non-Color MaskFill operations if + * all of the following conditions hold true: + * - there is an implementation for the given paintState + * - the current Paint can be accelerated for this destination + * - multitexturing is available (since we need to modulate + * the alpha mask texture with the paint texture) + * + * In all other cases, we return null, in which case the + * validation code will choose a more general software-based loop. + */ + if (!MTLPaints.isValid(sg2d) || + !graphicsConfig.isCapPresent(CAPS_MULTITEXTURE)) + { + return null; + } + } + return super.getMaskFill(sg2d); + } + + public void flush() { + invalidate(); + MTLRenderQueue rq = MTLRenderQueue.getInstance(); + rq.lock(); + try { + // make sure we have a current context before + // disposing the native resources (e.g. texture object) + MTLContext.setScratchSurface(graphicsConfig); + + RenderBuffer buf = rq.getBuffer(); + rq.ensureCapacityAndAlignment(12, 4); + buf.putInt(FLUSH_SURFACE); + buf.putLong(getNativeOps()); + + // this call is expected to complete synchronously, so flush now + rq.flushNow(); + } finally { + rq.unlock(); + } + } + + /** + * Returns true if OpenGL textures can have non-power-of-two dimensions + * when using the basic GL_TEXTURE_2D target. + */ + boolean isTexNonPow2Available() { + return graphicsConfig.isCapPresent(CAPS_TEXNONPOW2); + } + + /** + * Returns true if OpenGL textures can have non-power-of-two dimensions + * when using the GL_TEXTURE_RECTANGLE_ARB target (only available when the + * GL_ARB_texture_rectangle extension is present). + */ + boolean isTexRectAvailable() { + return graphicsConfig.isCapPresent(CAPS_EXT_TEXRECT); + } + + /** + * Returns true if the surface is an on-screen window surface or + * a FBO texture attached to an on-screen CALayer. + * + * Needed by Mac OS X port. + */ + public boolean isOnScreen() { + return getType() == WINDOW; + } + + private native int getTextureTarget(long pData); + + private native int getTextureID(long pData); + + /** + * If this surface is backed by a texture object, returns the target + * for that texture (either GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB). + * Otherwise, this method will return zero. + */ + public final int getTextureTarget() { + return getTextureTarget(getNativeOps()); + } + + /** + * If this surface is backed by a texture object, returns the texture ID + * for that texture. + * Otherwise, this method will return zero. + */ + public final int getTextureID() { + return getTextureID(getNativeOps()); + } + + /** + * Returns native resource of specified {@code resType} associated with + * this surface. + * + * Specifically, for {@code MTLSurfaceData} this method returns the + * the following: + *
+     * TEXTURE              - texture id
+     * 
+ * + * Note: the resource returned by this method is only valid on the rendering + * thread. + * + * @return native resource of specified type or 0L if + * such resource doesn't exist or can not be retrieved. + * @see AccelSurface#getNativeResource + */ + public long getNativeResource(int resType) { + if (resType == TEXTURE) { + return getTextureID(); + } + return 0L; + } + + public Raster getRaster(int x, int y, int w, int h) { + throw new InternalError("not implemented yet"); + } + + @Override + public boolean copyArea(SunGraphics2D sg2d, int x, int y, int w, int h, + int dx, int dy) { + if (sg2d.compositeState >= SunGraphics2D.COMP_XOR) { + return false; + } + mtlRenderPipe.copyArea(sg2d, x, y, w, h, dx, dy); + return true; + } + + public Rectangle getNativeBounds() { + MTLRenderQueue rq = MTLRenderQueue.getInstance(); + rq.lock(); + try { + return new Rectangle(nativeWidth, nativeHeight); + } finally { + rq.unlock(); + } + } + + public static class MTLWindowSurfaceData extends MTLSurfaceData { + + public MTLWindowSurfaceData(CPlatformView pView, + MTLGraphicsConfig gc) { + super(pView, gc, gc.getColorModel(), WINDOW, 0, 0); + } + + @Override + public SurfaceData getReplacement() { + return pView.getSurfaceData(); + } + + @Override + public Rectangle getBounds() { + Rectangle r = pView.getBounds(); + return new Rectangle(0, 0, r.width, r.height); + } + + /** + * Returns destination Component associated with this SurfaceData. + */ + @Override + public Object getDestination() { + return pView.getDestination(); + } + + public void validate() { + MTLRenderQueue rq = MTLRenderQueue.getInstance(); + rq.lock(); + try { + rq.flushAndInvokeNow(() -> { + Rectangle peerBounds = pView.getBounds(); + validate(0, 0, peerBounds.width, peerBounds.height, pView.isOpaque()); + }); + } finally { + rq.unlock(); + } + } + + @Override + public void invalidate() { + super.invalidate(); + clearWindow(); + } + } + + /** + * A surface which implements an intermediate buffer between + * the Java2D flusher thread and the AppKit thread. + * + * This surface serves as a buffer attached to a MTLLayer and + * the layer redirects all painting to the buffer's graphics. + */ + public static class MTLLayerSurfaceData extends MTLSurfaceData { + + private MTLLayer layer; + + public MTLLayerSurfaceData(MTLLayer layer, MTLGraphicsConfig gc, + int width, int height) { + super(layer, gc, gc.getColorModel(), RT_TEXTURE, width, height); + this.layer = layer; + initSurface(this.width, this.height); + } + + @Override + public SurfaceData getReplacement() { + return layer.getSurfaceData(); + } + + @Override + public boolean isOnScreen() { + return true; + } + + @Override + public Rectangle getBounds() { + return new Rectangle(width, height); + } + + @Override + public Object getDestination() { + return layer.getDestination(); + } + + @Override + public int getTransparency() { + return layer.getTransparency(); + } + + @Override + public void invalidate() { + super.invalidate(); + clearWindow(); + } + } + + /** + * A surface which implements a v-synced flip back-buffer with COPIED + * FlipContents. + * + * This surface serves as a back-buffer to the outside world, while it is + * actually an offscreen surface. When the BufferStrategy this surface + * belongs to is showed, it is first copied to the real private + * FLIP_BACKBUFFER, which is then flipped. + */ + public static class MTLVSyncOffScreenSurfaceData extends + MTLOffScreenSurfaceData { + private MTLOffScreenSurfaceData flipSurface; + + public MTLVSyncOffScreenSurfaceData(CPlatformView pView, + MTLGraphicsConfig gc, int width, int height, Image image, + ColorModel cm, int type) { + super(pView, gc, width, height, image, cm, type); + flipSurface = MTLSurfaceData.createData(pView, image, + FLIP_BACKBUFFER); + } + + public SurfaceData getFlipSurface() { + return flipSurface; + } + + @Override + public void flush() { + flipSurface.flush(); + super.flush(); + } + } + + public static class MTLOffScreenSurfaceData extends MTLSurfaceData { + private Image offscreenImage; + + public MTLOffScreenSurfaceData(CPlatformView pView, + MTLGraphicsConfig gc, int width, int height, Image image, + ColorModel cm, int type) { + super(pView, gc, cm, type, width, height); + offscreenImage = image; + initSurface(this.width, this.height); + } + + @Override + public SurfaceData getReplacement() { + return restoreContents(offscreenImage); + } + + @Override + public Rectangle getBounds() { + if (type == FLIP_BACKBUFFER) { + Rectangle r = pView.getBounds(); + return new Rectangle(0, 0, r.width, r.height); + } else { + return new Rectangle(width, height); + } + } + + /** + * Returns destination Image associated with this SurfaceData. + */ + @Override + public Object getDestination() { + return offscreenImage; + } + } + + + // additional cleanup + private static native void destroyCGLContext(long ctx); + + public static void destroyOGLContext(long ctx) { + if (ctx != 0L) { + destroyCGLContext(ctx); + } + } + + public static void dispose(long pData, long pConfigInfo) { + MTLGraphicsConfig.deRefPConfigInfo(pConfigInfo); + } +} --- /dev/null 2019-05-16 19:16:37.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/metal/MTLSurfaceDataProxy.java 2019-05-16 19:16:36.000000000 +0300 @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.metal; + +import sun.java2d.SurfaceData; +import sun.java2d.SurfaceDataProxy; +import sun.java2d.loops.CompositeType; + +import java.awt.*; + +/** + * The proxy class contains the logic for when to replace a + * SurfaceData with a cached OGL Texture and the code to create + * the accelerated surfaces. + */ +public class MTLSurfaceDataProxy extends SurfaceDataProxy { + public static SurfaceDataProxy createProxy(SurfaceData srcData, + MTLGraphicsConfig dstConfig) + { + if (srcData instanceof MTLSurfaceData) { + // srcData must be a VolatileImage which either matches + // our pixel format or not - either way we do not cache it... + return UNCACHED; + } + + return new MTLSurfaceDataProxy(dstConfig, srcData.getTransparency()); + } + + MTLGraphicsConfig oglgc; + int transparency; + + public MTLSurfaceDataProxy(MTLGraphicsConfig oglgc, int transparency) { + this.oglgc = oglgc; + this.transparency = transparency; + } + + @Override + public SurfaceData validateSurfaceData(SurfaceData srcData, + SurfaceData cachedData, + int w, int h) + { + if (cachedData == null) { + try { + cachedData = oglgc.createManagedSurface(w, h, transparency); + } catch (OutOfMemoryError er) { + return null; + } + } + return cachedData; + } + + @Override + public boolean isSupportedOperation(SurfaceData srcData, + int txtype, + CompositeType comp, + Color bgColor) + { + return comp.isDerivedFrom(CompositeType.AnyAlpha) && + (bgColor == null || transparency == Transparency.OPAQUE); + } +} --- /dev/null 2019-05-16 19:16:38.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/metal/MTLTextRenderer.java 2019-05-16 19:16:37.000000000 +0300 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2011, 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.metal; + +import sun.font.GlyphList; +import sun.java2d.SunGraphics2D; +import sun.java2d.loops.GraphicsPrimitive; +import sun.java2d.pipe.BufferedTextPipe; +import sun.java2d.pipe.RenderQueue; + +import java.awt.*; + +class MTLTextRenderer extends BufferedTextPipe { + + MTLTextRenderer(RenderQueue rq) { + super(rq); + } + + @Override + protected native void drawGlyphList(int numGlyphs, boolean usePositions, + boolean subPixPos, boolean rgbOrder, + int lcdContrast, + float glOrigX, float glOrigY, + long[] images, float[] positions); + + @Override + protected void validateContext(SunGraphics2D sg2d, Composite comp) { + // assert rq.lock.isHeldByCurrentThread(); + MTLSurfaceData oglDst = (MTLSurfaceData)sg2d.surfaceData; + MTLContext.validateContext(oglDst, oglDst, + sg2d.getCompClip(), comp, + null, sg2d.paint, sg2d, + MTLContext.NO_CONTEXT_FLAGS); + } + + MTLTextRenderer traceWrap() { + return new Tracer(this); + } + + private static class Tracer extends MTLTextRenderer { + Tracer(MTLTextRenderer mtltr) { + super(mtltr.rq); + } + protected void drawGlyphList(SunGraphics2D sg2d, GlyphList gl) { + GraphicsPrimitive.tracePrimitive("MTLDrawGlyphs"); + super.drawGlyphList(sg2d, gl); + } + } +} --- /dev/null 2019-05-16 19:16:39.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/metal/MTLUtilities.java 2019-05-16 19:16:39.000000000 +0300 @@ -0,0 +1,326 @@ +/* + * Copyright (c) 2011, 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.metal; + +import sun.java2d.SunGraphics2D; +import sun.java2d.SurfaceData; +import sun.java2d.pipe.Region; + +import java.awt.*; + +/** + * This class contains a number of static utility methods that may be + * called (via reflection) by a third-party library in order + * to interoperate with the metal-based Java 2D pipeline. + * + */ +class MTLUtilities { + + /** + * These OGL-specific surface type constants are the same as those + * defined in the MTLSurfaceData class and are duplicated here so that + * clients of this API can access them more easily via reflection. + */ + public static final int UNDEFINED = MTLSurfaceData.UNDEFINED; + public static final int WINDOW = MTLSurfaceData.WINDOW; + public static final int TEXTURE = MTLSurfaceData.TEXTURE; + public static final int FLIP_BACKBUFFER = MTLSurfaceData.FLIP_BACKBUFFER; + public static final int RT_TEXTURE = MTLSurfaceData.RT_TEXTURE; + + private MTLUtilities() { + } + + /** + * Returns true if the current thread is the OGL QueueFlusher thread. + */ + public static boolean isQueueFlusherThread() { + return MTLRenderQueue.isQueueFlusherThread(); + } + + /** + * Invokes the given Runnable on the MTL QueueFlusher thread with the + * MTL context corresponding to the given Graphics object made + * current. It is legal for MTL code executed in the given + * Runnable to change the current MTL context; it will be reset + * once the Runnable completes. No guarantees are made as to the + * state of the MTL context of the Graphics object; for + * + * In order to avoid deadlock, it is important that the given Runnable + * does not attempt to acquire the AWT lock, as that will be handled + * automatically as part of the {@code rq.flushAndInvokeNow()} step. + * + * @param g the Graphics object for the corresponding destination surface; + * if null, the step making a context current to the destination surface + * will be skipped + * @param r the action to be performed on the QFT; cannot be null + * @return true if the operation completed successfully, or false if + * there was any problem making a context current to the surface + * associated with the given Graphics object + */ + public static boolean invokeWithMTLContextCurrent(Graphics g, Runnable r) { + MTLRenderQueue rq = MTLRenderQueue.getInstance(); + rq.lock(); + try { + if (g != null) { + if (!(g instanceof SunGraphics2D)) { + return false; + } + SurfaceData sData = ((SunGraphics2D)g).surfaceData; + if (!(sData instanceof MTLSurfaceData)) { + return false; + } + + // make a context current to the destination surface + MTLContext.validateContext((MTLSurfaceData)sData); + } + + // invoke the given runnable on the QFT + rq.flushAndInvokeNow(r); + + // invalidate the current context so that the next time we render + // with Java 2D, the context state will be completely revalidated + MTLContext.invalidateCurrentContext(); + } finally { + rq.unlock(); + } + + return true; + } + + /** + * Invokes the given Runnable on the MTL QueueFlusher thread with the + * "shared" MTL context (corresponding to the given + * GraphicsConfiguration object) made current. This method is typically + * used when the Runnable needs a current context to complete its + * operation, but does not require that the context be made current to + * a particular surface. For example, an application may call this + * method so that the given Runnable can query the OpenGL capabilities + * of the given GraphicsConfiguration, without making a context current + * to a dummy surface (or similar hacky techniques). + * + * In order to avoid deadlock, it is important that the given Runnable + * does not attempt to acquire the AWT lock, as that will be handled + * automatically as part of the {@code rq.flushAndInvokeNow()} step. + * + * @param config the GraphicsConfiguration object whose "shared" + * context will be made current during this operation; if this value is + * null or if MTL is not enabled for the GraphicsConfiguration, this + * method will return false + * @param r the action to be performed on the QFT; cannot be null + * @return true if the operation completed successfully, or false if + * there was any problem making the shared context current + */ + public static boolean + invokeWithMTLSharedContextCurrent(GraphicsConfiguration config, + Runnable r) + { + if (!(config instanceof MTLGraphicsConfig)) { + return false; + } + + MTLRenderQueue rq = MTLRenderQueue.getInstance(); + rq.lock(); + try { + // make the "shared" context current for the given GraphicsConfig + MTLContext.setScratchSurface((MTLGraphicsConfig)config); + + // invoke the given runnable on the QFT + rq.flushAndInvokeNow(r); + + // invalidate the current context so that the next time we render + // with Java 2D, the context state will be completely revalidated + MTLContext.invalidateCurrentContext(); + } finally { + rq.unlock(); + } + + return true; + } + + /** + * Returns the Rectangle describing the MTL viewport on the + * Java 2D surface associated with the given Graphics object and + * component width and height. When a third-party library is + * performing MTL rendering directly into the visible region of + * the associated surface, this viewport helps the application + * position the MTL output correctly on that surface. + * + * Note that the x/y values in the returned Rectangle object represent + * the lower-left corner of the viewport region, relative to the + * lower-left corner of the given surface. + * + * @param g the Graphics object for the corresponding destination surface; + * cannot be null + * @param componentWidth width of the component to be painted + * @param componentHeight height of the component to be painted + * @return a Rectangle describing the MTL viewport for the given + * destination surface and component dimensions, or null if the given + * Graphics object is invalid + */ + public static Rectangle getMTLViewport(Graphics g, + int componentWidth, + int componentHeight) + { + if (!(g instanceof SunGraphics2D)) { + return null; + } + + SunGraphics2D sg2d = (SunGraphics2D)g; + SurfaceData sData = sg2d.surfaceData; + + // this is the upper-left origin of the region to be painted, + // relative to the upper-left origin of the surface + // (in Java2D coordinates) + int x0 = sg2d.transX; + int y0 = sg2d.transY; + + // this is the lower-left origin of the region to be painted, + // relative to the lower-left origin of the surface + // (in OpenGL coordinates) + Rectangle surfaceBounds = sData.getBounds(); + int x1 = x0; + int y1 = surfaceBounds.height - (y0 + componentHeight); + + return new Rectangle(x1, y1, componentWidth, componentHeight); + } + + /** + * Returns the Rectangle describing the MTL scissor box on the + * Java 2D surface associated with the given Graphics object. When a + * third-party library is performing MTL rendering directly + * into the visible region of the associated surface, this scissor box + * must be set to avoid drawing over existing rendering results. + * + * Note that the x/y values in the returned Rectangle object represent + * the lower-left corner of the scissor region, relative to the + * lower-left corner of the given surface. + * + * @param g the Graphics object for the corresponding destination surface; + * cannot be null + * @return a Rectangle describing the MTL scissor box for the given + * Graphics object and corresponding destination surface, or null if the + * given Graphics object is invalid or the clip region is non-rectangular + */ + public static Rectangle getOGLScissorBox(Graphics g) { + if (!(g instanceof SunGraphics2D)) { + return null; + } + + SunGraphics2D sg2d = (SunGraphics2D)g; + SurfaceData sData = sg2d.surfaceData; + Region r = sg2d.getCompClip(); + if (!r.isRectangular()) { + // caller probably doesn't know how to handle shape clip + // appropriately, so just return null (Swing currently never + // sets a shape clip, but that could change in the future) + return null; + } + + // this is the upper-left origin of the scissor box relative to the + // upper-left origin of the surface (in Java 2D coordinates) + int x0 = r.getLoX(); + int y0 = r.getLoY(); + + // this is the width and height of the scissor region + int w = r.getWidth(); + int h = r.getHeight(); + + // this is the lower-left origin of the scissor box relative to the + // lower-left origin of the surface (in OpenGL coordinates) + Rectangle surfaceBounds = sData.getBounds(); + int x1 = x0; + int y1 = surfaceBounds.height - (y0 + h); + + return new Rectangle(x1, y1, w, h); + } + + /** + * Returns an Object identifier for the Java 2D surface associated with + * the given Graphics object. This identifier may be used to determine + * whether the surface has changed since the last invocation of this + * operation, and thereby whether the MTL state corresponding to the + * old surface must be destroyed and recreated. + * + * @param g the Graphics object for the corresponding destination surface; + * cannot be null + * @return an identifier for the surface associated with the given + * Graphics object, or null if the given Graphics object is invalid + */ + public static Object getMTLSurfaceIdentifier(Graphics g) { + if (!(g instanceof SunGraphics2D)) { + return null; + } + return ((SunGraphics2D)g).surfaceData; + } + + /** + * Returns one of the MTL-specific surface type constants (defined in + * this class), which describes the surface associated with the given + * Graphics object. + * + * @param g the Graphics object for the corresponding destination surface; + * cannot be null + * @return a constant that describes the surface associated with the + * given Graphics object; if the given Graphics object is invalid (i.e. + * is not associated with an OpenGL surface) this method will return + * {@code MTLUtilities.UNDEFINED} + */ + public static int getMTLSurfaceType(Graphics g) { + if (!(g instanceof SunGraphics2D)) { + return UNDEFINED; + } + SurfaceData sData = ((SunGraphics2D)g).surfaceData; + if (!(sData instanceof MTLSurfaceData)) { + return UNDEFINED; + } + return ((MTLSurfaceData)sData).getType(); + } + + /** + * Returns the MTL texture target constant (either GL_TEXTURE_2D + * or GL_TEXTURE_RECTANGLE_ARB) for the surface associated with the + * given Graphics object. This method is only useful for those surface + * types that are backed by an MTL texture, namely {@code TEXTURE}, + * {@code RT_TEXTURE}, and (on Windows only) {@code PBUFFER}. + * + * @param g the Graphics object for the corresponding destination surface; + * cannot be null + * @return the texture target constant for the surface associated with the + * given Graphics object; if the given Graphics object is invalid (i.e. + * is not associated with an MTL surface), or the associated surface + * is not backed by an OpenGL texture, this method will return zero. + */ + public static int getMTLTextureType(Graphics g) { + if (!(g instanceof SunGraphics2D)) { + return 0; + } + SurfaceData sData = ((SunGraphics2D)g).surfaceData; + if (!(sData instanceof MTLSurfaceData)) { + return 0; + } + return ((MTLSurfaceData)sData).getTextureTarget(); + } +} --- /dev/null 2019-05-16 19:16:40.000000000 +0300 +++ new/src/java.desktop/macosx/classes/sun/java2d/metal/MTLVolatileSurfaceManager.java 2019-05-16 19:16:40.000000000 +0300 @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.java2d.metal; + +import sun.awt.AWTAccessor; +import sun.awt.AWTAccessor.ComponentAccessor; +import sun.awt.image.SunVolatileImage; +import sun.awt.image.VolatileSurfaceManager; +import sun.java2d.BackBufferCapsProvider; +import sun.java2d.SurfaceData; +import sun.java2d.opengl.OGLSurfaceData; +import sun.java2d.pipe.hw.ExtendedBufferCapabilities; + +import java.awt.*; +import java.awt.image.ColorModel; +import java.awt.peer.ComponentPeer; + +import static java.awt.BufferCapabilities.FlipContents.COPIED; +import static sun.java2d.opengl.OGLContext.OGLContextCaps.CAPS_EXT_FBOBJECT; +import static sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.VSYNC_ON; + +public class MTLVolatileSurfaceManager extends VolatileSurfaceManager { + + private final boolean accelerationEnabled; + + public MTLVolatileSurfaceManager(SunVolatileImage vImg, Object context) { + super(vImg, context); + + /* + * We will attempt to accelerate this image only under the + * following conditions: + * - the image is not bitmask AND the GraphicsConfig supports the FBO + * extension + */ + int transparency = vImg.getTransparency(); + MTLGraphicsConfig gc = (MTLGraphicsConfig) vImg.getGraphicsConfig(); + accelerationEnabled = true; + //gc.isCapPresent(CAPS_EXT_FBOBJECT) + //&& transparency != Transparency.BITMASK; + } + + protected boolean isAccelerationEnabled() { + return accelerationEnabled; + } + + /** + * Create a FBO-based SurfaceData object (or init the backbuffer + * of an existing window if this is a double buffered GraphicsConfig) + */ + protected SurfaceData initAcceleratedSurface() { + SurfaceData sData = null; + Component comp = vImg.getComponent(); + final ComponentAccessor acc = AWTAccessor.getComponentAccessor(); + final ComponentPeer peer = (comp != null) ? acc.getPeer(comp) : null; + + try { + boolean createVSynced = false; + boolean forceback = false; + if (context instanceof Boolean) { + forceback = ((Boolean)context).booleanValue(); + if (forceback && peer instanceof BackBufferCapsProvider) { + BackBufferCapsProvider provider = + (BackBufferCapsProvider)peer; + BufferCapabilities caps = provider.getBackBufferCaps(); + if (caps instanceof ExtendedBufferCapabilities) { + ExtendedBufferCapabilities ebc = + (ExtendedBufferCapabilities)caps; + if (ebc.getVSync() == VSYNC_ON && + ebc.getFlipContents() == COPIED) + { + createVSynced = true; + forceback = false; + } + } + } + } + + if (forceback) { + // peer must be non-null in this case + // TODO: modify parameter to delegate + // sData = MTLSurfaceData.createData(peer, vImg, FLIP_BACKBUFFER); + } else { + MTLGraphicsConfig gc = + (MTLGraphicsConfig)vImg.getGraphicsConfig(); + ColorModel cm = gc.getColorModel(vImg.getTransparency()); + int type = vImg.getForcedAccelSurfaceType(); + // if acceleration type is forced (type != UNDEFINED) then + // use the forced type, otherwise choose RT_TEXTURE + if (type == OGLSurfaceData.UNDEFINED) { + type = OGLSurfaceData.FBOBJECT; + } + if (createVSynced) { + // TODO: modify parameter to delegate +// sData = MTLSurfaceData.createData(peer, vImg, type); + } else { + sData = MTLSurfaceData.createData(gc, + vImg.getWidth(), + vImg.getHeight(), + cm, vImg, type); + } + } + } catch (NullPointerException ex) { + sData = null; + } catch (OutOfMemoryError er) { + sData = null; + } + + return sData; + } + + @Override + protected boolean isConfigValid(GraphicsConfiguration gc) { + return ((gc == null) || (gc == vImg.getGraphicsConfig())); + } + + @Override + public void initContents() { + if (vImg.getForcedAccelSurfaceType() != OGLSurfaceData.TEXTURE) { + super.initContents(); + } + } +} + --- /dev/null 2019-05-16 19:16:41.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/awt/common.h 2019-05-16 19:16:41.000000000 +0300 @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef COMMON_H +#define COMMON_H + +#include + +#define PGRAM_VERTEX_COUNT 6 + +enum VertexAttributes { + VertexAttributePosition = 0, + VertexAttributeTexPos = 1 +}; + +enum BufferIndex { + MeshVertexBuffer = 0, + FrameUniformBuffer = 1, + MatrixBuffer = 2 +}; + +struct FrameUniforms { + vector_float4 color; +}; + +struct TransformMatrix { + matrix_float4x4 transformMatrix; +}; + +struct GradFrameUniforms { + vector_float3 params; + vector_float4 color1; + vector_float4 color2; +}; + +struct Vertex { + float position[3]; +}; + +struct TxtVertex { + float position[3]; + float txtpos[2]; +}; + +#endif --- /dev/null 2019-05-16 19:16:42.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/awt/shaders.metal 2019-05-16 19:16:42.000000000 +0300 @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include +#include +#include "common.h" + +using namespace metal; + +struct VertexInput { + float3 position [[attribute(VertexAttributePosition)]]; +}; + +struct TxtVertexInput { + float3 position [[attribute(VertexAttributePosition)]]; + float2 texCoords [[attribute(VertexAttributeTexPos)]]; +}; + +struct ColShaderInOut { + float4 position [[position]]; + half4 color; +}; + +struct TxtShaderInOut { + float4 position [[position]]; + float2 texCoords; +}; + +struct GradShaderInOut { + float4 position [[position]]; +}; + +vertex ColShaderInOut vert_col(VertexInput in [[stage_in]], + constant FrameUniforms& uniforms [[buffer(FrameUniformBuffer)]], + constant TransformMatrix& transform [[buffer(MatrixBuffer)]]) { + ColShaderInOut out; + float4 pos4 = float4(in.position, 1.0); + out.position = transform.transformMatrix*pos4; + out.color = half4(uniforms.color.r, uniforms.color.g, uniforms.color.b, uniforms.color.a); + return out; +} + +vertex GradShaderInOut vert_grad(VertexInput in [[stage_in]], constant TransformMatrix& transform [[buffer(MatrixBuffer)]]) { + GradShaderInOut out; + float4 pos4 = float4(in.position, 1.0); + out.position = transform.transformMatrix*pos4; + return out; +} + +vertex TxtShaderInOut vert_txt(TxtVertexInput in [[stage_in]], constant TransformMatrix& transform [[buffer(MatrixBuffer)]]) { + TxtShaderInOut out; + float4 pos4 = float4(in.position, 1.0); + out.position = transform.transformMatrix*pos4; + out.texCoords = in.texCoords; + return out; +} + +fragment half4 frag_col(ColShaderInOut in [[stage_in]]) { + return in.color; +} + +fragment half4 frag_txt( + TxtShaderInOut vert [[stage_in]], + texture2d renderTexture [[texture(0)]] + ) +{ + constexpr sampler textureSampler (mag_filter::linear, + min_filter::linear); + float4 pixelColor = renderTexture.sample(textureSampler, vert.texCoords); + return half4(pixelColor.r, pixelColor.g, pixelColor.b , pixelColor.a); +} + +fragment half4 frag_grad(GradShaderInOut in [[stage_in]], + constant GradFrameUniforms& uniforms [[buffer(0)]]) { + float3 v = float3(in.position.x, in.position.y, 1); + float a = (dot(v,uniforms.params)-0.25)*2.0; + float4 c = mix(uniforms.color1, uniforms.color2, a); + return half4(c); +} \ No newline at end of file --- /dev/null 2019-05-16 19:16:44.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBlitLoops.h 2019-05-16 19:16:43.000000000 +0300 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef MTLBlitLoops_h_Included +#define MTLBlitLoops_h_Included + +#include "sun_java2d_metal_MTLBlitLoops.h" +#include "MTLSurfaceDataBase.h" +#include "MTLContext.h" + +#define OFFSET_SRCTYPE sun_java2d_metal_MTLBlitLoops_OFFSET_SRCTYPE +#define OFFSET_HINT sun_java2d_metal_MTLBlitLoops_OFFSET_HINT +#define OFFSET_TEXTURE sun_java2d_metal_MTLBlitLoops_OFFSET_TEXTURE +#define OFFSET_RTT sun_java2d_metal_MTLBlitLoops_OFFSET_RTT +#define OFFSET_XFORM sun_java2d_metal_MTLBlitLoops_OFFSET_XFORM +#define OFFSET_ISOBLIT sun_java2d_metal_MTLBlitLoops_OFFSET_ISOBLIT + +void MTLBlitLoops_IsoBlit(JNIEnv *env, + MTLContext *mtlc, jlong pSrcOps, jlong pDstOps, + jboolean xform, jint hint, + jboolean texture, jboolean rtt, + jint sx1, jint sy1, + jint sx2, jint sy2, + jdouble dx1, jdouble dy1, + jdouble dx2, jdouble dy2); + +void MTLBlitLoops_Blit(JNIEnv *env, + MTLContext *mtlc, jlong pSrcOps, jlong pDstOps, + jboolean xform, jint hint, + jint srctype, jboolean texture, + jint sx1, jint sy1, + jint sx2, jint sy2, + jdouble dx1, jdouble dy1, + jdouble dx2, jdouble dy2); + +void MTLBlitLoops_SurfaceToSwBlit(JNIEnv *env, MTLContext *mtlc, + jlong pSrcOps, jlong pDstOps, jint dsttype, + jint srcx, jint srcy, + jint dstx, jint dsty, + jint width, jint height); + +void MTLBlitLoops_CopyArea(JNIEnv *env, + MTLContext *mtlc, BMTLSDOps *dstOps, + jint x, jint y, + jint width, jint height, + jint dx, jint dy); + +void MTLBlitTex2Tex(MTLContext *mtlc, id src, id dest); + +#endif /* MTLBlitLoops_h_Included */ --- /dev/null 2019-05-16 19:16:45.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBlitLoops.m 2019-05-16 19:16:44.000000000 +0300 @@ -0,0 +1,482 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef HEADLESS + +#include +#include + +#include "SurfaceData.h" +#include "MTLBlitLoops.h" +#include "MTLRenderQueue.h" +#include "MTLSurfaceData.h" +#include "MTLUtils.h" +#include "GraphicsPrimitiveMgr.h" + +#include // malloc +#include // memcpy +#include "IntArgbPre.h" + +extern MTLPixelFormat PixelFormats[]; +extern void J2dTraceImpl(int level, jboolean cr, const char *string, ...); + +void fillTxQuad( + struct TxtVertex * txQuadVerts, + jint sx1, jint sy1, jint sx2, jint sy2, jint sw, jint sh, + jdouble dx1, jdouble dy1, jdouble dx2, jdouble dy2, jdouble dw, jdouble dh +) { + const float nsx1 = sx1/(float)sw; + const float nsy1 = sy1/(float)sh; + const float nsx2 = sx2/(float)sw; + const float nsy2 = sy2/(float)sh; + + txQuadVerts[0].position[0] = dx1; + txQuadVerts[0].position[1] = dy1; + txQuadVerts[0].position[2] = 0; + txQuadVerts[0].txtpos[0] = nsx1; + txQuadVerts[0].txtpos[1] = nsy1; + + txQuadVerts[1].position[0] = dx2; + txQuadVerts[1].position[1] = dy1; + txQuadVerts[1].position[2] = 0; + txQuadVerts[1].txtpos[0] = nsx2; + txQuadVerts[1].txtpos[1] = nsy1; + + txQuadVerts[2].position[0] = dx2; + txQuadVerts[2].position[1] = dy2; + txQuadVerts[2].position[2] = 0; + txQuadVerts[2].txtpos[0] = nsx2; + txQuadVerts[2].txtpos[1] = nsy2; + + txQuadVerts[3].position[0] = dx2; + txQuadVerts[3].position[1] = dy2; + txQuadVerts[3].position[2] = 0; + txQuadVerts[3].txtpos[0] = nsx2; + txQuadVerts[3].txtpos[1] = nsy2; + + txQuadVerts[4].position[0] = dx1; + txQuadVerts[4].position[1] = dy2; + txQuadVerts[4].position[2] = 0; + txQuadVerts[4].txtpos[0] = nsx1; + txQuadVerts[4].txtpos[1] = nsy2; + + txQuadVerts[5].position[0] = dx1; + txQuadVerts[5].position[1] = dy1; + txQuadVerts[5].position[2] = 0; + txQuadVerts[5].txtpos[0] = nsx1; + txQuadVerts[5].txtpos[1] = nsy1; +} + +/** + * Inner loop used for copying a source MTL "Surface" (window, pbuffer, + * etc.) to a destination OpenGL "Surface". Note that the same surface can + * be used as both the source and destination, as is the case in a copyArea() + * operation. This method is invoked from MTLBlitLoops_IsoBlit() as well as + * MTLBlitLoops_CopyArea(). + * + * The standard glCopyPixels() mechanism is used to copy the source region + * into the destination region. If the regions have different dimensions, + * the source will be scaled into the destination as appropriate (only + * nearest neighbor filtering will be applied for simple scale operations). + */ +static void +MTLBlitSurfaceToSurface(MTLContext *mtlc, BMTLSDOps *srcOps, BMTLSDOps *dstOps, + jint sx1, jint sy1, jint sx2, jint sy2, + jdouble dx1, jdouble dy1, jdouble dx2, jdouble dy2) +{ + //TODO + J2dTraceNotImplPrimitive("MTLBlitSurfaceToSurface"); +} + +static void drawTex2Tex(MTLContext *mtlc, + id src, id dst, + jboolean rtt, jint hint, + jint sx1, jint sy1, jint sx2, jint sy2, + jdouble dx1, jdouble dy1, jdouble dx2, jdouble dy2) +{ + if (mtlc == NULL || src == nil || dst == nil) + return; + +// J2dTraceLn2(J2D_TRACE_VERBOSE, "_drawTex2Tex: src tex=%p, dst tex=%p", src, dst); +// J2dTraceLn4(J2D_TRACE_VERBOSE, " sw=%d sh=%d dw=%d dh=%d", src.width, src.height, dst.width, dst.height); +// J2dTraceLn4(J2D_TRACE_VERBOSE, " sx1=%d sy1=%d sx2=%d sy2=%d", sx1, sy1, sx2, sy2); +// J2dTraceLn4(J2D_TRACE_VERBOSE, " dx1=%f dy1=%f dx2=%f dy2=%f", dx1, dy1, dx2, dy2); + + id encoder = [mtlc createSamplingEncoderForDest:dst]; + + + const jboolean normalize = !mtlc.useTransform; + struct TxtVertex quadTxVerticesBuffer[6]; + fillTxQuad(quadTxVerticesBuffer, sx1, sy1, sx2, sy2, src.width, src.height, dx1, dy1, dx2, dy2, dst.width, dst.height); + + [encoder setVertexBytes:quadTxVerticesBuffer length:sizeof(quadTxVerticesBuffer) atIndex:MeshVertexBuffer]; + [encoder setFragmentTexture:src atIndex: 0]; + [encoder drawPrimitives:MTLPrimitiveTypeTriangle vertexStart:0 vertexCount:6]; + [encoder endEncoding]; +} + +/** + * Inner loop used for copying a source MTL "Texture" to a destination + * MTL "Surface". This method is invoked from MTLBlitLoops_IsoBlit(). + * + * This method will copy, scale, or transform the source texture into the + * destination depending on the transform state, as established in + * and MTLContext_SetTransform(). If the source texture is + * transformed in any way when rendered into the destination, the filtering + * method applied is determined by the hint parameter (can be GL_NEAREST or + * GL_LINEAR). + */ +static void +MTLBlitTextureToSurface(MTLContext *mtlc, + BMTLSDOps *srcOps, BMTLSDOps *dstOps, + jboolean rtt, jint hint, + jint sx1, jint sy1, jint sx2, jint sy2, + jdouble dx1, jdouble dy1, jdouble dx2, jdouble dy2) +{ + id srcTex = srcOps->pTexture; + +#ifdef DEBUG + J2dTraceImpl(J2D_TRACE_VERBOSE, JNI_TRUE, "MTLBlitLoops_IsoBlit [via sampling]: bsrc=%p [tex=%p], bdst=%p [tex=%p] | s (%dx%d) -> d (%dx%d) | src (%d, %d, %d, %d) -> dst (%1.2f, %1.2f, %1.2f, %1.2f)", srcOps, srcOps->pTexture, dstOps, dstOps->pTexture, srcTex.width, srcTex.height, dstOps->width, dstOps->height, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); +#endif //DEBUG + + drawTex2Tex(mtlc, srcOps->pTexture, dstOps->pTexture, rtt, hint, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); +} + +/** + * Inner loop used for copying a source system memory ("Sw") surface to a + * destination MTL "Surface". This method is invoked from + * MTLBlitLoops_Blit(). + * + * The standard glDrawPixels() mechanism is used to copy the source region + * into the destination region. If the regions have different + * dimensions, the source will be scaled into the destination + * as appropriate (only nearest neighbor filtering will be applied for simple + * scale operations). + */ + +static void +MTLBlitSwToSurfaceViaTexture(MTLContext *ctx, SurfaceDataRasInfo *srcInfo, BMTLSDOps * bmtlsdOps, + MTPixelFormat *pf, + jint sx1, jint sy1, jint sx2, jint sy2, + jdouble dx1, jdouble dy1, jdouble dx2, jdouble dy2) +{ + if (bmtlsdOps == NULL || bmtlsdOps->pTexture == NULL) { + J2dTraceLn(J2D_TRACE_ERROR, "MTLBlitSwToSurfaceViaTexture: dest is null"); + return; + } + + const int sw = sx2 - sx1; + const int sh = sy2 - sy1; + id dest = bmtlsdOps->pTexture; + +#ifdef DEBUG + J2dTraceImpl(J2D_TRACE_VERBOSE, JNI_TRUE, "MTLBlitLoops_Blit [via pooled texture]: bdst=%p [tex=%p], sw=%d, sh=%d | src (%d, %d, %d, %d) -> dst (%1.2f, %1.2f, %1.2f, %1.2f)", bmtlsdOps, dest, sw, sh, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); +#endif //DEBUG + + id texBuff = [ctx.texturePool getTexture:sw height:sh format:MTLPixelFormatBGRA8Unorm]; + if (texBuff == nil) { + J2dTraceLn(J2D_TRACE_ERROR, "MTLBlitSwToSurfaceViaTexture: can't obtain temporary texture object from pool"); + return; + } + MTLRegion region = MTLRegionMake2D(0, 0, sw, sh); + [texBuff replaceRegion:region mipmapLevel:0 withBytes:srcInfo->rasBase bytesPerRow:srcInfo->scanStride]; // texBuff is locked for current frame + + drawTex2Tex(ctx, texBuff, dest, 0, 0, 0, 0, sw, sh, dx1, dy1, dx2, dy2); +} + +/** + * Inner loop used for copying a source system memory ("Sw") surface or + * MTL "Surface" to a destination OpenGL "Surface", using an MTL texture + * tile as an intermediate surface. This method is invoked from + * MTLBlitLoops_Blit() for "Sw" surfaces and MTLBlitLoops_IsoBlit() for + * "Surface" surfaces. + * + * This method is used to transform the source surface into the destination. + * Pixel rectangles cannot be arbitrarily transformed (without the + * GL_EXT_pixel_transform extension, which is not supported on most modern + * hardware). However, texture mapped quads do respect the GL_MODELVIEW + * transform matrix, so we use textures here to perform the transform + * operation. This method uses a tile-based approach in which a small + * subregion of the source surface is copied into a cached texture tile. The + * texture tile is then mapped into the appropriate location in the + * destination surface. + * + * REMIND: this only works well using GL_NEAREST for the filtering mode + * (GL_LINEAR causes visible stitching problems between tiles, + * but this can be fixed by making use of texture borders) + */ +static void +MTLBlitToSurfaceViaTexture(MTLContext *mtlc, SurfaceDataRasInfo *srcInfo, + MTPixelFormat *pf, MTLSDOps *srcOps, + jboolean swsurface, jint hint, + jint sx1, jint sy1, jint sx2, jint sy2, + jdouble dx1, jdouble dy1, jdouble dx2, jdouble dy2) +{ + //TODO + J2dTraceNotImplPrimitive("MTLBlitToSurfaceViaTexture"); +} + +/** + * Inner loop used for copying a source system memory ("Sw") surface to a + * destination OpenGL "Texture". This method is invoked from + * MTLBlitLoops_Blit(). + * + * The source surface is effectively loaded into the MTL texture object, + * which must have already been initialized by MTLSD_initTexture(). Note + * that this method is only capable of copying the source surface into the + * destination surface (i.e. no scaling or general transform is allowed). + * This restriction should not be an issue as this method is only used + * currently to cache a static system memory image into an MTL texture in + * a hidden-acceleration situation. + */ +static void +MTLBlitSwToTexture(SurfaceDataRasInfo *srcInfo, MTPixelFormat *pf, + MTLSDOps *dstOps, + jint dx1, jint dy1, jint dx2, jint dy2) +{ + //TODO + J2dTraceNotImplPrimitive("MTLBlitSwToTexture"); +} + +/** + * General blit method for copying a native MTL surface (of type "Surface" + * or "Texture") to another MTL "Surface". If texture is JNI_TRUE, this + * method will invoke the Texture->Surface inner loop; otherwise, one of the + * Surface->Surface inner loops will be invoked, depending on the transform + * state. + * + * REMIND: we can trick these blit methods into doing XOR simply by passing + * in the (pixel ^ xorpixel) as the pixel value and preceding the + * blit with a fillrect... + */ +void +MTLBlitLoops_IsoBlit(JNIEnv *env, + MTLContext *mtlc, jlong pSrcOps, jlong pDstOps, + jboolean xform, jint hint, + jboolean texture, jboolean rtt, + jint sx1, jint sy1, jint sx2, jint sy2, + jdouble dx1, jdouble dy1, jdouble dx2, jdouble dy2) +{ + BMTLSDOps *srcOps = (BMTLSDOps *)jlong_to_ptr(pSrcOps); + BMTLSDOps *dstOps = (BMTLSDOps *)jlong_to_ptr(pDstOps); + + RETURN_IF_NULL(srcOps); + RETURN_IF_NULL(dstOps); + + id srcTex = srcOps->pTexture; + id dstTex = dstOps->pTexture; + if (mtlc == NULL || srcTex == nil || srcTex == nil) { + J2dTraceLn2(J2D_TRACE_ERROR, "MTLBlitLoops_IsoBlit: surface is null (stex=%p, dtex=%p)", srcTex, dstTex); + return; + } + + const jint sw = sx2 - sx1; + const jint sh = sy2 - sy1; + const jdouble dw = dx2 - dx1; + const jdouble dh = dy2 - dy1; + + if (sw <= 0 || sh <= 0 || dw <= 0 || dh <= 0) { + J2dTraceLn4(J2D_TRACE_WARNING, "MTLBlitLoops_IsoBlit: invalid dimensions: sw=%d, sh%d, dw=%d, dh=%d", sw, sh, dw, dh); + return; + } + + SurfaceDataRasInfo srcInfo; + srcInfo.bounds.x1 = sx1; + srcInfo.bounds.y1 = sy1; + srcInfo.bounds.x2 = sx2; + srcInfo.bounds.y2 = sy2; + SurfaceData_IntersectBoundsXYXY(&srcInfo.bounds, 0, 0, srcOps->width, srcOps->height); + + if (srcInfo.bounds.x2 <= srcInfo.bounds.x1 || srcInfo.bounds.y2 <= srcInfo.bounds.y1) { + J2dTraceLn(J2D_TRACE_VERBOSE, "MTLBlitLoops_IsoBlit: source rectangle doesn't intersect with source surface bounds"); + J2dTraceLn6(J2D_TRACE_VERBOSE, " sx1=%d sy1=%d sx2=%d sy2=%d sw=%d sh=%d", sx1, sy1, sx2, sy2, srcOps->width, srcOps->height); + J2dTraceLn4(J2D_TRACE_VERBOSE, " dx1=%f dy1=%f dx2=%f dy2=%f", dx1, dy1, dx2, dy2); + return; + } + + if (srcInfo.bounds.x1 != sx1) { + dx1 += (srcInfo.bounds.x1 - sx1) * (dw / sw); + sx1 = srcInfo.bounds.x1; + } + if (srcInfo.bounds.y1 != sy1) { + dy1 += (srcInfo.bounds.y1 - sy1) * (dh / sh); + sy1 = srcInfo.bounds.y1; + } + if (srcInfo.bounds.x2 != sx2) { + dx2 += (srcInfo.bounds.x2 - sx2) * (dw / sw); + sx2 = srcInfo.bounds.x2; + } + if (srcInfo.bounds.y2 != sy2) { + dy2 += (srcInfo.bounds.y2 - sy2) * (dh / sh); + sy2 = srcInfo.bounds.y2; + } + + const jboolean useBlitEncoder = + mtlc.isBlendingDisabled + && fabs(dx2 - dx1 - sx2 + sx1) < 0.001f && fabs(dy2 - dy1 - sy2 + sy1) < 0.001f // dimensions are equal (TODO: check that dx1,dy1 is integer) + && !mtlc.useTransform; // TODO: check whether transform is simple translate (and use blitEncoder in this case) + if (useBlitEncoder) { +#ifdef DEBUG + J2dTraceImpl(J2D_TRACE_VERBOSE, JNI_TRUE, "MTLBlitLoops_IsoBlit [via blitEncoder]: bdst=%p [tex=%p] %dx%d | src (%d, %d, %d, %d) -> dst (%1.2f, %1.2f, %1.2f, %1.2f)", dstOps, dstTex, dstTex.width, dstTex.height, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); +#endif //DEBUG + id blitEncoder = [mtlc createBlitEncoder]; + [blitEncoder copyFromTexture:srcTex sourceSlice:0 sourceLevel:0 sourceOrigin:MTLOriginMake(sx1, sy1, 0) sourceSize:MTLSizeMake(sx2 - sx1, sy2 - sy1, 1) toTexture:dstTex destinationSlice:0 destinationLevel:0 destinationOrigin:MTLOriginMake(dx1, dy1, 0)]; + [blitEncoder endEncoding]; + } else { + // TODO: support other flags + MTLBlitTextureToSurface(mtlc, srcOps, dstOps, rtt, hint, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); + } +} + +/** + * General blit method for copying a system memory ("Sw") surface to a native + * MTL surface (of type "Surface" or "Texture"). If texture is JNI_TRUE, + * this method will invoke the Sw->Texture inner loop; otherwise, one of the + * Sw->Surface inner loops will be invoked, depending on the transform state. + */ +void +MTLBlitLoops_Blit(JNIEnv *env, + MTLContext *mtlc, jlong pSrcOps, jlong pDstOps, + jboolean xform, jint hint, + jint srctype, jboolean texture, + jint sx1, jint sy1, jint sx2, jint sy2, + jdouble dx1, jdouble dy1, jdouble dx2, jdouble dy2) +{ + RETURN_IF_NULL(jlong_to_ptr(pSrcOps)); + RETURN_IF_NULL(jlong_to_ptr(pDstOps)); + + SurfaceDataOps *srcOps = (SurfaceDataOps *)jlong_to_ptr(pSrcOps); + BMTLSDOps *dstOps = (BMTLSDOps *)jlong_to_ptr(pDstOps); + SurfaceDataRasInfo srcInfo; + MTLPixelFormat pf = MTLPixelFormatBGRA8Unorm;//PixelFormats[srctype]; + + if (dstOps == NULL || dstOps->pTexture == NULL) { + J2dTraceLn(J2D_TRACE_ERROR, "MTLBlitLoops_Blit: dest is null"); + return; + } + id dest = dstOps->pTexture; + if (dx1 < 0) { + sx1 += dx1; + dx1 = 0; + } + if (dx2 > dest.width) { + sx2 -= dx2 - dest.width; + dx2 = dest.width; + } + if (dy1 < 0) { + sy1 += dy1; + dy1 = 0; + } + if (dy2 > dest.height) { + sy2 -= dy2 - dest.height; + dy2 = dest.height; + } + jint sw = sx2 - sx1; + jint sh = sy2 - sy1; + jdouble dw = dx2 - dx1; + jdouble dh = dy2 - dy1; + + if (sw <= 0 || sh <= 0 || dw <= 0 || dh <= 0 || srctype < 0) { + J2dTraceLn(J2D_TRACE_WARNING, "MTLBlitLoops_Blit: invalid dimensions or srctype"); + return; + } + + srcInfo.bounds.x1 = sx1; + srcInfo.bounds.y1 = sy1; + srcInfo.bounds.x2 = sx2; + srcInfo.bounds.y2 = sy2; + + if (srcOps->Lock(env, srcOps, &srcInfo, SD_LOCK_READ) != SD_SUCCESS) { + J2dTraceLn(J2D_TRACE_WARNING, "MTLBlitLoops_Blit: could not acquire lock"); + return; + } + + J2dTraceLn5(J2D_TRACE_VERBOSE, "MTLBlitLoops_Blit: pf=%d texture=%d srctype=%d xform=%d hint=%d", pf, texture, srctype, xform, hint); + + if (srcInfo.bounds.x2 > srcInfo.bounds.x1 && srcInfo.bounds.y2 > srcInfo.bounds.y1) { + srcOps->GetRasInfo(env, srcOps, &srcInfo); + if (srcInfo.rasBase) { + if (srcInfo.bounds.x1 != sx1) { + dx1 += (srcInfo.bounds.x1 - sx1) * (dw / sw); + sx1 = srcInfo.bounds.x1; + } + if (srcInfo.bounds.y1 != sy1) { + dy1 += (srcInfo.bounds.y1 - sy1) * (dh / sh); + sy1 = srcInfo.bounds.y1; + } + if (srcInfo.bounds.x2 != sx2) { + dx2 += (srcInfo.bounds.x2 - sx2) * (dw / sw); + sx2 = srcInfo.bounds.x2; + } + if (srcInfo.bounds.y2 != sy2) { + dy2 += (srcInfo.bounds.y2 - sy2) * (dh / sh); + sy2 = srcInfo.bounds.y2; + } + + // NOTE: if (texture) => dest coordinates will always be integers since we only ever do a straight copy from sw to texture. + const jboolean useReplaceRegion = texture || + (mtlc.isBlendingDisabled + && fabs(dx2 - dx1 - sx2 + sx1) < 0.001f && fabs(dy2 - dy1 - sy2 + sy1) < 0.001f // dimensions are equal (TODO: check that dx1,dy1 is integer) + && !mtlc.useTransform); // TODO: check whether transform is simple translate (and use replaceRegion in this case) + if (useReplaceRegion) { + MTLRegion region = MTLRegionMake2D(dx1, dy1, dx2 - dx1, dy2 - dy1); +#ifdef DEBUG + J2dTraceImpl(J2D_TRACE_VERBOSE, JNI_TRUE, "MTLBlitLoops_Blit [replaceRegion]: bdst=%p [tex=%p] %dx%d | src (%d, %d, %d, %d) -> dst (%1.2f, %1.2f, %1.2f, %1.2f)", dstOps, dest, dest.width, dest.height, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); +#endif //DEBUG + [dest replaceRegion:region mipmapLevel:0 withBytes:srcInfo.rasBase bytesPerRow:srcInfo.scanStride]; // executed at CPU (sync), TODO: lock dest for current frame + } else { + MTLBlitSwToSurfaceViaTexture(mtlc, &srcInfo, dstOps, &pf, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); + } + } + SurfaceData_InvokeRelease(env, srcOps, &srcInfo); + } + SurfaceData_InvokeUnlock(env, srcOps, &srcInfo); +} + +/** + * Specialized blit method for copying a native MTL "Surface" (pbuffer, + * window, etc.) to a system memory ("Sw") surface. + */ +void +MTLBlitLoops_SurfaceToSwBlit(JNIEnv *env, MTLContext *mtlc, + jlong pSrcOps, jlong pDstOps, jint dsttype, + jint srcx, jint srcy, jint dstx, jint dsty, + jint width, jint height) +{ + //TODO + J2dTraceNotImplPrimitive("MTLBlitLoops_SurfaceToSwBlit"); +} + +void +MTLBlitLoops_CopyArea(JNIEnv *env, + MTLContext *mtlc, BMTLSDOps *dstOps, + jint x, jint y, jint width, jint height, + jint dx, jint dy) +{ + //TODO + J2dTraceNotImplPrimitive("MTLBlitLoops_CopyArea"); +} + +#endif /* !HEADLESS */ --- /dev/null 2019-05-16 19:16:46.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBufImgOps.h 2019-05-16 19:16:46.000000000 +0300 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef MTLBufImgOps_h_Included +#define MTLBufImgOps_h_Included + +#include "MTLContext.h" + +void MTLBufImgOps_EnableConvolveOp(MTLContext *mtlc, jlong pSrcOps, + jboolean edgeZeroFill, + jint kernelWidth, jint KernelHeight, + unsigned char *kernelVals); +void MTLBufImgOps_DisableConvolveOp(MTLContext *mtlc); +void MTLBufImgOps_EnableRescaleOp(MTLContext *mtlc, jlong pSrcOps, + jboolean nonPremult, + unsigned char *scaleFactors, + unsigned char *offsets); +void MTLBufImgOps_DisableRescaleOp(MTLContext *mtlc); +void MTLBufImgOps_EnableLookupOp(MTLContext *mtlc, jlong pSrcOps, + jboolean nonPremult, jboolean shortData, + jint numBands, jint bandLength, jint offset, + void *tableValues); +void MTLBufImgOps_DisableLookupOp(MTLContext *mtlc); + +#endif /* MTLBufImgOps_h_Included */ --- /dev/null 2019-05-16 19:16:47.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBufImgOps.m 2019-05-16 19:16:47.000000000 +0300 @@ -0,0 +1,378 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef HEADLESS + +#include + +#include "MTLBufImgOps.h" +#include "MTLContext.h" +#include "MTLRenderQueue.h" +#include "MTLSurfaceDataBase.h" +#include "GraphicsPrimitiveMgr.h" + +/** Evaluates to true if the given bit is set on the local flags variable. */ +#define IS_SET(flagbit) \ + (((flags) & (flagbit)) != 0) + +/**************************** ConvolveOp support ****************************/ + +/** + * The ConvolveOp shader is fairly straightforward. For each texel in + * the source texture, the shader samples the MxN texels in the surrounding + * area, multiplies each by its corresponding kernel value, and then sums + * them all together to produce a single color result. Finally, the + * resulting value is multiplied by the current OpenGL color, which contains + * the extra alpha value. + * + * Note that this shader source code includes some "holes" marked by "%s". + * This allows us to build different shader programs (e.g. one for + * 3x3, one for 5x5, and so on) simply by filling in these "holes" with + * a call to sprintf(). See the MTLBufImgOps_CreateConvolveProgram() method + * for more details. + * + * REMIND: Currently this shader (and the supporting code in the + * EnableConvolveOp() method) only supports 3x3 and 5x5 filters. + * Early shader-level hardware did not support non-constant sized + * arrays but modern hardware should support them (although I + * don't know of any simple way to find out, other than to compile + * the shader at runtime and see if the drivers complain). + */ +static const char *convolveShaderSource = + // maximum size supported by this shader + "const int MAX_KERNEL_SIZE = %s;" + // image to be convolved + "uniform sampler%s baseImage;" + // image edge limits: + // imgEdge.xy = imgMin.xy (anything < will be treated as edge case) + // imgEdge.zw = imgMax.xy (anything > will be treated as edge case) + "uniform vec4 imgEdge;" + // value for each location in the convolution kernel: + // kernelVals[i].x = offsetX[i] + // kernelVals[i].y = offsetY[i] + // kernelVals[i].z = kernel[i] + "uniform vec3 kernelVals[MAX_KERNEL_SIZE];" + "" + "void main(void)" + "{" + " int i;" + " vec4 sum;" + "" + " if (any(lessThan(gl_TexCoord[0].st, imgEdge.xy)) ||" + " any(greaterThan(gl_TexCoord[0].st, imgEdge.zw)))" + " {" + // (placeholder for edge condition code) + " %s" + " } else {" + " sum = vec4(0.0);" + " for (i = 0; i < MAX_KERNEL_SIZE; i++) {" + " sum +=" + " kernelVals[i].z *" + " texture%s(baseImage," + " gl_TexCoord[0].st + kernelVals[i].xy);" + " }" + " }" + "" + // modulate with gl_Color in order to apply extra alpha + " gl_FragColor = sum * gl_Color;" + "}"; + +/** + * Flags that can be bitwise-or'ed together to control how the shader + * source code is generated. + */ +#define CONVOLVE_RECT (1 << 0) +#define CONVOLVE_EDGE_ZERO_FILL (1 << 1) +#define CONVOLVE_5X5 (1 << 2) + +/** + * The handles to the ConvolveOp fragment program objects. The index to + * the array should be a bitwise-or'ing of the CONVOLVE_* flags defined + * above. Note that most applications will likely need to initialize one + * or two of these elements, so the array is usually sparsely populated. + */ +static GLhandleARB convolvePrograms[8]; + +/** + * The maximum kernel size supported by the ConvolveOp shader. + */ +#define MAX_KERNEL_SIZE 25 + +/** + * Compiles and links the ConvolveOp shader program. If successful, this + * function returns a handle to the newly created shader program; otherwise + * returns 0. + */ +static GLhandleARB +MTLBufImgOps_CreateConvolveProgram(jint flags) +{ + //TODO + J2dTraceNotImplPrimitive("MTLBufImgOps_CreateConvolveProgram"); + return NULL; +} + +void +MTLBufImgOps_EnableConvolveOp(MTLContext *mtlc, jlong pSrcOps, + jboolean edgeZeroFill, + jint kernelWidth, jint kernelHeight, + unsigned char *kernel) +{ + //TODO + J2dTraceNotImplPrimitive("MTLBufImgOps_EnableConvolveOp"); +} + +void +MTLBufImgOps_DisableConvolveOp(MTLContext *mtlc) +{ + //TODO + J2dTraceNotImplPrimitive("MTLBufImgOps_EnableConvolveOp"); + J2dTraceLn(J2D_TRACE_INFO, "MTLBufImgOps_DisableConvolveOp"); +} + +/**************************** RescaleOp support *****************************/ + +/** + * The RescaleOp shader is one of the simplest possible. Each fragment + * from the source image is multiplied by the user's scale factor and added + * to the user's offset value (these are component-wise operations). + * Finally, the resulting value is multiplied by the current OpenGL color, + * which contains the extra alpha value. + * + * The RescaleOp spec says that the operation is performed regardless of + * whether the source data is premultiplied or non-premultiplied. This is + * a problem for the OpenGL pipeline in that a non-premultiplied + * BufferedImage will have already been converted into premultiplied + * when uploaded to an OpenGL texture. Therefore, we have a special mode + * called RESCALE_NON_PREMULT (used only for source images that were + * originally non-premultiplied) that un-premultiplies the source color + * prior to the rescale operation, then re-premultiplies the resulting + * color before returning from the fragment shader. + * + * Note that this shader source code includes some "holes" marked by "%s". + * This allows us to build different shader programs (e.g. one for + * GL_TEXTURE_2D targets, one for GL_TEXTURE_RECTANGLE_ARB targets, and so on) + * simply by filling in these "holes" with a call to sprintf(). See the + * MTLBufImgOps_CreateRescaleProgram() method for more details. + */ +static const char *rescaleShaderSource = + // image to be rescaled + "uniform sampler%s baseImage;" + // vector containing scale factors + "uniform vec4 scaleFactors;" + // vector containing offsets + "uniform vec4 offsets;" + "" + "void main(void)" + "{" + " vec4 srcColor = texture%s(baseImage, gl_TexCoord[0].st);" + // (placeholder for un-premult code) + " %s" + // rescale source value + " vec4 result = (srcColor * scaleFactors) + offsets;" + // (placeholder for re-premult code) + " %s" + // modulate with gl_Color in order to apply extra alpha + " gl_FragColor = result * gl_Color;" + "}"; + +/** + * Flags that can be bitwise-or'ed together to control how the shader + * source code is generated. + */ +#define RESCALE_RECT (1 << 0) +#define RESCALE_NON_PREMULT (1 << 1) + +/** + * The handles to the RescaleOp fragment program objects. The index to + * the array should be a bitwise-or'ing of the RESCALE_* flags defined + * above. Note that most applications will likely need to initialize one + * or two of these elements, so the array is usually sparsely populated. + */ +static GLhandleARB rescalePrograms[4]; + +/** + * Compiles and links the RescaleOp shader program. If successful, this + * function returns a handle to the newly created shader program; otherwise + * returns 0. + */ +static GLhandleARB +MTLBufImgOps_CreateRescaleProgram(jint flags) +{ + //TODO + J2dTraceNotImplPrimitive("MTLBufImgOps_CreateRescaleProgram"); + return NULL; +} + +void +MTLBufImgOps_EnableRescaleOp(MTLContext *mtlc, jlong pSrcOps, + jboolean nonPremult, + unsigned char *scaleFactors, + unsigned char *offsets) +{ + //TODO + J2dTraceNotImplPrimitive("MTLBufImgOps_EnableRescaleOp"); +} + +void +MTLBufImgOps_DisableRescaleOp(MTLContext *mtlc) +{ + //TODO + J2dTraceNotImplPrimitive("MTLBufImgOps_DisableRescaleOp"); + J2dTraceLn(J2D_TRACE_INFO, "MTLBufImgOps_DisableRescaleOp"); + RETURN_IF_NULL(mtlc); +} + +/**************************** LookupOp support ******************************/ + +/** + * The LookupOp shader takes a fragment color (from the source texture) as + * input, subtracts the optional user offset value, and then uses the + * resulting value to index into the lookup table texture to provide + * a new color result. Finally, the resulting value is multiplied by + * the current OpenGL color, which contains the extra alpha value. + * + * The lookup step requires 3 texture accesses (or 4, when alpha is included), + * which is somewhat unfortunate because it's not ideal from a performance + * standpoint, but that sort of thing is getting faster with newer hardware. + * In the 3-band case, we could consider using a three-dimensional texture + * and performing the lookup with a single texture access step. We already + * use this approach in the LCD text shader, and it works well, but for the + * purposes of this LookupOp shader, it's probably overkill. Also, there's + * a difference in that the LCD text shader only needs to populate the 3D LUT + * once, but here we would need to populate it on every invocation, which + * would likely be a waste of VRAM and CPU/GPU cycles. + * + * The LUT texture is currently hardcoded as 4 rows/bands, each containing + * 256 elements. This means that we currently only support user-provided + * tables with no more than 256 elements in each band (this is checked at + * at the Java level). If the user provides a table with less than 256 + * elements per band, our shader will still work fine, but if elements are + * accessed with an index >= the size of the LUT, then the shader will simply + * produce undefined values. Typically the user would provide an offset + * value that would prevent this from happening, but it's worth pointing out + * this fact because the software LookupOp implementation would usually + * throw an ArrayIndexOutOfBoundsException in this scenario (although it is + * not something demanded by the spec). + * + * The LookupOp spec says that the operation is performed regardless of + * whether the source data is premultiplied or non-premultiplied. This is + * a problem for the OpenGL pipeline in that a non-premultiplied + * BufferedImage will have already been converted into premultiplied + * when uploaded to an OpenGL texture. Therefore, we have a special mode + * called LOOKUP_NON_PREMULT (used only for source images that were + * originally non-premultiplied) that un-premultiplies the source color + * prior to the lookup operation, then re-premultiplies the resulting + * color before returning from the fragment shader. + * + * Note that this shader source code includes some "holes" marked by "%s". + * This allows us to build different shader programs (e.g. one for + * GL_TEXTURE_2D targets, one for GL_TEXTURE_RECTANGLE_ARB targets, and so on) + * simply by filling in these "holes" with a call to sprintf(). See the + * MTLBufImgOps_CreateLookupProgram() method for more details. + */ +static const char *lookupShaderSource = + // source image (bound to texture unit 0) + "uniform sampler%s baseImage;" + // lookup table (bound to texture unit 1) + "uniform sampler2D lookupTable;" + // offset subtracted from source index prior to lookup step + "uniform vec4 offset;" + "" + "void main(void)" + "{" + " vec4 srcColor = texture%s(baseImage, gl_TexCoord[0].st);" + // (placeholder for un-premult code) + " %s" + // subtract offset from original index + " vec4 srcIndex = srcColor - offset;" + // use source value as input to lookup table (note that + // "v" texcoords are hardcoded to hit texel centers of + // each row/band in texture) + " vec4 result;" + " result.r = texture2D(lookupTable, vec2(srcIndex.r, 0.125)).r;" + " result.g = texture2D(lookupTable, vec2(srcIndex.g, 0.375)).r;" + " result.b = texture2D(lookupTable, vec2(srcIndex.b, 0.625)).r;" + // (placeholder for alpha store code) + " %s" + // (placeholder for re-premult code) + " %s" + // modulate with gl_Color in order to apply extra alpha + " gl_FragColor = result * gl_Color;" + "}"; + +/** + * Flags that can be bitwise-or'ed together to control how the shader + * source code is generated. + */ +#define LOOKUP_RECT (1 << 0) +#define LOOKUP_USE_SRC_ALPHA (1 << 1) +#define LOOKUP_NON_PREMULT (1 << 2) + +/** + * The handles to the LookupOp fragment program objects. The index to + * the array should be a bitwise-or'ing of the LOOKUP_* flags defined + * above. Note that most applications will likely need to initialize one + * or two of these elements, so the array is usually sparsely populated. + */ +static GLhandleARB lookupPrograms[8]; + +/** + * The handle to the lookup table texture object used by the shader. + */ +static GLuint lutTextureID = 0; + +/** + * Compiles and links the LookupOp shader program. If successful, this + * function returns a handle to the newly created shader program; otherwise + * returns 0. + */ +static GLhandleARB +MTLBufImgOps_CreateLookupProgram(jint flags) +{ + //TODO + J2dTraceNotImplPrimitive("MTLBufImgOps_CreateLookupProgram"); + + return NULL; +} + +void +MTLBufImgOps_EnableLookupOp(MTLContext *mtlc, jlong pSrcOps, + jboolean nonPremult, jboolean shortData, + jint numBands, jint bandLength, jint offset, + void *tableValues) +{ + //TODO + J2dTraceNotImplPrimitive("MTLBufImgOps_EnableLookupOp"); +} + +void +MTLBufImgOps_DisableLookupOp(MTLContext *mtlc) +{ + //TODO + J2dTraceNotImplPrimitive("MTLBufImgOps_DisableLookupOp"); + J2dTraceLn(J2D_TRACE_INFO, "MTLBufImgOps_DisableLookupOp"); +} + +#endif /* !HEADLESS */ --- /dev/null 2019-05-16 19:16:48.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLContext.h 2019-05-16 19:16:48.000000000 +0300 @@ -0,0 +1,240 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef MTLContext_h_Included +#define MTLContext_h_Included + +#include + +#include "sun_java2d_pipe_BufferedContext.h" +#include "sun_java2d_metal_MTLContext.h" +#include "sun_java2d_metal_MTLContext_MTLContextCaps.h" + +#import +#include "j2d_md.h" +#include "MTLSurfaceDataBase.h" +#include "MTLTexturePool.h" +#include "MTLPipelineStatesStorage.h" + +/** + * The MTLBlendRule structure encapsulates the two enumerated values that + * comprise a given Porter-Duff blending (compositing) rule. For example, + * the "SrcOver" rule can be represented by: + * rule.src = GL_ONE; + * rule.dst = GL_ONE_MINUS_SRC_ALPHA; + * + * GLenum src; + * The constant representing the source factor in this Porter-Duff rule. + * + * GLenum dst; + * The constant representing the destination factor in this Porter-Duff rule. + */ +typedef struct { + jint src; + jint dst; +} MTLBlendRule; + +/** + * The MTLContext class contains cached state relevant to the native + * MTL context stored within the native ctxInfo field. Each Java-level + * MTLContext object is associated with a native-level MTLContext class. + * */ +@interface MTLContext : NSObject + +@property jint compState; +@property jfloat extraAlpha; +@property jint alphaCompositeRule; +@property jint xorPixel; +@property jint pixel; + +@property jdouble p0; +@property jdouble p1; +@property jdouble p3; +@property jboolean cyclic; +@property jint pixel1; +@property jint pixel2; + +@property jubyte r; +@property jubyte g; +@property jubyte b; +@property jubyte a; +@property jint paintState; +@property jboolean useMask; +@property jboolean useTransform; +@property simd_float4x4 transform4x4; +@property jint blitTextureID; +@property jint textureFunction; +@property jboolean vertexCacheEnabled; + +@property (readonly, strong) id device; +@property (strong) id library; +@property (strong) id pipelineState; +@property (strong) id commandQueue; +@property (readonly,strong) id commandBuffer; +@property (strong) id vertexBuffer; +@property jint color; +@property MTLScissorRect clipRect; +@property jboolean useClip; +@property (strong)MTLPipelineStatesStorage* pipelineStateStorage; +@property (strong)MTLTexturePool* texturePool; + +- (void)releaseCommandBuffer; +/** + * Fetches the MTLContext associated with the given destination surface, + * makes the context current for those surfaces, updates the destination + * viewport, and then returns a pointer to the MTLContext. + */ ++ (MTLContext*) setSurfacesEnv:(JNIEnv*)env src:(jlong)pSrc dst:(jlong)pDst; + +- (id)initWithDevice:(id)d shadersLib:(NSString*)shadersLib; + +/** + * Resets the current clip state (disables both scissor and depth tests). + */ +- (void)resetClip; + +/** + * Sets the Metal scissor bounds to the provided rectangular clip bounds. + */ +- (void)setClipRectX1:(jint)x1 Y1:(jint)y1 X2:(jint)x2 Y2:(jint)y2; + +/** + * Sets up a complex (shape) clip using the OpenGL depth buffer. This + * method prepares the depth buffer so that the clip Region spans can + * be "rendered" into it. The depth buffer is first cleared, then the + * depth func is setup so that when we render the clip spans, + * nothing is rendered into the color buffer, but for each pixel that would + * be rendered, a non-zero value is placed into that location in the depth + * buffer. With depth test enabled, pixels will only be rendered into the + * color buffer if the corresponding value at that (x,y) location in the + * depth buffer differs from the incoming depth value. + */ +- (void)beginShapeClip; + +/** + * Finishes setting up the shape clip by resetting the depth func + * so that future rendering operations will once again be written into the + * color buffer (while respecting the clip set up in the depth buffer). + */ +- (void)endShapeClip; + +/** + * Initializes the OpenGL state responsible for applying extra alpha. This + * step is only necessary for any operation that uses glDrawPixels() or + * glCopyPixels() with a non-1.0f extra alpha value. Since the source is + * always premultiplied, we apply the extra alpha value to both alpha and + * color components using GL_*_SCALE. + */ +- (void)setExtraAlpha:(jfloat)ea; + +/** + * Resets all OpenGL compositing state (disables blending and logic + * operations). + */ +- (void)resetComposite; + +/** + * Initializes the OpenGL blending state. XOR mode is disabled and the + * appropriate blend functions are setup based on the AlphaComposite rule + * constant. + */ +- (void)setAlphaCompositeRule:(jint)rule extraAlpha:(jfloat)extraAlpha + flags:(jint)flags; + +/** + * Initializes the OpenGL logic op state to XOR mode. Blending is disabled + * before enabling logic op mode. The XOR pixel value will be applied + * later in the MTLContext_SetColor() method. + */ +- (void)setXorComposite:(jint)xorPixel; +- (jboolean)isBlendingDisabled; + +/** + * Resets the OpenGL transform state back to the identity matrix. + */ +- (void)resetTransform; + +/** + * Initializes the OpenGL transform state by setting the modelview transform + * using the given matrix parameters. + * + * REMIND: it may be worthwhile to add serial id to AffineTransform, so we + * could do a quick check to see if the xform has changed since + * last time... a simple object compare won't suffice... + */ +- (void)setTransformM00:(jdouble) m00 M10:(jdouble) m10 + M01:(jdouble) m01 M11:(jdouble) m11 + M02:(jdouble) m02 M12:(jdouble) m12; + +/** + * Initializes a small texture tile for use with tiled blit operations (see + * MTLBlitLoops.c and MTLMaskBlit.c for usage examples). The texture ID for + * the tile is stored in the given MTLContext. The tile is initially filled + * with garbage values, but the tile is updated as needed (via + * glTexSubImage2D()) with real RGBA values used in tiled blit situations. + * The internal format for the texture is GL_RGBA8, which should be sufficient + * for storing system memory surfaces of any known format (see PixelFormats + * for a list of compatible surface formats). + */ +- (jboolean)initBlitTileTexture; + + +/** + * Creates a 2D texture of the given format and dimensions and returns the + * texture object identifier. This method is typically used to create a + * temporary texture for intermediate work, such as in the + * MTLContext_InitBlitTileTexture() method below. + */ +- (jint)createBlitTextureFormat:(jint)internalFormat pixelFormat:(jint)pixelFormat + width:(jint)width height:(jint)height; + +- (void)destroyContextResources; + +- (void)setColorR:(int)r G:(int)g B:(int)b A:(int)a; +- (void)setColorInt:(int)pixel; + +- (id)createSamplingEncoderForDest:(id)dest clearRed:(int)clearRed; +- (id)createSamplingEncoderForDest:(id)dest; +- (id)createBlitEncoder; +// NOTE: debug parameners will be removed soon +- (id)createRenderEncoderForDest:(id)dest clearRed:(int) clearRed/*debug param*/; +- (id)createRenderEncoderForDest:(id)dest; +- (void)setGradientPaintUseMask:(jboolean)useMask cyclic:(jboolean)cyclic p0:(jdouble) p0 p1:(jdouble) p1 p3:(jdouble)p3 + pixel1:(jint)pixel1 pixel2:(jint) pixel2; +- (void) setEncoderTransform:(id) encoder dest:(id) dest; +- (void)dealloc; +@end + +/** + * See BufferedContext.java for more on these flags... + */ +#define MTLC_NO_CONTEXT_FLAGS \ + sun_java2d_pipe_BufferedContext_NO_CONTEXT_FLAGS +#define MTLC_SRC_IS_OPAQUE \ + sun_java2d_pipe_BufferedContext_SRC_IS_OPAQUE +#define MTLC_USE_MASK \ + sun_java2d_pipe_BufferedContext_USE_MASK + +#endif /* MTLContext_h_Included */ --- /dev/null 2019-05-16 19:16:49.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLContext.m 2019-05-16 19:16:49.000000000 +0300 @@ -0,0 +1,448 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef HEADLESS + +#include +#include + +#include "sun_java2d_SunGraphics2D.h" + +#include "jlong.h" +#include "jni_util.h" +#import "MTLContext.h" +#include "MTLRenderQueue.h" +#include "MTLSurfaceDataBase.h" +#include "GraphicsPrimitiveMgr.h" +#include "Region.h" +#include "common.h" + +#include "jvm.h" + +extern jboolean MTLSD_InitMTLWindow(JNIEnv *env, MTLSDOps *mtlsdo); +extern MTLContext *MTLSD_MakeMTLContextCurrent(JNIEnv *env, + MTLSDOps *srcOps, + MTLSDOps *dstOps); + +#define RGBA_TO_V4(c) \ +{ \ + (((c) >> 16) & (0xFF))/255.0f, \ + (((c) >> 8) & 0xFF)/255.0f, \ + ((c) & 0xFF)/255.0f, \ + (((c) >> 24) & 0xFF)/255.0f \ +} + +/** + * This table contains the standard blending rules (or Porter-Duff compositing + * factors) used in glBlendFunc(), indexed by the rule constants from the + * AlphaComposite class. + */ +MTLBlendRule MTStdBlendRules[] = { +}; + +static struct TxtVertex verts[PGRAM_VERTEX_COUNT] = { + {{-1.0, 1.0, 0.0}, {0.0, 0.0}}, + {{1.0, 1.0, 0.0}, {1.0, 0.0}}, + {{1.0, -1.0, 0.0}, {1.0, 1.0}}, + {{1.0, -1.0, 0.0}, {1.0, 1.0}}, + {{-1.0, -1.0, 0.0}, {0.0, 1.0}}, + {{-1.0, 1.0, 0.0}, {0.0, 0.0}} +}; + + +static void _traceMatrix(simd_float4x4 * mtx) { + for (int row = 0; row < 4; ++row) { + J2dTraceLn4(J2D_TRACE_VERBOSE, " [%lf %lf %lf %lf]", + mtx->columns[0][row], mtx->columns[1][row], mtx->columns[2][row], mtx->columns[3][row]); + } +} + +MTLRenderPassDescriptor* createRenderPassDesc(id dest) { + MTLRenderPassDescriptor * result = [MTLRenderPassDescriptor renderPassDescriptor]; + if (result == nil) + return nil; + + if (dest == nil) { + J2dTraceLn(J2D_TRACE_ERROR, "_createRenderPassDesc: destination texture is null"); + return nil; + } + + MTLRenderPassColorAttachmentDescriptor * ca = result.colorAttachments[0]; + ca.texture = dest; + ca.loadAction = MTLLoadActionLoad; + ca.clearColor = MTLClearColorMake(0.0f, 0.9f, 0.0f, 1.0f); + ca.storeAction = MTLStoreActionStore; + return result; +} + +@implementation MTLContext { + id _commandBuffer; +} + +@synthesize compState, extraAlpha, alphaCompositeRule, xorPixel, pixel, p0, + p1, p3, cyclic, pixel1, pixel2, r, g, b, a, paintState, useMask, + useTransform, transform4x4, blitTextureID, textureFunction, + vertexCacheEnabled, device, library, pipelineState, pipelineStateStorage, + commandQueue, vertexBuffer, + color, clipRect, useClip, texturePool; + + + - (id) commandBuffer { + if (_commandBuffer == nil) { + // NOTE: Command queues are thread-safe and allow multiple outstanding command buffers to be encoded simultaneously. + _commandBuffer = [[self.commandQueue commandBuffer] retain];// released in [layer blitTexture] + } + return _commandBuffer; +} + +- (void)releaseCommandBuffer { + [_commandBuffer release]; + _commandBuffer = nil; +} + ++ (MTLContext*) setSurfacesEnv:(JNIEnv*)env src:(jlong)pSrc dst:(jlong)pDst { + BMTLSDOps *srcOps = (BMTLSDOps *)jlong_to_ptr(pSrc); + BMTLSDOps *dstOps = (BMTLSDOps *)jlong_to_ptr(pDst); + MTLContext *mtlc = NULL; + + if (srcOps == NULL || dstOps == NULL) { + J2dRlsTraceLn(J2D_TRACE_ERROR, "MTLContext_SetSurfaces: ops are null"); + return NULL; + } + + J2dTraceLn6(J2D_TRACE_VERBOSE, "MTLContext_SetSurfaces: bsrc=%p (tex=%p type=%d), bdst=%p (tex=%p type=%d)", srcOps, srcOps->pTexture, srcOps->drawableType, dstOps, dstOps->pTexture, dstOps->drawableType); + + if (dstOps->drawableType == MTLSD_TEXTURE) { + J2dRlsTraceLn(J2D_TRACE_ERROR, + "MTLContext_SetSurfaces: texture cannot be used as destination"); + return NULL; + } + + if (dstOps->drawableType == MTLSD_UNDEFINED) { + // initialize the surface as an OGLSD_WINDOW + if (!MTLSD_InitMTLWindow(env, dstOps)) { + J2dRlsTraceLn(J2D_TRACE_ERROR, + "MTLContext_SetSurfaces: could not init OGL window"); + return NULL; + } + } + + // make the context current + MTLSDOps *dstCGLOps = (MTLSDOps *)dstOps->privOps; + mtlc = dstCGLOps->configInfo->context; + + if (mtlc == NULL) { + J2dRlsTraceLn(J2D_TRACE_ERROR, + "MTLContext_SetSurfaces: could not make context current"); + return NULL; + } + + // perform additional one-time initialization, if necessary + if (dstOps->needsInit) { + if (dstOps->isOpaque) { + // in this case we are treating the destination as opaque, but + // to do so, first we need to ensure that the alpha channel + // is filled with fully opaque values (see 6319663) + //MTLContext_InitAlphaChannel(); + } + dstOps->needsInit = JNI_FALSE; + } + + return mtlc; +} + +- (id)initWithDevice:(id)d shadersLib:(NSString*)shadersLib { + self = [super init]; + if (self) { + // Initialization code here. + device = d; + + texturePool = [[MTLTexturePool alloc] initWithDevice:device]; + pipelineStateStorage = [[MTLPipelineStatesStorage alloc] initWithDevice:device shaderLibPath:shadersLib]; + + vertexBuffer = [device newBufferWithBytes:verts + length:sizeof(verts) + options:MTLResourceCPUCacheModeDefaultCache]; + + NSError *error = nil; + + library = [device newLibraryWithFile:shadersLib error:&error]; + if (!library) { + NSLog(@"Failed to load library. error %@", error); + exit(0); + } + + _commandBuffer = nil; + + // Create command queue + commandQueue = [device newCommandQueue]; + } + return self; +} + +- (void)resetClip { + //TODO + J2dTraceNotImplPrimitive("MTLContext.resetClip"); + J2dTraceLn(J2D_TRACE_INFO, "MTLContext.resetClip"); + useClip = JNI_FALSE; +} + +- (void)setClipRectX1:(jint)x1 Y1:(jint)y1 X2:(jint)x2 Y2:(jint)y2 { + //TODO + J2dTraceNotImplPrimitive("MTLContext.setClipRectX1:Y1:X2:Y2"); + jint width = x2 - x1; + jint height = y2 - y1; + + J2dTraceLn4(J2D_TRACE_INFO, "MTLContext.setClipRect: x=%d y=%d w=%d h=%d", x1, y1, width, height); + + clipRect.x = x1; + clipRect.y = y1; + clipRect.width = width; + clipRect.height = height; + useClip = JNI_TRUE; +} + +- (void)beginShapeClip { + //TODO + J2dTraceNotImplPrimitive("MTLContext.beginShapeClip"); + J2dTraceLn(J2D_TRACE_INFO, "MTLContext.beginShapeClip"); +} + +- (void)endShapeClip { + //TODO + J2dTraceNotImplPrimitive("MTLContext.endShapeClip"); + J2dTraceLn(J2D_TRACE_INFO, "MTLContext.endShapeClip"); +} + +- (void)resetComposite { + //TODO + J2dTraceNotImplPrimitive("MTLContext_ResetComposite"); + J2dTraceLn(J2D_TRACE_INFO, "MTLContext_ResetComposite"); +} + +- (void)setAlphaCompositeRule:(jint)rule extraAlpha:(jfloat)_extraAlpha + flags:(jint)flags { + J2dTracePrimitive("MTLContext_SetAlphaComposite"); + J2dTraceLn3(J2D_TRACE_INFO, "MTLContext_SetAlphaComposite: rule=%d, extraAlpha=%1.2f, flags=%d", rule, extraAlpha, flags); + + extraAlpha = _extraAlpha; + alphaCompositeRule = rule; +} + + +- (void)setXorComposite:(jint)xorPixel { + //TODO + J2dTraceNotImplPrimitive("MTLContext.setXorComposite"); + J2dTraceLn1(J2D_TRACE_INFO, + "MTLContext.setXorComposite: xorPixel=%08x", xorPixel); +} + +- (jboolean)isBlendingDisabled { + // TODO: hold case mtlc->alphaCompositeRule == RULE_SrcOver && sun_java2d_pipe_BufferedContext_SRC_IS_OPAQUE + return alphaCompositeRule == RULE_Src && (extraAlpha - 1.0f < 0.001f); +} + + +- (void)resetTransform { + J2dTracePrimitive("MTLContext_ResetTransform"); + J2dTraceLn(J2D_TRACE_INFO, "MTLContext_ResetTransform"); + useTransform = JNI_FALSE; +} + +- (void)setTransformM00:(jdouble) m00 M10:(jdouble) m10 + M01:(jdouble) m01 M11:(jdouble) m11 + M02:(jdouble) m02 M12:(jdouble) m12 { + + + J2dTraceLn(J2D_TRACE_INFO, "MTLContext_SetTransform"); + + J2dTracePrimitive("MTLContext_SetTransform"); + + memset(&(transform4x4), 0, sizeof(transform4x4)); + transform4x4.columns[0][0] = m00; + transform4x4.columns[0][1] = m10; + transform4x4.columns[1][0] = m01; + transform4x4.columns[1][1] = m11; + transform4x4.columns[3][0] = m02; + transform4x4.columns[3][1] = m12; + transform4x4.columns[3][3] = 1.0; + transform4x4.columns[4][4] = 1.0; + useTransform = JNI_TRUE; +} + +- (jboolean)initBlitTileTexture { + //TODO + J2dTraceNotImplPrimitive("MTLContext_InitBlitTileTexture"); + J2dTraceLn(J2D_TRACE_INFO, "MTLContext_InitBlitTileTexture"); + + return JNI_TRUE; +} + +- (jint)createBlitTextureFormat:(jint)internalFormat pixelFormat:(jint)pixelFormat + width:(jint)width height:(jint)height { + //TODO + J2dTraceNotImplPrimitive("MTLContext_CreateBlitTexture"); + return 0; +} + + +- (void)setColorR:(int)_r G:(int)_g B:(int)_b A:(int)_a { + color = 0; + color |= (_r & (0xFF)) << 16; + color |= (_g & (0xFF)) << 8; + color |= _b & (0xFF); + color |= (_a & (0xFF)) << 24; + J2dTraceLn4(J2D_TRACE_INFO, "MTLContext.setColor (%d, %d, %d) %d", r,g,b,a); +} + +- (void)setColorInt:(int)_pixel { + color = _pixel; + J2dTraceLn5(J2D_TRACE_INFO, "MTLContext.setColorInt: pixel=%08x [r=%d g=%d b=%d a=%d]", pixel, (pixel >> 16) & (0xFF), (pixel >> 8) & 0xFF, (pixel) & 0xFF, (pixel >> 24) & 0xFF); +} + +- (id) createEncoderForDest:(id) dest { + id cb = self.commandBuffer; + if (cb == nil) + return nil; + + MTLRenderPassDescriptor * rpd = createRenderPassDesc(dest); + if (rpd == nil) + return nil; + + // J2dTraceLn1(J2D_TRACE_VERBOSE, "MTLContext: created render encoder to draw on tex=%p", dest); + return [cb renderCommandEncoderWithDescriptor:rpd]; +} + +- (void) setEncoderTransform:(id) encoder dest:(id) dest { + simd_float4x4 normalize; + memset(&normalize, 0, sizeof(normalize)); + normalize.columns[0][0] = 2/(double)dest.width; + normalize.columns[1][1] = -2/(double)dest.height; + normalize.columns[3][0] = -1.f; + normalize.columns[3][1] = 1.f; + normalize.columns[3][3] = 1.0; + normalize.columns[4][4] = 1.0; + + if (useTransform) { + simd_float4x4 vertexMatrix = simd_mul(normalize, transform4x4); + [encoder setVertexBytes:&(vertexMatrix) length:sizeof(vertexMatrix) atIndex:MatrixBuffer]; + } else { + [encoder setVertexBytes:&(normalize) length:sizeof(normalize) atIndex:MatrixBuffer]; + } +} + +- (id) createRenderEncoderForDest:(id) dest { + id mtlEncoder = [self createEncoderForDest: dest]; + if (useClip) + [mtlEncoder setScissorRect:clipRect]; + + if (compState == sun_java2d_SunGraphics2D_PAINT_ALPHACOLOR) { + // set pipeline state + [mtlEncoder setRenderPipelineState:[self.pipelineStateStorage getRenderPipelineState:NO]]; + struct FrameUniforms uf = {RGBA_TO_V4(color)}; + [mtlEncoder setVertexBytes:&uf length:sizeof(uf) atIndex:FrameUniformBuffer]; + } else if (compState == sun_java2d_SunGraphics2D_PAINT_GRADIENT) { + // set viewport and pipeline state + //[mtlEncoder setRenderPipelineState:gradPipelineState]; + [mtlEncoder setRenderPipelineState:[self.pipelineStateStorage getRenderPipelineState:YES]]; + + struct GradFrameUniforms uf = { + {p0, p1, p3}, + RGBA_TO_V4(pixel1), + RGBA_TO_V4(pixel2)}; + + [mtlEncoder setFragmentBytes: &uf length:sizeof(uf) atIndex:0]; + } + [self setEncoderTransform:mtlEncoder dest:dest]; + return mtlEncoder; +} + +- (id)createSamplingEncoderForDest:(id)dest { + id mtlEncoder = [self createRenderEncoderForDest:dest]; + [mtlEncoder setRenderPipelineState:[pipelineStateStorage getTexturePipelineState:NO compositeRule:alphaCompositeRule]]; + [self setEncoderTransform:mtlEncoder dest:dest]; + return mtlEncoder; +} + +- (id)createBlitEncoder { + return _commandBuffer == nil ? nil : [_commandBuffer blitCommandEncoder]; +} + +- (void)dealloc { + J2dTracePrimitive("MTLContext.dealloc"); + J2dTraceLn(J2D_TRACE_INFO, "MTLContext.dealloc"); + + self.texturePool = nil; + self.library = nil; + self.vertexBuffer = nil; + self.commandQueue = nil; + self.pipelineState = nil; + self.pipelineStateStorage = nil; + [super dealloc]; +} + +- (void)setGradientPaintUseMask:(jboolean)_useMask cyclic:(jboolean)_cyclic p0:(jdouble) _p0 p1:(jdouble)_p1 + p3:(jdouble)_p3 pixel1:(jint)_pixel1 pixel2:(jint)_pixel2 { + + //TODO Resolve gradient distribution problem + //TODO Implement useMask + //TODO Implement cyclic + //fprintf(stderr, + // "MTLPaints_SetGradientPaint useMask=%d cyclic=%d " + // "p0=%f p1=%f p3=%f pix1=%d pix2=%d\n", useMask, cyclic, + // p0, p1, p3, pixel1, pixel2); + J2dTraceNotImplPrimitive("MTLContext.setGradientPaint"); + + compState = sun_java2d_SunGraphics2D_PAINT_GRADIENT; + useMask = _useMask; + pixel1 = _pixel1; + pixel2 = _pixel2; + p0 = _p0; + p1 = _p1; + p3 = _p3; + cyclic = _cyclic; + } + +@end + +/* + * Class: sun_java2d_metal_MTLContext + * Method: getMTLIdString + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_sun_java2d_metal_MTLContext_getMTLIdString + (JNIEnv *env, jclass mtlcc) +{ + char *vendor, *renderer, *version; + char *pAdapterId; + jobject ret = NULL; + int len; + + return NULL; +} + + + +#endif /* !HEADLESS */ --- /dev/null 2019-05-16 19:16:51.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLFuncs.h 2019-05-16 19:16:50.000000000 +0300 @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef MTLFuncs_h_Included +#define MTLFuncs_h_Included + +#ifdef MACOSX +#include +#endif +#include "jni.h" +#include "Trace.h" + +jboolean MTLFuncs_OpenLibrary(); +void MTLFuncs_CloseLibrary(); +jboolean MTLFuncs_InitPlatformFuncs(); +jboolean MTLFuncs_InitBaseFuncs(); +jboolean MTLFuncs_InitExtFuncs(); + +#endif /* MTLFuncs_h_Included */ --- /dev/null 2019-05-16 19:16:52.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLFuncs.m 2019-05-16 19:16:51.000000000 +0300 @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef HEADLESS + +#include "MTLFuncs.h" + + +jboolean +MTLFuncs_OpenLibrary() +{ + //TODO + J2dTraceNotImplPrimitive("MTLFuncs_OpenLibrary"); + + J2dRlsTraceLn(J2D_TRACE_INFO, "MTLFuncs_OpenLibrary"); + + + return JNI_TRUE; +} + +void +MTLFuncs_CloseLibrary() +{ + //TODO + J2dTraceNotImplPrimitive("MTLFuncs_CloseLibrary"); + J2dRlsTraceLn(J2D_TRACE_INFO, "MTLFuncs_CloseLibrary"); + +} + +jboolean +MTLFuncs_InitPlatformFuncs() +{ + //TODO + J2dTraceNotImplPrimitive("MTLFuncs_InitPlatformFuncs"); + J2dRlsTraceLn(J2D_TRACE_INFO, "MTLFuncs_InitPlatformFuncs"); + + return JNI_TRUE; +} + +jboolean +MTLFuncs_InitBaseFuncs() +{ + //TODO + J2dTraceNotImplPrimitive("MTLFuncs_InitBaseFuncs"); + J2dRlsTraceLn(J2D_TRACE_INFO, "MTLFuncs_InitBaseFuncs"); + + + return JNI_TRUE; +} + +jboolean +MTLFuncs_InitExtFuncs() +{ + //TODO + J2dTraceNotImplPrimitive("MTLFuncs_InitExtFuncs"); + J2dRlsTraceLn(J2D_TRACE_INFO, "MTLFuncs_InitExtFuncs"); + + return JNI_TRUE; +} + +#endif /* !HEADLESS */ --- /dev/null 2019-05-16 19:16:53.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLGraphicsConfig.h 2019-05-16 19:16:53.000000000 +0300 @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef MTLGraphicsConfig_h_Included +#define MTLGraphicsConfig_h_Included + +#import "jni.h" +#import "MTLSurfaceDataBase.h" +#import "MTLContext.h" +#import +#import +#import + + +@interface MTLGraphicsConfigUtil : NSObject {} ++ (void) _getMTLConfigInfo: (NSMutableArray *)argValue; +@end + +// REMIND: Using an NSOpenGLPixelBuffer as the scratch surface has been +// problematic thus far (seeing garbage and flickering when switching +// between an NSView and the scratch surface), so the following enables +// an alternate codepath that uses a hidden NSWindow/NSView as the scratch +// surface, for the purposes of making a context current in certain +// situations. It appears that calling [NSOpenGLContext setView] too +// frequently contributes to the bad behavior, so we should try to avoid +// switching to the scratch surface whenever possible. + +/* Do we need this if we are using all off-screen drawing ? */ +#define USE_NSVIEW_FOR_SCRATCH 1 + +/* Uncomment to have an additional CAOGLLayer instance tied to + * each instance, which can be used to test remoting the layer + * to an out of process window. The additional layer is needed + * because a layer can only be attached to one context (view/window). + * This is only for testing purposes and can be removed if/when no + * longer needed. + */ + + +/** + * The MTLGraphicsConfigInfo structure contains information specific to a + * given CGLGraphicsConfig (pixel format). + * + * jint screen; + * The screen and PixelFormat for the associated CGLGraphicsConfig. + * + * NSOpenGLPixelFormat *pixfmt; + * The pixel format of the native NSOpenGL context. + * + * MTLContext *context; + * The context associated with this CGLGraphicsConfig. + */ +typedef struct _MTLGraphicsConfigInfo { + jint screen; + NSOpenGLPixelFormat *pixfmt; + MTLContext *context; +} MTLGraphicsConfigInfo; + +#endif /* MTLGraphicsConfig_h_Included */ --- /dev/null 2019-05-16 19:16:54.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLGraphicsConfig.m 2019-05-16 19:16:54.000000000 +0300 @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import "sun_java2d_metal_MTLGraphicsConfig.h" + +#import "MTLGraphicsConfig.h" +#import "MTLSurfaceData.h" +#import "ThreadUtilities.h" + +#import +#import +#import +#import + +#pragma mark - +#pragma mark "--- Mac OS X specific methods for GL pipeline ---" + +/** + * Disposes all memory and resources associated with the given + * CGLGraphicsConfigInfo (including its native MTLContext data). + */ +void +MTLGC_DestroyMTLGraphicsConfig(jlong pConfigInfo) +{ + J2dTraceLn(J2D_TRACE_INFO, "MTLGC_DestroyMTLGraphicsConfig"); + + MTLGraphicsConfigInfo *mtlinfo = + (MTLGraphicsConfigInfo *)jlong_to_ptr(pConfigInfo); + if (mtlinfo == NULL) { + J2dRlsTraceLn(J2D_TRACE_ERROR, + "MTLGC_DestroyMTLGraphicsConfig: info is null"); + return; + } + + MTLContext *mtlc = (MTLContext*)mtlinfo->context; + if (mtlc != NULL) { + [mtlinfo->context release]; + mtlinfo->context = nil; + } + free(mtlinfo); +} + +#pragma mark - +#pragma mark "--- MTLGraphicsConfig methods ---" + + +/** + * Attempts to initialize CGL and the core OpenGL library. + */ +JNIEXPORT jboolean JNICALL +Java_sun_java2d_metal_MTLGraphicsConfig_initMTL + (JNIEnv *env, jclass cglgc) +{ + J2dRlsTraceLn(J2D_TRACE_INFO, "MTLGraphicsConfig_initMTL"); + + if (!MTLFuncs_OpenLibrary()) { + return JNI_FALSE; + } + + if (!MTLFuncs_InitPlatformFuncs() || + !MTLFuncs_InitBaseFuncs() || + !MTLFuncs_InitExtFuncs()) + { + MTLFuncs_CloseLibrary(); + return JNI_FALSE; + } + + return JNI_TRUE; +} + + +/** + * Determines whether the CGL pipeline can be used for a given GraphicsConfig + * provided its screen number and visual ID. If the minimum requirements are + * met, the native CGLGraphicsConfigInfo structure is initialized for this + * GraphicsConfig with the necessary information (pixel format, etc.) + * and a pointer to this structure is returned as a jlong. If + * initialization fails at any point, zero is returned, indicating that CGL + * cannot be used for this GraphicsConfig (we should fallback on an existing + * 2D pipeline). + */ +JNIEXPORT jlong JNICALL +Java_sun_java2d_metal_MTLGraphicsConfig_getMTLConfigInfo + (JNIEnv *env, jclass cglgc, jint displayID, jstring mtlShadersLib) +{ + jlong ret = 0L; + JNF_COCOA_ENTER(env); + NSMutableArray * retArray = [NSMutableArray arrayWithCapacity:3]; + [retArray addObject: [NSNumber numberWithInt: (int)displayID]]; + [retArray addObject: [NSString stringWithUTF8String: JNU_GetStringPlatformChars(env, mtlShadersLib, 0)]]; + if ([NSThread isMainThread]) { + [MTLGraphicsConfigUtil _getMTLConfigInfo: retArray]; + } else { + [MTLGraphicsConfigUtil performSelectorOnMainThread: @selector(_getMTLConfigInfo:) withObject: retArray waitUntilDone: YES]; + } + NSNumber * num = (NSNumber *)[retArray objectAtIndex: 0]; + ret = (jlong)[num longValue]; + JNF_COCOA_EXIT(env); + return ret; +} + + + + +@implementation MTLGraphicsConfigUtil ++ (void) _getMTLConfigInfo: (NSMutableArray *)argValue { + AWT_ASSERT_APPKIT_THREAD; + + jint displayID = (jint)[(NSNumber *)[argValue objectAtIndex: 0] intValue]; + NSString *mtlShadersLib = (NSString *)[argValue objectAtIndex: 1]; + JNIEnv *env = [ThreadUtilities getJNIEnvUncached]; + [argValue removeAllObjects]; + + J2dRlsTraceLn(J2D_TRACE_INFO, "MTLGraphicsConfig_getMTLConfigInfo"); + + NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; + + + NSRect contentRect = NSMakeRect(0, 0, 64, 64); + NSWindow *window = + [[NSWindow alloc] + initWithContentRect: contentRect + styleMask: NSBorderlessWindowMask + backing: NSBackingStoreBuffered + defer: false]; + if (window == nil) { + J2dRlsTraceLn(J2D_TRACE_ERROR, "MTLGraphicsConfig_getMTLConfigInfo: NSWindow is NULL"); + [argValue addObject: [NSNumber numberWithLong: 0L]]; + return; + } + + NSView *scratchSurface = + [[NSView alloc] + initWithFrame: contentRect]; + if (scratchSurface == nil) { + J2dRlsTraceLn(J2D_TRACE_ERROR, "MTLGraphicsConfig_getMTLConfigInfo: NSView is NULL"); + [argValue addObject: [NSNumber numberWithLong: 0L]]; + return; + } + [window setContentView: scratchSurface]; + + MTLContext *mtlc = [[MTLContext alloc] initWithDevice:CGDirectDisplayCopyCurrentMetalDevice(displayID) + shadersLib:mtlShadersLib]; + if (mtlc == 0L) { + J2dRlsTraceLn(J2D_TRACE_ERROR, "MTLGC_InitMTLContext: could not allocate memory for mtlc"); + [argValue addObject: [NSNumber numberWithLong: 0L]]; + return; + } + + + // create the MTLGraphicsConfigInfo record for this config + MTLGraphicsConfigInfo *mtlinfo = (MTLGraphicsConfigInfo *)malloc(sizeof(MTLGraphicsConfigInfo)); + if (mtlinfo == NULL) { + J2dRlsTraceLn(J2D_TRACE_ERROR, "MTLGraphicsConfig_getMTLConfigInfo: could not allocate memory for mtlinfo"); + free(mtlc); + [argValue addObject: [NSNumber numberWithLong: 0L]]; + return; + } + memset(mtlinfo, 0, sizeof(MTLGraphicsConfigInfo)); + mtlinfo->screen = displayID; + mtlinfo->context = mtlc; + + [argValue addObject: [NSNumber numberWithLong:ptr_to_jlong(mtlinfo)]]; + [pool drain]; +} +@end //GraphicsConfigUtil + + +JNIEXPORT jint JNICALL +Java_sun_java2d_metal_MTLGraphicsConfig_nativeGetMaxTextureSize + (JNIEnv *env, jclass mtlgc) +{ + J2dTraceLn(J2D_TRACE_INFO, "MTLGraphicsConfig_nativeGetMaxTextureSize"); + + __block int max = 0; + +// [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ +// }]; + + return (jint)max; +} --- /dev/null 2019-05-16 19:16:55.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.h 2019-05-16 19:16:55.000000000 +0300 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef MTLLayer_h_Included +#define MTLLayer_h_Included +#import +#import +#import "common.h" + +#import + +@interface MTLLayer : CAMetalLayer +{ +@private + JNFWeakJObjectWrapper *javaLayer; + + // intermediate buffer, used the RQ lock to synchronize + MTLContext* ctx; + float bufferWidth; + float bufferHeight; + id buffer; +} + +@property (nonatomic, retain) JNFWeakJObjectWrapper *javaLayer; +@property (readwrite, assign) MTLContext* ctx; +@property (readwrite, assign) float bufferWidth; +@property (readwrite, assign) float bufferHeight; +@property (readwrite, assign) id buffer; + +- (id) initWithJavaLayer:(JNFWeakJObjectWrapper *)layer; + +- (void) blitTexture:(id)commandBuf; +- (void) fillParallelogramCtxX:(jfloat)x + Y:(jfloat)y + DX1:(jfloat)dx1 + DY1:(jfloat)dy1 + DX2:(jfloat)dx2 + DY2:(jfloat)dy2; +@end + +#endif /* CGLLayer_h_Included */ --- /dev/null 2019-05-16 19:16:56.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m 2019-05-16 19:16:56.000000000 +0300 @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import "MTLGraphicsConfig.h" +#import "MTLLayer.h" +#import "ThreadUtilities.h" +#import "LWCToolkit.h" +#import "MTLSurfaceData.h" + +#import "MTLBlitLoops.h" + +@implementation MTLLayer + + +@synthesize javaLayer; +@synthesize ctx; +@synthesize bufferWidth; +@synthesize bufferHeight; +@synthesize buffer; + +- (id) initWithJavaLayer:(JNFWeakJObjectWrapper *)layer +{ + AWT_ASSERT_APPKIT_THREAD; + // Initialize ourselves + self = [super init]; + if (self == nil) return self; + + self.javaLayer = layer; + + self.contentsGravity = kCAGravityTopLeft; + + //Disable CALayer's default animation + NSMutableDictionary * actions = [[NSMutableDictionary alloc] initWithObjectsAndKeys: + [NSNull null], @"anchorPoint", + [NSNull null], @"bounds", + [NSNull null], @"contents", + [NSNull null], @"contentsScale", + [NSNull null], @"onOrderIn", + [NSNull null], @"onOrderOut", + [NSNull null], @"position", + [NSNull null], @"sublayers", + nil]; + self.actions = actions; + [actions release]; + + + return self; +} + +- (void) blitTexture:(id)commandBuf { + if (self.ctx == NULL || self.javaLayer == NULL || self.buffer == nil || ctx.device == nil) { + J2dTraceLn4(J2D_TRACE_VERBOSE, "MTLLayer.blitTexture: uninitialized (mtlc=%p, javaLayer=%p, buffer=%p, devide=%p)", self.ctx, self.javaLayer, self.buffer, ctx->mtlDevice); + return; + } + + if (commandBuf == nil) { + J2dTraceLn(J2D_TRACE_VERBOSE, "MTLLayer.blitTexture: nothing to do (commandBuf is null)"); + return; + } + + @autoreleasepool { + self.device = ctx.device; + self.pixelFormat = MTLPixelFormatBGRA8Unorm; + self.framebufferOnly = NO; + + self.drawableSize = + CGSizeMake(self.buffer.width, + self.buffer.height); + + id mtlDrawable = [self nextDrawable]; + if (mtlDrawable == nil) { + return; + } + J2dTraceLn6(J2D_TRACE_INFO, "MTLLayer.blitTexture: src tex=%p (w=%d, h=%d), dst tex=%p (w=%d, h=%d)", self.buffer, self.buffer.width, self.buffer.height, mtlDrawable.texture, mtlDrawable.texture.width, mtlDrawable.texture.height); + id blitEncoder = [commandBuf blitCommandEncoder]; + [blitEncoder + copyFromTexture:self.buffer sourceSlice:0 sourceLevel:0 sourceOrigin:MTLOriginMake(0, 0, 0) sourceSize:MTLSizeMake(self.buffer.width, self.buffer.height, 1) + toTexture:mtlDrawable.texture destinationSlice:0 destinationLevel:0 destinationOrigin:MTLOriginMake(0, 0, 0)]; + [blitEncoder endEncoding]; + + [commandBuf presentDrawable:mtlDrawable]; + + [commandBuf addCompletedHandler:^(id cmdBuff) { + [cmdBuff release]; + [ctx.texturePool markAllTexturesFree]; + }]; + + [commandBuf commit]; + } +} + +- (void) dealloc { + self.javaLayer = nil; + [super dealloc]; +} + +@end + +/* + * Class: sun_java2d_metal_CGLLayer + * Method: nativeCreateLayer + * Signature: ()J + */ +JNIEXPORT jlong JNICALL +Java_sun_java2d_metal_MTLLayer_nativeCreateLayer +(JNIEnv *env, jobject obj) +{ + __block MTLLayer *layer = nil; + +JNF_COCOA_ENTER(env); + + JNFWeakJObjectWrapper *javaLayer = [JNFWeakJObjectWrapper wrapperWithJObject:obj withEnv:env]; + + [ThreadUtilities performOnMainThreadWaiting:YES block:^(){ + AWT_ASSERT_APPKIT_THREAD; + + layer = [[MTLLayer alloc] initWithJavaLayer: javaLayer]; + }]; + +JNF_COCOA_EXIT(env); + + return ptr_to_jlong(layer); +} + +// Must be called under the RQ lock. +JNIEXPORT void JNICALL +Java_sun_java2d_metal_MTLLayer_validate +(JNIEnv *env, jclass cls, jlong layerPtr, jobject surfaceData) +{ + MTLLayer *layer = OBJC(layerPtr); + + if (surfaceData != NULL) { + BMTLSDOps *bmtlsdo = (BMTLSDOps*) SurfaceData_GetOps(env, surfaceData); + layer.bufferWidth = bmtlsdo->width; + layer.bufferHeight = bmtlsdo->width; + layer.buffer = bmtlsdo->pTexture; + layer.ctx = ((MTLSDOps *)bmtlsdo->privOps)->configInfo->context; + layer.device = layer.ctx.device; + } else { + layer.ctx = NULL; + } +} + +JNIEXPORT void JNICALL +Java_sun_java2d_metal_MTLLayer_nativeSetScale +(JNIEnv *env, jclass cls, jlong layerPtr, jdouble scale) +{ + JNF_COCOA_ENTER(env); + MTLLayer *layer = jlong_to_ptr(layerPtr); + // We always call all setXX methods asynchronously, exception is only in + // this method where we need to change native texture size and layer's scale + // in one call on appkit, otherwise we'll get window's contents blinking, + // during screen-2-screen moving. + [ThreadUtilities performOnMainThreadWaiting:[NSThread isMainThread] block:^(){ + layer.contentsScale = scale; + }]; + JNF_COCOA_EXIT(env); +} --- /dev/null 2019-05-16 19:16:58.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLMaskBlit.h 2019-05-16 19:16:57.000000000 +0300 @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef MTLMaskBlit_h_Included +#define MTLMaskBlit_h_Included + +#include "MTLContext.h" + +void MTLMaskBlit_MaskBlit(JNIEnv *env, MTLContext *mtlc, BMTLSDOps * dstOps, + jint dstx, jint dsty, + jint width, jint height, + void *pPixels); + +#endif /* MTLMaskBlit_h_Included */ --- /dev/null 2019-05-16 19:16:59.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLMaskBlit.m 2019-05-16 19:16:58.000000000 +0300 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef HEADLESS + +#include +#include + +#include "MTLMaskBlit.h" +#include "MTLRenderQueue.h" +#include "MTLSurfaceDataBase.h" + +/** + * REMIND: This method assumes that the dimensions of the incoming pixel + * array are less than or equal to the cached blit texture tile; + * these are rather fragile assumptions, and should be cleaned up... + */ +void +MTLMaskBlit_MaskBlit(JNIEnv *env, MTLContext *mtlc, BMTLSDOps * dstOps, + jint dstx, jint dsty, + jint width, jint height, + void *pPixels) +{ + //TODO + J2dTraceNotImplPrimitive("MTLMaskBlit_MaskBlit"); + J2dTraceLn(J2D_TRACE_INFO, "MTLMaskBlit_MaskBlit"); + + if (width <= 0 || height <= 0) { + J2dTraceLn(J2D_TRACE_WARNING, + "MTLMaskBlit_MaskBlit: invalid dimensions"); + return; + } +} + +#endif /* !HEADLESS */ --- /dev/null 2019-05-16 19:17:00.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLMaskFill.h 2019-05-16 19:17:00.000000000 +0300 @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef MTLMaskFill_h_Included +#define MTLMaskFill_h_Included + +#include "MTLContext.h" + +void MTLMaskFill_MaskFill(MTLContext *mtlc, BMTLSDOps * dstOps, + jint x, jint y, jint w, jint h, + jint maskoff, jint maskscan, jint masklen, + unsigned char *pMask); + +#endif /* MTLMaskFill_h_Included */ --- /dev/null 2019-05-16 19:17:01.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLMaskFill.m 2019-05-16 19:17:01.000000000 +0300 @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef HEADLESS + +#include "sun_java2d_metal_MTLMaskFill.h" + +#include "MTLMaskFill.h" +#include "MTLRenderQueue.h" +#include "MTLVertexCache.h" + +/** + * This implementation first copies the alpha tile into a texture and then + * maps that texture to the destination surface. This approach appears to + * offer the best performance despite being a two-step process. + * + * When the source paint is a Color, we can simply use the GL_MODULATE + * function to multiply the current color (already premultiplied with the + * extra alpha value from the AlphaComposite) with the alpha value from + * the mask texture tile. In picture form, this process looks like: + * + * A R G B + * primary color Pa Pr Pg Pb (modulated with...) + * texture unit 0 Ca Ca Ca Ca + * --------------------------------------- + * resulting color Ra Rr Rg Rb + * + * where: + * Px = current color (already premultiplied by extra alpha) + * Cx = coverage value from mask tile + * Rx = resulting color/alpha component + * + * When the source paint is not a Color, it means that we are rendering with + * a complex paint (e.g. GradientPaint, TexturePaint). In this case, we + * rely on the GL_ARB_multitexture extension to effectively multiply the + * paint fragments (autogenerated on texture unit 1, see the + * MTLPaints_Set{Gradient,Texture,etc}Paint() methods for more details) + * with the coverage values from the mask texture tile (provided on texture + * unit 0), all of which is multiplied with the current color value (which + * contains the extra alpha value). In picture form: + * + * A R G B + * primary color Ea Ea Ea Ea (modulated with...) + * texture unit 0 Ca Ca Ca Ca (modulated with...) + * texture unit 1 Pa Pr Pg Pb + * --------------------------------------- + * resulting color Ra Rr Rg Rb + * + * where: + * Ea = extra alpha + * Cx = coverage value from mask tile + * Px = gradient/texture paint color (generated for each fragment) + * Rx = resulting color/alpha component + * + * Here are some descriptions of the many variables used in this method: + * x,y - upper left corner of the tile destination + * w,h - width/height of the mask tile + * x0 - placekeeper for the original destination x location + * tw,th - width/height of the actual texture tile in pixels + * sx1,sy1 - upper left corner of the mask tile source region + * sx2,sy2 - lower left corner of the mask tile source region + * sx,sy - "current" upper left corner of the mask tile region of interest + */ +void +MTLMaskFill_MaskFill(MTLContext *mtlc, BMTLSDOps * dstOps, + jint x, jint y, jint w, jint h, + jint maskoff, jint maskscan, jint masklen, + unsigned char *pMask) +{ + //TODO + J2dTraceNotImplPrimitive("MTLMaskFill_MaskFill"); + J2dTraceLn(J2D_TRACE_INFO, "MTLMaskFill_MaskFill"); +} + +JNIEXPORT void JNICALL +Java_sun_java2d_metal_MTLMaskFill_maskFill + (JNIEnv *env, jobject self, + jint x, jint y, jint w, jint h, + jint maskoff, jint maskscan, jint masklen, + jbyteArray maskArray) +{ + MTLContext *mtlc = MTLRenderQueue_GetCurrentContext(); + unsigned char *mask; + //TODO + J2dTraceNotImplPrimitive("MTLMaskFill_maskFill"); + J2dTraceLn(J2D_TRACE_ERROR, "MTLMaskFill_maskFill"); +} + +#endif /* !HEADLESS */ --- /dev/null 2019-05-16 19:17:02.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPaints.h 2019-05-16 19:17:02.000000000 +0300 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + */ + +#ifndef MTLPaints_h_Included +#define MTLPaints_h_Included + +#include "MTLContext.h" + +void MTLPaints_ResetPaint(MTLContext *mtlc); + +void MTLPaints_SetColor(MTLContext *mtlc, jint pixel); + + +void MTLPaints_SetLinearGradientPaint(MTLContext *mtlc, BMTLSDOps *dstOps, + jboolean useMask, jboolean linear, + jint cycleMethod, jint numStops, + jfloat p0, jfloat p1, jfloat p3, + void *fractions, void *pixels); + +void MTLPaints_SetRadialGradientPaint(MTLContext *mtlc, BMTLSDOps *dstOps, + jboolean useMask, jboolean linear, + jint cycleMethod, jint numStops, + jfloat m00, jfloat m01, jfloat m02, + jfloat m10, jfloat m11, jfloat m12, + jfloat focusX, + void *fractions, void *pixels); + +void MTLPaints_SetTexturePaint(MTLContext *mtlc, + jboolean useMask, + jlong pSrcOps, jboolean filter, + jdouble xp0, jdouble xp1, jdouble xp3, + jdouble yp0, jdouble yp1, jdouble yp3); + +#endif /* MTLPaints_h_Included */ --- /dev/null 2019-05-16 19:17:03.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPaints.m 2019-05-16 19:17:03.000000000 +0300 @@ -0,0 +1,462 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef HEADLESS + +#include +#include + +#include "sun_java2d_SunGraphics2D.h" +#include "sun_java2d_pipe_BufferedPaints.h" + +#include "MTLPaints.h" +#include "MTLContext.h" +#include "MTLRenderQueue.h" +#include "MTLSurfaceData.h" + +void +MTLPaints_ResetPaint(MTLContext *mtlc) +{ + //TODO + J2dTraceNotImplPrimitive("MTLPaints_ResetPaint"); + J2dTraceLn(J2D_TRACE_INFO, "MTLPaints_ResetPaint"); +} + +void +MTLPaints_SetColor(MTLContext *mtlc, jint pixel) +{ + mtlc.compState = sun_java2d_SunGraphics2D_PAINT_ALPHACOLOR; + //TODO + J2dTraceNotImplPrimitive("MTLPaints_SetColor"); + [mtlc setColorInt:pixel]; +} + +/************************* GradientPaint support ****************************/ + +static GLuint gradientTexID = 0; + +static void +MTLPaints_InitGradientTexture() +{ + //TODO + J2dTraceNotImplPrimitive("MTLPaints_InitGradientTexture"); + J2dTraceLn(J2D_TRACE_INFO, "MTLPaints_InitGradientTexture"); +} + + +/************************** TexturePaint support ****************************/ + +void +MTLPaints_SetTexturePaint(MTLContext *mtlc, + jboolean useMask, + jlong pSrcOps, jboolean filter, + jdouble xp0, jdouble xp1, jdouble xp3, + jdouble yp0, jdouble yp1, jdouble yp3) +{ + //TODO + J2dTraceNotImplPrimitive("MTLPaints_SetTexturePaint"); +} + +/****************** Shared MultipleGradientPaint support ********************/ + +/** + * These constants are identical to those defined in the + * MultipleGradientPaint.CycleMethod enum; they are copied here for + * convenience (ideally we would pull them directly from the Java level, + * but that entails more hassle than it is worth). + */ +#define CYCLE_NONE 0 +#define CYCLE_REFLECT 1 +#define CYCLE_REPEAT 2 + +/** + * The following constants are flags that can be bitwise-or'ed together + * to control how the MultipleGradientPaint shader source code is generated: + * + * MULTI_CYCLE_METHOD + * Placeholder for the CycleMethod enum constant. + * + * MULTI_LARGE + * If set, use the (slower) shader that supports a larger number of + * gradient colors; otherwise, use the optimized codepath. See + * the MAX_FRACTIONS_SMALL/LARGE constants below for more details. + * + * MULTI_USE_MASK + * If set, apply the alpha mask value from texture unit 0 to the + * final color result (only used in the MaskFill case). + * + * MULTI_LINEAR_RGB + * If set, convert the linear RGB result back into the sRGB color space. + */ +#define MULTI_CYCLE_METHOD (3 << 0) +#define MULTI_LARGE (1 << 2) +#define MULTI_USE_MASK (1 << 3) +#define MULTI_LINEAR_RGB (1 << 4) + +/** + * This value determines the size of the array of programs for each + * MultipleGradientPaint type. This value reflects the maximum value that + * can be represented by performing a bitwise-or of all the MULTI_* + * constants defined above. + */ +#define MAX_PROGRAMS 32 + +/** Evaluates to true if the given bit is set on the local flags variable. */ +#define IS_SET(flagbit) \ + (((flags) & (flagbit)) != 0) + +/** Composes the given parameters as flags into the given flags variable.*/ +#define COMPOSE_FLAGS(flags, cycleMethod, large, useMask, linear) \ + do { \ + flags |= ((cycleMethod) & MULTI_CYCLE_METHOD); \ + if (large) flags |= MULTI_LARGE; \ + if (useMask) flags |= MULTI_USE_MASK; \ + if (linear) flags |= MULTI_LINEAR_RGB; \ + } while (0) + +/** Extracts the CycleMethod enum value from the given flags variable. */ +#define EXTRACT_CYCLE_METHOD(flags) \ + ((flags) & MULTI_CYCLE_METHOD) + +/** + * The maximum number of gradient "stops" supported by the fragment shader + * and related code. When the MULTI_LARGE flag is set, we will use + * MAX_FRACTIONS_LARGE; otherwise, we use MAX_FRACTIONS_SMALL. By having + * two separate values, we can have one highly optimized shader (SMALL) that + * supports only a few fractions/colors, and then another, less optimal + * shader that supports more stops. + */ +#define MAX_FRACTIONS sun_java2d_pipe_BufferedPaints_MULTI_MAX_FRACTIONS +#define MAX_FRACTIONS_LARGE MAX_FRACTIONS +#define MAX_FRACTIONS_SMALL 4 + +/** + * The maximum number of gradient colors supported by all of the gradient + * fragment shaders. Note that this value must be a power of two, as it + * determines the size of the 1D texture created below. It also must be + * greater than or equal to MAX_FRACTIONS (there is no strict requirement + * that the two values be equal). + */ +#define MAX_COLORS 16 + +/** + * The handle to the gradient color table texture object used by the shaders. + */ +static jint multiGradientTexID = 0; + +/** + * This is essentially a template of the shader source code that can be used + * for either LinearGradientPaint or RadialGradientPaint. It includes the + * structure and some variables that are common to each; the remaining + * code snippets (for CycleMethod, ColorSpaceType, and mask modulation) + * are filled in prior to compiling the shader at runtime depending on the + * paint parameters. See MTLPaints_CreateMultiGradProgram() for more details. + */ +static const char *multiGradientShaderSource = + // gradient texture size (in texels) + "const int TEXTURE_SIZE = %d;" + // maximum number of fractions/colors supported by this shader + "const int MAX_FRACTIONS = %d;" + // size of a single texel + "const float FULL_TEXEL = (1.0 / float(TEXTURE_SIZE));" + // size of half of a single texel + "const float HALF_TEXEL = (FULL_TEXEL / 2.0);" + // texture containing the gradient colors + "uniform sampler1D colors;" + // array of gradient stops/fractions + "uniform float fractions[MAX_FRACTIONS];" + // array of scale factors (one for each interval) + "uniform float scaleFactors[MAX_FRACTIONS-1];" + // (placeholder for mask variable) + "%s" + // (placeholder for Linear/RadialGP-specific variables) + "%s" + "" + "void main(void)" + "{" + " float dist;" + // (placeholder for Linear/RadialGradientPaint-specific code) + " %s" + "" + " float tc;" + // (placeholder for CycleMethod-specific code) + " %s" + "" + // calculate interpolated color + " vec4 result = texture1D(colors, tc);" + "" + // (placeholder for ColorSpace conversion code) + " %s" + "" + // (placeholder for mask modulation code) + " %s" + "" + // modulate with gl_Color in order to apply extra alpha + " gl_FragColor = result * gl_Color;" + "}"; + +/** + * This code takes a "dist" value as input (as calculated earlier by the + * LGP/RGP-specific code) in the range [0,1] and produces a texture + * coordinate value "tc" that represents the position of the chosen color + * in the one-dimensional gradient texture (also in the range [0,1]). + * + * One naive way to implement this would be to iterate through the fractions + * to figure out in which interval "dist" falls, and then compute the + * relative distance between the two nearest stops. This approach would + * require an "if" check on every iteration, and it is best to avoid + * conditionals in fragment shaders for performance reasons. Also, one might + * be tempted to use a break statement to jump out of the loop once the + * interval was found, but break statements (and non-constant loop bounds) + * are not natively available on most graphics hardware today, so that is + * a non-starter. + * + * The more optimal approach used here avoids these issues entirely by using + * an accumulation function that is equivalent to the process described above. + * The scaleFactors array is pre-initialized at enable time as follows: + * scaleFactors[i] = 1.0 / (fractions[i+1] - fractions[i]); + * + * For each iteration, we subtract fractions[i] from dist and then multiply + * that value by scaleFactors[i]. If we are within the target interval, + * this value will be a fraction in the range [0,1] indicating the relative + * distance between fraction[i] and fraction[i+1]. If we are below the + * target interval, this value will be negative, so we clamp it to zero + * to avoid accumulating any value. If we are above the target interval, + * the value will be greater than one, so we clamp it to one. Upon exiting + * the loop, we will have accumulated zero or more 1.0's and a single + * fractional value. This accumulated value tells us the position of the + * fragment color in the one-dimensional gradient texture, i.e., the + * texcoord called "tc". + */ +static const char *texCoordCalcCode = + "int i;" + "float relFraction = 0.0;" + "for (i = 0; i < MAX_FRACTIONS-1; i++) {" + " relFraction +=" + " clamp((dist - fractions[i]) * scaleFactors[i], 0.0, 1.0);" + "}" + // we offset by half a texel so that we find the linearly interpolated + // color between the two texel centers of interest + "tc = HALF_TEXEL + (FULL_TEXEL * relFraction);"; + +/** Code for NO_CYCLE that gets plugged into the CycleMethod placeholder. */ +static const char *noCycleCode = + "if (dist <= 0.0) {" + " tc = 0.0;" + "} else if (dist >= 1.0) {" + " tc = 1.0;" + "} else {" + // (placeholder for texcoord calculation) + " %s" + "}"; + +/** Code for REFLECT that gets plugged into the CycleMethod placeholder. */ +static const char *reflectCode = + "dist = 1.0 - (abs(fract(dist * 0.5) - 0.5) * 2.0);" + // (placeholder for texcoord calculation) + "%s"; + +/** Code for REPEAT that gets plugged into the CycleMethod placeholder. */ +static const char *repeatCode = + "dist = fract(dist);" + // (placeholder for texcoord calculation) + "%s"; + +static void +MTLPaints_InitMultiGradientTexture() +{ + //TODO + J2dTraceNotImplPrimitive("MTLPaints_InitMultiGradientTexture"); +} + +/** + * Compiles and links the MultipleGradientPaint shader program. If + * successful, this function returns a handle to the newly created + * shader program; otherwise returns 0. + */ +static GLhandleARB +MTLPaints_CreateMultiGradProgram(jint flags, + char *paintVars, char *distCode) +{ + + //TODO + J2dTraceNotImplPrimitive("MTLPaints_CreateMultiGradProgram"); + return NULL; +} + +/** + * Called from the MTLPaints_SetLinear/RadialGradientPaint() methods + * in order to setup the fraction/color values that are common to both. + */ +static void +MTLPaints_SetMultiGradientPaint(GLhandleARB multiGradProgram, + jint numStops, + void *pFractions, void *pPixels) +{ + //TODO + J2dTraceNotImplPrimitive("MTLPaints_SetMultiGradientPaint"); + +} + +/********************** LinearGradientPaint support *************************/ + +/** + * The handles to the LinearGradientPaint fragment program objects. The + * index to the array should be a bitwise-or'ing of the MULTI_* flags defined + * above. Note that most applications will likely need to initialize one + * or two of these elements, so the array is usually sparsely populated. + */ +static GLhandleARB linearGradPrograms[MAX_PROGRAMS]; + +/** + * Compiles and links the LinearGradientPaint shader program. If successful, + * this function returns a handle to the newly created shader program; + * otherwise returns 0. + */ +static GLhandleARB +MTLPaints_CreateLinearGradProgram(jint flags) +{ + char *paintVars; + char *distCode; + + J2dTraceLn1(J2D_TRACE_INFO, + "MTLPaints_CreateLinearGradProgram", + flags); + + /* + * To simplify the code and to make it easier to upload a number of + * uniform values at once, we pack a bunch of scalar (float) values + * into vec3 values below. Here's how the values are related: + * + * params.x = p0 + * params.y = p1 + * params.z = p3 + * + * yoff = dstOps->yOffset + dstOps->height + */ + paintVars = + "uniform vec3 params;" + "uniform float yoff;"; + distCode = + // note that gl_FragCoord is in window space relative to the + // lower-left corner, so we have to flip the y-coordinate here + "vec3 fragCoord = vec3(gl_FragCoord.x, yoff-gl_FragCoord.y, 1.0);" + "dist = dot(params, fragCoord);"; + + return MTLPaints_CreateMultiGradProgram(flags, paintVars, distCode); +} + +void +MTLPaints_SetLinearGradientPaint(MTLContext *mtlc, BMTLSDOps *dstOps, + jboolean useMask, jboolean linear, + jint cycleMethod, jint numStops, + jfloat p0, jfloat p1, jfloat p3, + void *fractions, void *pixels) +{ + //TODO + J2dTraceNotImplPrimitive("MTLPaints_SetMultiGradientPaint"); +} + +/********************** RadialGradientPaint support *************************/ + +/** + * The handles to the RadialGradientPaint fragment program objects. The + * index to the array should be a bitwise-or'ing of the MULTI_* flags defined + * above. Note that most applications will likely need to initialize one + * or two of these elements, so the array is usually sparsely populated. + */ +static GLhandleARB radialGradPrograms[MAX_PROGRAMS]; + +/** + * Compiles and links the RadialGradientPaint shader program. If successful, + * this function returns a handle to the newly created shader program; + * otherwise returns 0. + */ +static GLhandleARB +MTLPaints_CreateRadialGradProgram(jint flags) +{ + char *paintVars; + char *distCode; + + J2dTraceLn1(J2D_TRACE_INFO, + "MTLPaints_CreateRadialGradProgram", + flags); + + /* + * To simplify the code and to make it easier to upload a number of + * uniform values at once, we pack a bunch of scalar (float) values + * into vec3 and vec4 values below. Here's how the values are related: + * + * m0.x = m00 + * m0.y = m01 + * m0.z = m02 + * + * m1.x = m10 + * m1.y = m11 + * m1.z = m12 + * + * precalc.x = focusX + * precalc.y = yoff = dstOps->yOffset + dstOps->height + * precalc.z = 1.0 - (focusX * focusX) + * precalc.w = 1.0 / precalc.z + */ + paintVars = + "uniform vec3 m0;" + "uniform vec3 m1;" + "uniform vec4 precalc;"; + + /* + * The following code is derived from Daniel Rice's whitepaper on + * radial gradient performance (attached to the bug report for 6521533). + * Refer to that document as well as the setup code in the Java-level + * BufferedPaints.setRadialGradientPaint() method for more details. + */ + distCode = + // note that gl_FragCoord is in window space relative to the + // lower-left corner, so we have to flip the y-coordinate here + "vec3 fragCoord =" + " vec3(gl_FragCoord.x, precalc.y - gl_FragCoord.y, 1.0);" + "float x = dot(fragCoord, m0);" + "float y = dot(fragCoord, m1);" + "float xfx = x - precalc.x;" + "dist = (precalc.x*xfx + sqrt(xfx*xfx + y*y*precalc.z))*precalc.w;"; + + return MTLPaints_CreateMultiGradProgram(flags, paintVars, distCode); +} + +void +MTLPaints_SetRadialGradientPaint(MTLContext *mtlc, BMTLSDOps *dstOps, + jboolean useMask, jboolean linear, + jint cycleMethod, jint numStops, + jfloat m00, jfloat m01, jfloat m02, + jfloat m10, jfloat m11, jfloat m12, + jfloat focusX, + void *fractions, void *pixels) +{ + //TODO + J2dTraceNotImplPrimitive("MTLPaints_SetRadialGradientPaint"); +} + +#endif /* !HEADLESS */ --- /dev/null 2019-05-16 19:17:05.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPipelineStatesStorage.h 2019-05-16 19:17:04.000000000 +0300 @@ -0,0 +1,31 @@ +#ifndef MTLPipelineStatesStorage_h_Included +#define MTLPipelineStatesStorage_h_Included + +#import + +@interface MTLPipelineStatesStorage : NSObject { +@private + +id device; +id library; +NSMutableDictionary> * shaders; +NSMutableDictionary> * states; +MTLRenderPipelineDescriptor * templateRenderPipelineDesc; +MTLRenderPipelineDescriptor * templateTexturePipelineDesc; +} + +@property (readwrite, assign) id device; +@property (readwrite, retain) id library; +@property (readwrite, retain) NSMutableDictionary> * shaders; +@property (readwrite, retain) NSMutableDictionary> * states; +@property (readwrite, retain) MTLRenderPipelineDescriptor * templateRenderPipelineDesc; +@property (readwrite, retain) MTLRenderPipelineDescriptor * templateTexturePipelineDesc; + +- (id) initWithDevice:(id)device shaderLibPath:(NSString *)shadersLib; +- (id) getRenderPipelineState:(bool)isGradient; +- (id) getTexturePipelineState:(bool)isSourcePremultiplied compositeRule:(int)compositeRule; +- (id) getShader:(NSString *)name; +@end + + +#endif // MTLPipelineStatesStorage_h_Included \ No newline at end of file --- /dev/null 2019-05-16 19:17:06.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLPipelineStatesStorage.m 2019-05-16 19:17:05.000000000 +0300 @@ -0,0 +1,147 @@ +#import "MTLPipelineStatesStorage.h" +#import "Trace.h" + +#include "GraphicsPrimitiveMgr.h" +#import "common.h" + +@implementation MTLPipelineStatesStorage + +@synthesize device; +@synthesize library; +@synthesize shaders; +@synthesize states; +@synthesize templateRenderPipelineDesc; +@synthesize templateTexturePipelineDesc; + +- (id) initWithDevice:(id)dev shaderLibPath:(NSString *)shadersLib { + self = [super init]; + if (self == nil) return self; + + self.device = dev; + + NSError *error = nil; + self.library = [dev newLibraryWithFile:shadersLib error:&error]; + if (!self.library) { + NSLog(@"Failed to load library. error %@", error); + exit(0); + } + self.shaders = [NSMutableDictionary dictionaryWithCapacity:10]; + self.states = [NSMutableDictionary dictionaryWithCapacity:10]; + + { // init template descriptors + MTLVertexDescriptor *vertDesc = [[MTLVertexDescriptor new] autorelease]; + vertDesc.attributes[VertexAttributePosition].format = MTLVertexFormatFloat3; + vertDesc.attributes[VertexAttributePosition].offset = 0; + vertDesc.attributes[VertexAttributePosition].bufferIndex = MeshVertexBuffer; + vertDesc.layouts[MeshVertexBuffer].stride = sizeof(struct Vertex); + vertDesc.layouts[MeshVertexBuffer].stepRate = 1; + vertDesc.layouts[MeshVertexBuffer].stepFunction = MTLVertexStepFunctionPerVertex; + + self.templateRenderPipelineDesc = [[MTLRenderPipelineDescriptor new] autorelease]; + self.templateRenderPipelineDesc.sampleCount = 1; + self.templateRenderPipelineDesc.vertexDescriptor = vertDesc; + self.templateRenderPipelineDesc.colorAttachments[0].pixelFormat = MTLPixelFormatBGRA8Unorm; + self.templateRenderPipelineDesc.label = @"template_render"; + + self.templateTexturePipelineDesc = [[self.templateRenderPipelineDesc copy] autorelease]; + self.templateTexturePipelineDesc.vertexDescriptor.attributes[VertexAttributeTexPos].format = MTLVertexFormatFloat2; + self.templateTexturePipelineDesc.vertexDescriptor.attributes[VertexAttributeTexPos].offset = 3*sizeof(float); + self.templateTexturePipelineDesc.vertexDescriptor.attributes[VertexAttributeTexPos].bufferIndex = MeshVertexBuffer; + self.templateTexturePipelineDesc.vertexDescriptor.layouts[MeshVertexBuffer].stride = sizeof(struct TxtVertex); + self.templateTexturePipelineDesc.vertexDescriptor.layouts[MeshVertexBuffer].stepRate = 1; + self.templateTexturePipelineDesc.vertexDescriptor.layouts[MeshVertexBuffer].stepFunction = MTLVertexStepFunctionPerVertex; + self.templateTexturePipelineDesc.label = @"template_texture"; + } + + { // pre-create main states + [self getRenderPipelineState:YES]; + [self getRenderPipelineState:NO]; + [self getTexturePipelineState:NO compositeRule:RULE_Src]; + [self getTexturePipelineState:NO compositeRule:RULE_SrcOver]; + } + + return self; +} + +- (id) getRenderPipelineState:(bool)isGradient { + NSString * uid = [NSString stringWithFormat:@"render_grad[%d]", isGradient]; + + id result = [self.states valueForKey:uid]; + if (result == nil) { + id vertexShader = isGradient ? [self getShader:@"vert_grad"] : [self getShader:@"vert_col"]; + id fragmentShader = isGradient ? [self getShader:@"frag_grad"] : [self getShader:@"frag_col"]; + MTLRenderPipelineDescriptor *pipelineDesc = [[self.templateRenderPipelineDesc copy] autorelease]; + pipelineDesc.vertexFunction = vertexShader; + pipelineDesc.fragmentFunction = fragmentShader; + pipelineDesc.label = uid; + + NSError *error = nil; + result = [self.device newRenderPipelineStateWithDescriptor:pipelineDesc error:&error]; + if (result == nil) { + NSLog(@"Failed to create render pipeline state '%@', error %@", uid, error); + exit(0); + } + + [self.states setValue:result forKey:uid]; + } + + return result; +}; + +- (id) getTexturePipelineState:(bool)isSourcePremultiplied compositeRule:(int)compositeRule { + NSString * uid = [NSString stringWithFormat:@"texture_compositeRule[%d]", compositeRule]; + + id result = [self.states valueForKey:uid]; + if (result == nil) { + id vertexShader = [self getShader:@"vert_txt"]; + id fragmentShader = [self getShader:@"frag_txt"]; + MTLRenderPipelineDescriptor *pipelineDesc = [[self.templateTexturePipelineDesc copy] autorelease]; + pipelineDesc.vertexFunction = vertexShader; + pipelineDesc.fragmentFunction = fragmentShader; + + if (compositeRule != RULE_Src) { + pipelineDesc.colorAttachments[0].blendingEnabled = YES; + + if (!isSourcePremultiplied) + pipelineDesc.colorAttachments[0].sourceRGBBlendFactor = MTLBlendFactorSourceAlpha; + + //RGB = Source.rgb * SBF + Dest.rgb * DBF + //A = Source.a * SBF + Dest.a * DBF + // + //default SRC: + //DBF=0 + //SBF=1 + if (compositeRule == RULE_SrcOver) { + // SRC_OVER (Porter-Duff Source Over Destination rule): + // Ar = As + Ad*(1-As) + // Cr = Cs + Cd*(1-As) + pipelineDesc.colorAttachments[0].destinationAlphaBlendFactor = MTLBlendFactorOneMinusSourceAlpha; + pipelineDesc.colorAttachments[0].destinationRGBBlendFactor = MTLBlendFactorOneMinusSourceAlpha; + } else { + J2dTrace1(J2D_TRACE_ERROR, "Unimplemented composite rule %d (will be used Src)", compositeRule); + pipelineDesc.colorAttachments[0].blendingEnabled = NO; + } + } + + NSError *error = nil; + result = [self.device newRenderPipelineStateWithDescriptor:pipelineDesc error:&error]; + if (result == nil) { + NSLog(@"Failed to create texture pipeline state '%@', error %@", uid, error); + exit(0); + } + + [self.states setValue:result forKey:uid]; + } + + return result; +} + +- (id) getShader:(NSString *)name { + id result = [self.shaders valueForKey:name]; + if (result == nil) { + result = [[self.library newFunctionWithName:name] autorelease]; + [self.shaders setValue:result forKey:name]; + } + return result; +} +@end \ No newline at end of file --- /dev/null 2019-05-16 19:17:07.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderQueue.h 2019-05-16 19:17:07.000000000 +0300 @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef MTLRenderQueue_h_Included +#define MTLRenderQueue_h_Included + +#include "MTLContext.h" +#include "MTLSurfaceData.h" + +/* + * The following macros are used to pick values (of the specified type) off + * the queue. + */ +#define NEXT_VAL(buf, type) (((type *)((buf) += sizeof(type)))[-1]) +#define NEXT_BYTE(buf) NEXT_VAL(buf, unsigned char) +#define NEXT_INT(buf) NEXT_VAL(buf, jint) +#define NEXT_FLOAT(buf) NEXT_VAL(buf, jfloat) +#define NEXT_BOOLEAN(buf) (jboolean)NEXT_INT(buf) +#define NEXT_LONG(buf) NEXT_VAL(buf, jlong) +#define NEXT_DOUBLE(buf) NEXT_VAL(buf, jdouble) + +/* + * Increments a pointer (buf) by the given number of bytes. + */ +#define SKIP_BYTES(buf, numbytes) buf += (numbytes) + +/* + * Extracts a value at the given offset from the provided packed value. + */ +#define EXTRACT_VAL(packedval, offset, mask) \ + (((packedval) >> (offset)) & (mask)) +#define EXTRACT_BYTE(packedval, offset) \ + (unsigned char)EXTRACT_VAL(packedval, offset, 0xff) +#define EXTRACT_BOOLEAN(packedval, offset) \ + (jboolean)EXTRACT_VAL(packedval, offset, 0x1) + +/* + * Parameter used by the RESET_PREVIOUS_OP() convenience macro, which + * indicates that any "open" state (such as an unmatched glBegin() or + * glEnable(GL_TEXTURE_2D)) should be completed before the following operation + * is performed. SET_SURFACES is an example of an operation that needs to + * call RESET_PREVIOUS_OP() before completing the surface change operation. + */ +#define MTL_STATE_RESET -1 + +/* + * Parameter passed to the CHECK_PREVIOUS_OP() macro to indicate that the + * following operation represents a "simple" state change. A simple state + * change is one that is allowed to occur within a series of texturing + * operations; in other words, this type of state change can occur without + * first calling glDisable(GL_TEXTURE_2D). An example of such an operation + * is SET_RECT_CLIP. + */ +#define MTL_STATE_CHANGE -2 + +/* + * Parameter passed to the CHECK_PREVIOUS_OP() macro to indicate that the + * following operation represents an operation that uses an alpha mask, + * such as MTLMaskFill and MTLTR_DrawGrayscaleGlyphNoCache(). + */ +#define MTL_STATE_MASK_OP -3 + +/* + * Parameter passed to the CHECK_PREVIOUS_OP() macro to indicate that the + * following operation represents an operation that uses the glyph cache, + * such as MTLTR_DrawGrayscaleGlyphViaCache(). + */ +#define MTL_STATE_GLYPH_OP -4 + +/* + * Parameter passed to the CHECK_PREVIOUS_OP() macro to indicate that the + * following operation represents an operation that renders a + * parallelogram via a fragment program (see MTLRenderer). + */ +#define MTL_STATE_PGRAM_OP -5 + +/* + * Initializes the "previous operation" state to its default value. + */ +#define INIT_PREVIOUS_OP() previousOp = MTL_STATE_RESET + +/* + * These macros now simply delegate to the CheckPreviousOp() method. + */ +#define CHECK_PREVIOUS_OP(op) MTLRenderQueue_CheckPreviousOp(op) +#define RESET_PREVIOUS_OP() CHECK_PREVIOUS_OP(MTL_STATE_RESET) + +/* + * The following macros allow the caller to return (or continue) if the + * provided value is NULL. (The strange else clause is included below to + * allow for a trailing ';' after RETURN/CONTINUE_IF_NULL() invocations.) + */ +#define ACT_IF_NULL(ACTION, value) \ + if ((value) == NULL) { \ + J2dTraceLn1(J2D_TRACE_ERROR, \ + "%s is null", #value); \ + ACTION; \ + } else do { } while (0) +#define RETURN_IF_NULL(value) ACT_IF_NULL(return, value) +#define CONTINUE_IF_NULL(value) ACT_IF_NULL(continue, value) + +/* + * Exports. + */ +extern jint previousOp; + +MTLContext *MTLRenderQueue_GetCurrentContext(); +BMTLSDOps *MTLRenderQueue_GetCurrentDestination(); +void MTLRenderQueue_CheckPreviousOp(jint op); +void MTLTR_DisableGlyphModeState(); + +#endif /* MTLRenderQueue_h_Included */ --- /dev/null 2019-05-16 19:17:08.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderQueue.m 2019-05-16 19:17:08.000000000 +0300 @@ -0,0 +1,850 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef HEADLESS + +#include + +#include "sun_java2d_pipe_BufferedOpCodes.h" + +#include "jlong.h" +#include "MTLBlitLoops.h" +#include "MTLBufImgOps.h" +#include "MTLMaskBlit.h" +#include "MTLMaskFill.h" +#include "MTLPaints.h" +#include "MTLRenderQueue.h" +#include "MTLRenderer.h" +#include "MTLTextRenderer.h" + +/** + * Used to track whether we are in a series of a simple primitive operations + * or texturing operations. This variable should be controlled only via + * the INIT/CHECK/RESET_PREVIOUS_OP() macros. See the + * MTLRenderQueue_CheckPreviousOp() method below for more information. + */ +jint previousOp; + +/** + * References to the "current" context and destination surface. + */ +static MTLContext *mtlc = NULL; +static BMTLSDOps *dstOps = NULL; + +/** + * The following methods are implemented in the windowing system (i.e. GLX + * and WGL) source files. + */ +extern void MTLGC_DestroyMTLGraphicsConfig(jlong pConfigInfo); +extern void MTLSD_SwapBuffers(JNIEnv *env, jlong window); + +/** + * Helper methods to manage modified layers + */ +static MTLLayer ** g_modifiedLayers = NULL; +static int g_modifiedLayersCount = 0; +static int g_modifiedLayersAllocatedCount = 0; + +static void markLayerModified(MTLLayer * modifiedLayer) { + if (modifiedLayer == NULL) + return; + if (g_modifiedLayers == NULL) { + g_modifiedLayersAllocatedCount = 3; + g_modifiedLayers = malloc(g_modifiedLayersAllocatedCount * sizeof(MTLLayer *)); + } + for (int c = 0; c < g_modifiedLayersCount; ++c) { + if (g_modifiedLayers[c] == modifiedLayer) + return; + } + ++g_modifiedLayersCount; + if (g_modifiedLayersCount > g_modifiedLayersAllocatedCount) { + g_modifiedLayersAllocatedCount = g_modifiedLayersCount; + g_modifiedLayers = realloc(g_modifiedLayers, g_modifiedLayersAllocatedCount * sizeof(MTLLayer *)); + } + g_modifiedLayers[g_modifiedLayersCount - 1] = modifiedLayer; +} + +static void scheduleBlitAllModifiedLayers() { + for (int c = 0; c < g_modifiedLayersCount; ++c) { + MTLLayer * layer = g_modifiedLayers[c]; + MTLContext * ctx = layer.ctx; + if (layer == NULL || ctx == NULL) + continue; + id bufferToCommit = ctx.commandBuffer; + [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ + [layer blitTexture:bufferToCommit]; + }]; + + [ctx releaseCommandBuffer]; + } + g_modifiedLayersCount = 0; +} + +static void onSurfaceModified(BMTLSDOps *bmtldst) { + if (bmtldst != NULL && bmtldst->privOps != NULL && ((MTLSDOps *)bmtldst->privOps)->layer != NULL) + markLayerModified(((MTLSDOps *) bmtldst->privOps)->layer); +} + +static const jint g_drawOpcodes[] = { + sun_java2d_pipe_BufferedOpCodes_DRAW_LINE, + sun_java2d_pipe_BufferedOpCodes_DRAW_RECT, + sun_java2d_pipe_BufferedOpCodes_DRAW_POLY, + sun_java2d_pipe_BufferedOpCodes_DRAW_PIXEL, + sun_java2d_pipe_BufferedOpCodes_DRAW_SCANLINES, + sun_java2d_pipe_BufferedOpCodes_DRAW_PARALLELOGRAM, + sun_java2d_pipe_BufferedOpCodes_DRAW_AAPARALLELOGRAM, + + sun_java2d_pipe_BufferedOpCodes_DRAW_GLYPH_LIST, + + sun_java2d_pipe_BufferedOpCodes_FILL_RECT, + sun_java2d_pipe_BufferedOpCodes_FILL_SPANS, + sun_java2d_pipe_BufferedOpCodes_FILL_PARALLELOGRAM, + sun_java2d_pipe_BufferedOpCodes_FILL_AAPARALLELOGRAM, + + sun_java2d_pipe_BufferedOpCodes_COPY_AREA, + sun_java2d_pipe_BufferedOpCodes_MASK_FILL, + sun_java2d_pipe_BufferedOpCodes_MASK_BLIT, + sun_java2d_pipe_BufferedOpCodes_SET_SHAPE_CLIP_SPANS +}; + +static jboolean isDrawOpcode(jint opcode) { + for (int c = 0; c < sizeof(g_drawOpcodes)/sizeof(g_drawOpcodes[0]); ++c) { + if (opcode == g_drawOpcodes[c]) + return JNI_TRUE; + } + return JNI_FALSE; +} + +JNIEXPORT void JNICALL +Java_sun_java2d_metal_MTLRenderQueue_flushBuffer + (JNIEnv *env, jobject mtlrq, + jlong buf, jint limit) +{ + jboolean sync = JNI_FALSE; + unsigned char *b, *end; + + J2dTraceLn1(J2D_TRACE_INFO, + "MTLRenderQueue_flushBuffer: limit=%d", limit); + + b = (unsigned char *)jlong_to_ptr(buf); + if (b == NULL) { + J2dRlsTraceLn(J2D_TRACE_ERROR, + "MTLRenderQueue_flushBuffer: cannot get direct buffer address"); + return; + } + + INIT_PREVIOUS_OP(); + end = b + limit; + + while (b < end) { + jint opcode = NEXT_INT(b); + + J2dTraceLn2(J2D_TRACE_VERBOSE, + "MTLRenderQueue_flushBuffer: opcode=%d, rem=%d", + opcode, (end-b)); + + if (opcode != sun_java2d_pipe_BufferedOpCodes_DRAW_GLYPH_LIST && + opcode != sun_java2d_pipe_BufferedOpCodes_NOOP) + { + //MTLTR_DisableGlyphModeState(); + } + + switch (opcode) { + + // draw ops + case sun_java2d_pipe_BufferedOpCodes_DRAW_LINE: + { + J2dTraceLn(J2D_TRACE_VERBOSE, "sun_java2d_pipe_BufferedOpCodes_DRAW_LINE"); + jint x1 = NEXT_INT(b); + jint y1 = NEXT_INT(b); + jint x2 = NEXT_INT(b); + jint y2 = NEXT_INT(b); + MTLRenderer_DrawLine(mtlc, dstOps, x1, y1, x2, y2); + } + break; + case sun_java2d_pipe_BufferedOpCodes_DRAW_RECT: + { + jint x = NEXT_INT(b); + jint y = NEXT_INT(b); + jint w = NEXT_INT(b); + jint h = NEXT_INT(b); + MTLRenderer_DrawRect(mtlc, dstOps, x, y, w, h); + } + break; + case sun_java2d_pipe_BufferedOpCodes_DRAW_POLY: + { + jint nPoints = NEXT_INT(b); + jboolean isClosed = NEXT_BOOLEAN(b); + jint transX = NEXT_INT(b); + jint transY = NEXT_INT(b); + jint *xPoints = (jint *)b; + jint *yPoints = ((jint *)b) + nPoints; + MTLRenderer_DrawPoly(mtlc, dstOps, nPoints, isClosed, transX, transY, xPoints, yPoints); + SKIP_BYTES(b, nPoints * BYTES_PER_POLY_POINT); + } + break; + case sun_java2d_pipe_BufferedOpCodes_DRAW_PIXEL: + { + jint x = NEXT_INT(b); + jint y = NEXT_INT(b); + CONTINUE_IF_NULL(mtlc); + //TODO + J2dTraceNotImplPrimitive("MTLRenderQueue_DRAW_PIXEL"); + } + break; + case sun_java2d_pipe_BufferedOpCodes_DRAW_SCANLINES: + { + jint count = NEXT_INT(b); + MTLRenderer_DrawScanlines(mtlc, dstOps, count, (jint *)b); + + SKIP_BYTES(b, count * BYTES_PER_SCANLINE); + } + break; + case sun_java2d_pipe_BufferedOpCodes_DRAW_PARALLELOGRAM: + { + jfloat x11 = NEXT_FLOAT(b); + jfloat y11 = NEXT_FLOAT(b); + jfloat dx21 = NEXT_FLOAT(b); + jfloat dy21 = NEXT_FLOAT(b); + jfloat dx12 = NEXT_FLOAT(b); + jfloat dy12 = NEXT_FLOAT(b); + jfloat lwr21 = NEXT_FLOAT(b); + jfloat lwr12 = NEXT_FLOAT(b); + + MTLRenderer_DrawParallelogram(mtlc, dstOps, + x11, y11, + dx21, dy21, + dx12, dy12, + lwr21, lwr12); + } + break; + case sun_java2d_pipe_BufferedOpCodes_DRAW_AAPARALLELOGRAM: + { + jfloat x11 = NEXT_FLOAT(b); + jfloat y11 = NEXT_FLOAT(b); + jfloat dx21 = NEXT_FLOAT(b); + jfloat dy21 = NEXT_FLOAT(b); + jfloat dx12 = NEXT_FLOAT(b); + jfloat dy12 = NEXT_FLOAT(b); + jfloat lwr21 = NEXT_FLOAT(b); + jfloat lwr12 = NEXT_FLOAT(b); + + MTLRenderer_DrawAAParallelogram(mtlc, dstOps, + x11, y11, + dx21, dy21, + dx12, dy12, + lwr21, lwr12); + } + break; + + // fill ops + case sun_java2d_pipe_BufferedOpCodes_FILL_RECT: + { + jint x = NEXT_INT(b); + jint y = NEXT_INT(b); + jint w = NEXT_INT(b); + jint h = NEXT_INT(b); + MTLRenderer_FillRect(mtlc, dstOps, x, y, w, h); + } + break; + case sun_java2d_pipe_BufferedOpCodes_FILL_SPANS: + { + jint count = NEXT_INT(b); + MTLRenderer_FillSpans(mtlc, dstOps, count, (jint *)b); + SKIP_BYTES(b, count * BYTES_PER_SPAN); + } + break; + case sun_java2d_pipe_BufferedOpCodes_FILL_PARALLELOGRAM: + { + jfloat x11 = NEXT_FLOAT(b); + jfloat y11 = NEXT_FLOAT(b); + jfloat dx21 = NEXT_FLOAT(b); + jfloat dy21 = NEXT_FLOAT(b); + jfloat dx12 = NEXT_FLOAT(b); + jfloat dy12 = NEXT_FLOAT(b); + MTLRenderer_FillParallelogram(mtlc, dstOps, + x11, y11, + dx21, dy21, + dx12, dy12); + } + break; + case sun_java2d_pipe_BufferedOpCodes_FILL_AAPARALLELOGRAM: + { + jfloat x11 = NEXT_FLOAT(b); + jfloat y11 = NEXT_FLOAT(b); + jfloat dx21 = NEXT_FLOAT(b); + jfloat dy21 = NEXT_FLOAT(b); + jfloat dx12 = NEXT_FLOAT(b); + jfloat dy12 = NEXT_FLOAT(b); + MTLRenderer_FillAAParallelogram(mtlc, dstOps, + x11, y11, + dx21, dy21, + dx12, dy12); + } + break; + + // text-related ops + case sun_java2d_pipe_BufferedOpCodes_DRAW_GLYPH_LIST: + { + jint numGlyphs = NEXT_INT(b); + jint packedParams = NEXT_INT(b); + jfloat glyphListOrigX = NEXT_FLOAT(b); + jfloat glyphListOrigY = NEXT_FLOAT(b); + jboolean usePositions = EXTRACT_BOOLEAN(packedParams, + OFFSET_POSITIONS); + jboolean subPixPos = EXTRACT_BOOLEAN(packedParams, + OFFSET_SUBPIXPOS); + jboolean rgbOrder = EXTRACT_BOOLEAN(packedParams, + OFFSET_RGBORDER); + jint lcdContrast = EXTRACT_BYTE(packedParams, + OFFSET_CONTRAST); + unsigned char *images = b; + unsigned char *positions; + jint bytesPerGlyph; + if (usePositions) { + positions = (b + numGlyphs * BYTES_PER_GLYPH_IMAGE); + bytesPerGlyph = BYTES_PER_POSITIONED_GLYPH; + } else { + positions = NULL; + bytesPerGlyph = BYTES_PER_GLYPH_IMAGE; + } + MTLTR_DrawGlyphList(env, mtlc, dstOps, + numGlyphs, usePositions, + subPixPos, rgbOrder, lcdContrast, + glyphListOrigX, glyphListOrigY, + images, positions); + SKIP_BYTES(b, numGlyphs * bytesPerGlyph); + } + break; + + // copy-related ops + case sun_java2d_pipe_BufferedOpCodes_COPY_AREA: + { + jint x = NEXT_INT(b); + jint y = NEXT_INT(b); + jint w = NEXT_INT(b); + jint h = NEXT_INT(b); + jint dx = NEXT_INT(b); + jint dy = NEXT_INT(b); + MTLBlitLoops_CopyArea(env, mtlc, dstOps, + x, y, w, h, dx, dy); + } + break; + case sun_java2d_pipe_BufferedOpCodes_BLIT: + { + J2dTracePrimitive("MTLRenderQueue_BLIT"); + + jint packedParams = NEXT_INT(b); + jint sx1 = NEXT_INT(b); + jint sy1 = NEXT_INT(b); + jint sx2 = NEXT_INT(b); + jint sy2 = NEXT_INT(b); + jdouble dx1 = NEXT_DOUBLE(b); + jdouble dy1 = NEXT_DOUBLE(b); + jdouble dx2 = NEXT_DOUBLE(b); + jdouble dy2 = NEXT_DOUBLE(b); + jlong pSrc = NEXT_LONG(b); + jlong pDst = NEXT_LONG(b); + jint hint = EXTRACT_BYTE(packedParams, OFFSET_HINT); + jboolean texture = EXTRACT_BOOLEAN(packedParams, + OFFSET_TEXTURE); + jboolean rtt = EXTRACT_BOOLEAN(packedParams, + OFFSET_RTT); + jboolean xform = EXTRACT_BOOLEAN(packedParams, + OFFSET_XFORM); + jboolean isoblit = EXTRACT_BOOLEAN(packedParams, + OFFSET_ISOBLIT); + if (isoblit) { + MTLBlitLoops_IsoBlit(env, mtlc, pSrc, pDst, + xform, hint, texture, rtt, + sx1, sy1, sx2, sy2, + dx1, dy1, dx2, dy2); + } else { + jint srctype = EXTRACT_BYTE(packedParams, OFFSET_SRCTYPE); + MTLBlitLoops_Blit(env, mtlc, pSrc, pDst, + xform, hint, srctype, texture, + sx1, sy1, sx2, sy2, + dx1, dy1, dx2, dy2); + } + onSurfaceModified(jlong_to_ptr(pDst)); + } + break; + case sun_java2d_pipe_BufferedOpCodes_SURFACE_TO_SW_BLIT: + { + J2dTracePrimitive("MTLRenderQueue_SURFACE_TO_SW_BLIT"); + + jint sx = NEXT_INT(b); + jint sy = NEXT_INT(b); + jint dx = NEXT_INT(b); + jint dy = NEXT_INT(b); + jint w = NEXT_INT(b); + jint h = NEXT_INT(b); + jint dsttype = NEXT_INT(b); + jlong pSrc = NEXT_LONG(b); + jlong pDst = NEXT_LONG(b); + MTLBlitLoops_SurfaceToSwBlit(env, mtlc, + pSrc, pDst, dsttype, + sx, sy, dx, dy, w, h); + } + break; + case sun_java2d_pipe_BufferedOpCodes_MASK_FILL: + { + J2dTracePrimitive("MTLRenderQueue_MASK_FILL"); + + jint x = NEXT_INT(b); + jint y = NEXT_INT(b); + jint w = NEXT_INT(b); + jint h = NEXT_INT(b); + jint maskoff = NEXT_INT(b); + jint maskscan = NEXT_INT(b); + jint masklen = NEXT_INT(b); + unsigned char *pMask = (masklen > 0) ? b : NULL; + MTLMaskFill_MaskFill(mtlc, dstOps, x, y, w, h, + maskoff, maskscan, masklen, pMask); + SKIP_BYTES(b, masklen); + } + break; + case sun_java2d_pipe_BufferedOpCodes_MASK_BLIT: + { + J2dTracePrimitive("MTLRenderQueue_MASK_BLIT"); + + jint dstx = NEXT_INT(b); + jint dsty = NEXT_INT(b); + jint width = NEXT_INT(b); + jint height = NEXT_INT(b); + jint masklen = width * height * sizeof(jint); + MTLMaskBlit_MaskBlit(env, mtlc, dstOps, + dstx, dsty, width, height, b); + SKIP_BYTES(b, masklen); + } + break; + + // state-related ops + case sun_java2d_pipe_BufferedOpCodes_SET_RECT_CLIP: + { + jint x1 = NEXT_INT(b); + jint y1 = NEXT_INT(b); + jint x2 = NEXT_INT(b); + jint y2 = NEXT_INT(b); + [mtlc setClipRectX1:x1 Y1:y1 X2:x2 Y2:y2]; + } + break; + case sun_java2d_pipe_BufferedOpCodes_BEGIN_SHAPE_CLIP: + { + [mtlc beginShapeClip]; + } + break; + case sun_java2d_pipe_BufferedOpCodes_SET_SHAPE_CLIP_SPANS: + { + jint count = NEXT_INT(b); + MTLRenderer_FillSpans(mtlc, dstOps, count, (jint *)b); + SKIP_BYTES(b, count * BYTES_PER_SPAN); + } + break; + case sun_java2d_pipe_BufferedOpCodes_END_SHAPE_CLIP: + { + //TODO + [mtlc endShapeClipDstOps:dstOps]; + } + break; + case sun_java2d_pipe_BufferedOpCodes_RESET_CLIP: + { + [mtlc resetClip]; + } + break; + case sun_java2d_pipe_BufferedOpCodes_SET_ALPHA_COMPOSITE: + { + jint rule = NEXT_INT(b); + jfloat extraAlpha = NEXT_FLOAT(b); + jint flags = NEXT_INT(b); + [mtlc setAlphaCompositeRule:rule extraAlpha:extraAlpha flags:flags]; + } + break; + case sun_java2d_pipe_BufferedOpCodes_SET_XOR_COMPOSITE: + { + jint xorPixel = NEXT_INT(b); + [mtlc setXorComposite:xorPixel]; + } + break; + case sun_java2d_pipe_BufferedOpCodes_RESET_COMPOSITE: + { + [mtlc resetComposite]; + } + break; + case sun_java2d_pipe_BufferedOpCodes_SET_TRANSFORM: + { + jdouble m00 = NEXT_DOUBLE(b); + jdouble m10 = NEXT_DOUBLE(b); + jdouble m01 = NEXT_DOUBLE(b); + jdouble m11 = NEXT_DOUBLE(b); + jdouble m02 = NEXT_DOUBLE(b); + jdouble m12 = NEXT_DOUBLE(b); + [mtlc setTransformM00:m00 M10:m10 M01:m01 M11:m11 M02:m02 M12:m12]; + } + break; + case sun_java2d_pipe_BufferedOpCodes_RESET_TRANSFORM: + { + [mtlc resetTransform]; + } + break; + + // context-related ops + case sun_java2d_pipe_BufferedOpCodes_SET_SURFACES: + { + J2dTracePrimitive("MTLRenderQueue_SET_SURFACES"); + + jlong pSrc = NEXT_LONG(b); + jlong pDst = NEXT_LONG(b); + if (mtlc != NULL) { + RESET_PREVIOUS_OP(); + } + + dstOps = (BMTLSDOps *)jlong_to_ptr(pDst); + [MTLContext setSurfacesEnv:env src:pSrc dst:pDst]; + } + break; + case sun_java2d_pipe_BufferedOpCodes_SET_SCRATCH_SURFACE: + { + J2dTracePrimitive("MTLRenderQueue_SET_SCRATCH_SURFACE"); + jlong pConfigInfo = NEXT_LONG(b); + MTLGraphicsConfigInfo *mtlInfo = + (MTLGraphicsConfigInfo *)jlong_to_ptr(pConfigInfo); + + if (mtlInfo == NULL) { + J2dTraceImplPrimitive( + "MTLRenderQueue_SET_SCRATCH_SURFACE", + "ERROR: mtl config info is null"); + } else { + MTLContext *newMtlc = mtlInfo->context; + if (newMtlc == NULL) { + J2dTraceImplPrimitive( + "MTLRenderQueue_SET_SCRATCH_SURFACE", + "ERROR: mtl context is null"); + } else { + mtlc = newMtlc; + dstOps = NULL; + } + } + } + break; + case sun_java2d_pipe_BufferedOpCodes_FLUSH_SURFACE: + { + J2dTracePrimitive("MTLRenderQueue_FLUSH_SURFACE"); + jlong pData = NEXT_LONG(b); + BMTLSDOps *mtlsdo = (BMTLSDOps *)jlong_to_ptr(pData); + if (mtlsdo != NULL) { + CONTINUE_IF_NULL(mtlc); + RESET_PREVIOUS_OP(); + MTLSD_Delete(env, mtlsdo); + } + } + break; + case sun_java2d_pipe_BufferedOpCodes_DISPOSE_SURFACE: + { + J2dTracePrimitive("MTLRenderQueue_DISPOSE_SURFACE"); + jlong pData = NEXT_LONG(b); + BMTLSDOps *mtlsdo = (BMTLSDOps *)jlong_to_ptr(pData); + if (mtlsdo != NULL) { + CONTINUE_IF_NULL(mtlc); + RESET_PREVIOUS_OP(); + MTLSD_Delete(env, mtlsdo); + if (mtlsdo->privOps != NULL) { + free(mtlsdo->privOps); + } + } + } + break; + case sun_java2d_pipe_BufferedOpCodes_DISPOSE_CONFIG: + { + J2dTracePrimitive("MTLRenderQueue_DISPOSE_CONFIG"); + jlong pConfigInfo = NEXT_LONG(b); + CONTINUE_IF_NULL(mtlc); + RESET_PREVIOUS_OP(); + [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^(){ + MTLGC_DestroyMTLGraphicsConfig(pConfigInfo); + }]; + + + // the previous method will call glX/wglMakeCurrent(None), + // so we should nullify the current mtlc and dstOps to avoid + // calling glFlush() (or similar) while no context is current + mtlc = NULL; + // dstOps = NULL; + } + break; + case sun_java2d_pipe_BufferedOpCodes_INVALIDATE_CONTEXT: + { + //TODO + J2dTraceNotImplPrimitive("MTLRenderQueue_INVALIDATE_CONTEXT"); + // flush just in case there are any pending operations in + // the hardware pipe + if (mtlc != NULL) { + RESET_PREVIOUS_OP(); + } + // invalidate the references to the current context and + // destination surface that are maintained at the native level + mtlc = NULL; + // dstOps = NULL; + } + break; + case sun_java2d_pipe_BufferedOpCodes_SAVE_STATE: + { + //TODO + J2dTraceNotImplPrimitive("MTLRenderQueue_INVALIDATE_CONTEXT"); + } + break; + + case sun_java2d_pipe_BufferedOpCodes_RESTORE_STATE: + { + //TODO + J2dTraceNotImplPrimitive("MTLRenderQueue_RESTORE_STATE"); + + } + break; + case sun_java2d_pipe_BufferedOpCodes_SYNC: + { + sync = JNI_TRUE; + } + break; + + // multibuffering ops + case sun_java2d_pipe_BufferedOpCodes_SWAP_BUFFERS: + { + jlong window = NEXT_LONG(b); + if (mtlc != NULL) { + RESET_PREVIOUS_OP(); + } + MTLSD_SwapBuffers(env, window); + } + break; + + // special no-op (mainly used for achieving 8-byte alignment) + case sun_java2d_pipe_BufferedOpCodes_NOOP: + break; + + // paint-related ops + case sun_java2d_pipe_BufferedOpCodes_RESET_PAINT: + { + MTLPaints_ResetPaint(mtlc); + } + break; + case sun_java2d_pipe_BufferedOpCodes_SET_COLOR: + { + jint pixel = NEXT_INT(b); + + if (dstOps != NULL) { + MTLSDOps *dstCGLOps = (MTLSDOps *)dstOps->privOps; + dstCGLOps->configInfo->context.color = pixel; + } + MTLPaints_SetColor(mtlc, pixel); + } + break; + case sun_java2d_pipe_BufferedOpCodes_SET_GRADIENT_PAINT: + { + J2dTraceNotImplPrimitive("MTLRenderQueue_SET_GRADIENT_PAINT"); + jboolean useMask= NEXT_BOOLEAN(b); + jboolean cyclic = NEXT_BOOLEAN(b); + jdouble p0 = NEXT_DOUBLE(b); + jdouble p1 = NEXT_DOUBLE(b); + jdouble p3 = NEXT_DOUBLE(b); + jint pixel1 = NEXT_INT(b); + jint pixel2 = NEXT_INT(b); + if (dstOps != NULL) { + MTLSDOps *dstCGLOps = (MTLSDOps *)dstOps->privOps; + [dstCGLOps->configInfo->context setGradientPaintUseMask:useMask cyclic:cyclic + p0:p0 p1:p1 p3:p3 + pixel1:pixel1 pixel2:pixel2]; + + } + } + break; + case sun_java2d_pipe_BufferedOpCodes_SET_LINEAR_GRADIENT_PAINT: + { + jboolean useMask = NEXT_BOOLEAN(b); + jboolean linear = NEXT_BOOLEAN(b); + jint cycleMethod = NEXT_INT(b); + jint numStops = NEXT_INT(b); + jfloat p0 = NEXT_FLOAT(b); + jfloat p1 = NEXT_FLOAT(b); + jfloat p3 = NEXT_FLOAT(b); + void *fractions, *pixels; + fractions = b; SKIP_BYTES(b, numStops * sizeof(jfloat)); + pixels = b; SKIP_BYTES(b, numStops * sizeof(jint)); + MTLPaints_SetLinearGradientPaint(mtlc, dstOps, + useMask, linear, + cycleMethod, numStops, + p0, p1, p3, + fractions, pixels); + } + break; + case sun_java2d_pipe_BufferedOpCodes_SET_RADIAL_GRADIENT_PAINT: + { + jboolean useMask = NEXT_BOOLEAN(b); + jboolean linear = NEXT_BOOLEAN(b); + jint numStops = NEXT_INT(b); + jint cycleMethod = NEXT_INT(b); + jfloat m00 = NEXT_FLOAT(b); + jfloat m01 = NEXT_FLOAT(b); + jfloat m02 = NEXT_FLOAT(b); + jfloat m10 = NEXT_FLOAT(b); + jfloat m11 = NEXT_FLOAT(b); + jfloat m12 = NEXT_FLOAT(b); + jfloat focusX = NEXT_FLOAT(b); + void *fractions, *pixels; + fractions = b; SKIP_BYTES(b, numStops * sizeof(jfloat)); + pixels = b; SKIP_BYTES(b, numStops * sizeof(jint)); + MTLPaints_SetRadialGradientPaint(mtlc, dstOps, + useMask, linear, + cycleMethod, numStops, + m00, m01, m02, + m10, m11, m12, + focusX, + fractions, pixels); + } + break; + case sun_java2d_pipe_BufferedOpCodes_SET_TEXTURE_PAINT: + { + jboolean useMask= NEXT_BOOLEAN(b); + jboolean filter = NEXT_BOOLEAN(b); + jlong pSrc = NEXT_LONG(b); + jdouble xp0 = NEXT_DOUBLE(b); + jdouble xp1 = NEXT_DOUBLE(b); + jdouble xp3 = NEXT_DOUBLE(b); + jdouble yp0 = NEXT_DOUBLE(b); + jdouble yp1 = NEXT_DOUBLE(b); + jdouble yp3 = NEXT_DOUBLE(b); + MTLPaints_SetTexturePaint(mtlc, useMask, pSrc, filter, + xp0, xp1, xp3, + yp0, yp1, yp3); + } + break; + + // BufferedImageOp-related ops + case sun_java2d_pipe_BufferedOpCodes_ENABLE_CONVOLVE_OP: + { + jlong pSrc = NEXT_LONG(b); + jboolean edgeZero = NEXT_BOOLEAN(b); + jint kernelWidth = NEXT_INT(b); + jint kernelHeight = NEXT_INT(b); + MTLBufImgOps_EnableConvolveOp(mtlc, pSrc, edgeZero, + kernelWidth, kernelHeight, b); + SKIP_BYTES(b, kernelWidth * kernelHeight * sizeof(jfloat)); + } + break; + case sun_java2d_pipe_BufferedOpCodes_DISABLE_CONVOLVE_OP: + { + MTLBufImgOps_DisableConvolveOp(mtlc); + } + break; + case sun_java2d_pipe_BufferedOpCodes_ENABLE_RESCALE_OP: + { + jlong pSrc = NEXT_LONG(b); + jboolean nonPremult = NEXT_BOOLEAN(b); + jint numFactors = 4; + unsigned char *scaleFactors = b; + unsigned char *offsets = (b + numFactors * sizeof(jfloat)); + MTLBufImgOps_EnableRescaleOp(mtlc, pSrc, nonPremult, + scaleFactors, offsets); + SKIP_BYTES(b, numFactors * sizeof(jfloat) * 2); + } + break; + case sun_java2d_pipe_BufferedOpCodes_DISABLE_RESCALE_OP: + { + MTLBufImgOps_DisableRescaleOp(mtlc); + } + break; + case sun_java2d_pipe_BufferedOpCodes_ENABLE_LOOKUP_OP: + { + jlong pSrc = NEXT_LONG(b); + jboolean nonPremult = NEXT_BOOLEAN(b); + jboolean shortData = NEXT_BOOLEAN(b); + jint numBands = NEXT_INT(b); + jint bandLength = NEXT_INT(b); + jint offset = NEXT_INT(b); + jint bytesPerElem = shortData ? sizeof(jshort):sizeof(jbyte); + void *tableValues = b; + MTLBufImgOps_EnableLookupOp(mtlc, pSrc, nonPremult, shortData, + numBands, bandLength, offset, + tableValues); + SKIP_BYTES(b, numBands * bandLength * bytesPerElem); + } + break; + case sun_java2d_pipe_BufferedOpCodes_DISABLE_LOOKUP_OP: + { + MTLBufImgOps_DisableLookupOp(mtlc); + } + break; + + default: + J2dRlsTraceLn1(J2D_TRACE_ERROR, + "MTLRenderQueue_flushBuffer: invalid opcode=%d", opcode); + if (mtlc != NULL) { + RESET_PREVIOUS_OP(); + } + return; + } + + if (isDrawOpcode(opcode)) // performed rendering operation on dstOps + onSurfaceModified(dstOps); + } + + MTLTR_DisableGlyphModeState(); + scheduleBlitAllModifiedLayers(); +} + +/** + * Returns a pointer to the "current" context, as set by the last SET_SURFACES + * or SET_SCRATCH_SURFACE operation. + */ +MTLContext * +MTLRenderQueue_GetCurrentContext() +{ + return mtlc; +} + +/** + * Returns a pointer to the "current" destination surface, as set by the last + * SET_SURFACES operation. + */ +BMTLSDOps * +MTLRenderQueue_GetCurrentDestination() +{ + return dstOps; +} + +/** + * Used to track whether we are within a series of simple primitive operations + * or texturing operations. The op parameter determines the nature of the + * operation that is to follow. Valid values for this op parameter are: + */ +void +MTLRenderQueue_CheckPreviousOp(jint op) +{ + //TODO + J2dTraceNotImplPrimitive("MTLRenderQueue_CheckPreviousOp"); + previousOp = op; +} + +#endif /* !HEADLESS */ --- /dev/null 2019-05-16 19:17:09.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderer.h 2019-05-16 19:17:09.000000000 +0300 @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef MTLRenderer_h_Included +#define MTLRenderer_h_Included + +#include "sun_java2d_pipe_BufferedRenderPipe.h" +#include "MTLContext.h" +#include "MTLGraphicsConfig.h" +#import "MTLLayer.h" + +#define BYTES_PER_POLY_POINT \ + sun_java2d_pipe_BufferedRenderPipe_BYTES_PER_POLY_POINT +#define BYTES_PER_SCANLINE \ + sun_java2d_pipe_BufferedRenderPipe_BYTES_PER_SCANLINE +#define BYTES_PER_SPAN \ + sun_java2d_pipe_BufferedRenderPipe_BYTES_PER_SPAN + +void MTLRenderer_DrawLine(MTLContext *mtlc, BMTLSDOps * dstOps, + jint x1, jint y1, jint x2, jint y2); +void MTLRenderer_DrawRect(MTLContext *mtlc, BMTLSDOps * dstOps, + jint x, jint y, jint w, jint h); +void MTLRenderer_DrawPoly(MTLContext *mtlc, BMTLSDOps * dstOps, + jint nPoints, jint isClosed, + jint transX, jint transY, + jint *xPoints, jint *yPoints); +void MTLRenderer_DrawScanlines(MTLContext *mtlc, BMTLSDOps * dstOps, + jint count, jint *scanlines); +void MTLRenderer_DrawParallelogram(MTLContext *mtlc, BMTLSDOps * dstOps, + jfloat fx11, jfloat fy11, + jfloat dx21, jfloat dy21, + jfloat dx12, jfloat dy12, + jfloat lw21, jfloat lw12); +void MTLRenderer_DrawAAParallelogram(MTLContext *mtlc, BMTLSDOps *dstOps, + jfloat fx11, jfloat fy11, + jfloat dx21, jfloat dy21, + jfloat dx12, jfloat dy12, + jfloat lw21, jfloat lw12); + +void MTLRenderer_FillRect(MTLContext *mtlc, BMTLSDOps * dstOps, + jint x, jint y, jint w, jint h); +void MTLRenderer_FillSpans(MTLContext *mtlc, BMTLSDOps * dstOps, + jint count, jint *spans); +void MTLRenderer_FillParallelogram(MTLContext *mtlc, BMTLSDOps * dstOps, + jfloat fx11, jfloat fy11, + jfloat dx21, jfloat dy21, + jfloat dx12, jfloat dy12); +void MTLRenderer_FillAAParallelogram(MTLContext *mtlc, BMTLSDOps *dstOps, + jfloat fx11, jfloat fy11, + jfloat dx21, jfloat dy21, + jfloat dx12, jfloat dy12); + +void MTLRenderer_EnableAAParallelogramProgram(); +void MTLRenderer_DisableAAParallelogramProgram(); + +#endif /* MTLRenderer_h_Included */ --- /dev/null 2019-05-16 19:17:10.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderer.m 2019-05-16 19:17:10.000000000 +0300 @@ -0,0 +1,611 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef HEADLESS + +#include +#include +#include + +#include "sun_java2d_metal_MTLRenderer.h" + +#include "MTLRenderer.h" +#include "MTLRenderQueue.h" +#include "MTLSurfaceData.h" +#include "MTLUtils.h" +#import "MTLLayer.h" + +void MTLRenderer_FillParallelogramMetal( + MTLContext* mtlc, id dest, jfloat x, jfloat y, jfloat dx1, jfloat dy1, jfloat dx2, jfloat dy2) +{ + if (mtlc == NULL || dest == nil) + return; + + J2dTraceLn7(J2D_TRACE_INFO, + "MTLRenderer_FillParallelogramMetal " + "(x=%6.2f y=%6.2f " + "dx1=%6.2f dy1=%6.2f " + "dx2=%6.2f dy2=%6.2f dst tex=%p)", + x, y, + dx1, dy1, + dx2, dy2, dest); + + struct Vertex verts[PGRAM_VERTEX_COUNT] = { + { {(2.0*x/dest.width) - 1.0, + 2.0*(1.0 - y/dest.height) - 1.0, 0.0}}, + + { {2.0*(x+dx1)/dest.width - 1.0, + 2.0*(1.0 - (y+dy1)/dest.height) - 1.0, 0.0}}, + + { {2.0*(x+dx2)/dest.width - 1.0, + 2.0*(1.0 - (y+dy2)/dest.height) - 1.0, 0.0}}, + + { {2.0*(x+dx1)/dest.width - 1.0, + 2.0*(1.0 - (y+dy1)/dest.height) - 1.0, 0.0}}, + + { {2.0*(x + dx1 + dx2)/dest.width - 1.0, + 2.0*(1.0 - (y+ dy1 + dy2)/dest.height) - 1.0, 0.0}}, + + { {2.0*(x+dx2)/dest.width - 1.0, + 2.0*(1.0 - (y+dy2)/dest.height) - 1.0, 0.0}, + }}; + + // Encode render command. + id mtlEncoder = [mtlc createRenderEncoderForDest:dest]; + if (mtlEncoder == nil) + return; + + [mtlEncoder setVertexBytes:verts length:sizeof(verts) atIndex:MeshVertexBuffer]; + [mtlEncoder drawPrimitives:MTLPrimitiveTypeTriangle vertexStart:0 vertexCount: PGRAM_VERTEX_COUNT]; + [mtlEncoder endEncoding]; +} + +/** + * Note: Some of the methods in this file apply a "magic number" + * translation to line segments. The OpenGL specification lays out the + * "diamond exit rule" for line rasterization, but it is loose enough to + * allow for a wide range of line rendering hardware. (It appears that + * some hardware, such as the Nvidia GeForce2 series, does not even meet + * the spec in all cases.) As such it is difficult to find a mapping + * between the Java2D and OpenGL line specs that works consistently across + * all hardware combinations. + * + * Therefore the "magic numbers" you see here have been empirically derived + * after testing on a variety of graphics hardware in order to find some + * reasonable middle ground between the two specifications. The general + * approach is to apply a fractional translation to vertices so that they + * hit pixel centers and therefore touch the same pixels as in our other + * pipelines. Emphasis was placed on finding values so that MTL lines with + * a slope of +/- 1 hit all the same pixels as our other (software) loops. + * The stepping in other diagonal lines rendered with MTL may deviate + * slightly from those rendered with our software loops, but the most + * important thing is that these magic numbers ensure that all MTL lines + * hit the same endpoints as our software loops. + * + * If you find it necessary to change any of these magic numbers in the + * future, just be sure that you test the changes across a variety of + * hardware to ensure consistent rendering everywhere. + */ + +void MTLRenderer_DrawLine(MTLContext *mtlc, BMTLSDOps * dstOps, jint x1, jint y1, jint x2, jint y2) { + if (mtlc == NULL || dstOps == NULL || dstOps->pTexture == NULL) { + J2dTraceLn(J2D_TRACE_ERROR, "MTLRenderer_DrawLine: dest is null"); + return; + } + + J2dTraceLn5(J2D_TRACE_INFO, "MTLRenderer_DrawLine (x1=%1.2f y1=%1.2f x2=%1.2f y2=%1.2f), dst tex=%p", x1, y1, x2, y2, dstOps->pTexture); + + id mtlEncoder = [mtlc createRenderEncoderForDest:dstOps->pTexture]; + if (mtlEncoder == nil) + return; + + struct Vertex verts[2] = { + {{x1, y1, 0.0}}, + {{x2, y2, 0.0}} + }; + + [mtlEncoder setVertexBytes:verts length:sizeof(verts) atIndex:MeshVertexBuffer]; + [mtlEncoder drawPrimitives:MTLPrimitiveTypeLine vertexStart:0 vertexCount:2]; + [mtlEncoder endEncoding]; +} + +void MTLRenderer_DrawRect(MTLContext *mtlc, BMTLSDOps * dstOps, jint x, jint y, jint w, jint h) { + if (mtlc == NULL || dstOps == NULL || dstOps->pTexture == NULL) { + J2dTraceLn(J2D_TRACE_ERROR, "MTLRenderer_DrawRect: dest is null"); + return; + } + + id dest = dstOps->pTexture; + J2dTraceLn5(J2D_TRACE_INFO, "MTLRenderer_DrawRect (x=%d y=%d w=%d h=%d), dst tex=%p", x, y, w, h, dest); + + // TODO: use DrawParallelogram(x, y, w, h, lw=1, lh=1) + id mtlEncoder = [mtlc createRenderEncoderForDest:dest]; + if (mtlEncoder == nil) + return; + + const int verticesCount = 5; + struct Vertex vertices[verticesCount] = { + {{x, y, 0.0}}, + {{x + w, y, 0.0}}, + {{x + w, y + h, 0.0}}, + {{x, y + h, 0.0}}, + {{x, y, 0.0}}, + }; + [mtlEncoder setVertexBytes:vertices length:sizeof(vertices) atIndex:MeshVertexBuffer]; + [mtlEncoder drawPrimitives:MTLPrimitiveTypeLineStrip vertexStart:0 vertexCount:verticesCount]; + [mtlEncoder endEncoding]; +} + +const int POLYLINE_BUF_SIZE = 64; + +static void fillVertex(struct Vertex * vertex, int x, int y) { + vertex->position[0] = x; + vertex->position[1] = y; + vertex->position[2] = 0; +} + +void MTLRenderer_DrawPoly(MTLContext *mtlc, BMTLSDOps * dstOps, + jint nPoints, jint isClosed, + jint transX, jint transY, + jint *xPoints, jint *yPoints) +{ + // Note that BufferedRenderPipe.drawPoly() has already rejected polys + // with nPoints<2, so we can be certain here that we have nPoints>=2. + if (xPoints == NULL || yPoints == NULL || nPoints < 2) { // just for insurance + J2dRlsTraceLn(J2D_TRACE_ERROR, "MTLRenderer_DrawPoly: points array is empty"); + return; + } + + if (mtlc == NULL || dstOps == NULL || dstOps->pTexture == NULL) { + J2dRlsTraceLn(J2D_TRACE_ERROR, "MTLRenderer_DrawPoly: dest is null"); + return; + } + + J2dTraceLn4(J2D_TRACE_INFO, "MTLRenderer_DrawPoly: %d points, transX=%d, transY=%d, dst tex=%p", nPoints, transX, transY, dstOps->pTexture); + + __block struct { + struct Vertex verts[POLYLINE_BUF_SIZE]; + } pointsChunk; + + jint prevX = *(xPoints++); + jint prevY = *(yPoints++); + --nPoints; + const jint firstX = prevX; + const jint firstY = prevY; + while (nPoints > 0) { + fillVertex(pointsChunk.verts, prevX + transX, prevY + transY); + + const bool isLastChunk = nPoints + 1 <= POLYLINE_BUF_SIZE; + __block int chunkSize = isLastChunk ? nPoints : POLYLINE_BUF_SIZE - 1; + + for (int i = 1; i < chunkSize; i++) { + prevX = *(xPoints++); + prevY = *(yPoints++); + fillVertex(pointsChunk.verts + i, prevX + transX, prevY + transY); + } + + bool drawCloseSegment = false; + if (isClosed && isLastChunk) { + if (chunkSize + 2 <= POLYLINE_BUF_SIZE) { + fillVertex(pointsChunk.verts + chunkSize, firstX + transX, firstY + transY); + ++chunkSize; + } else + drawCloseSegment = true; + } + + nPoints -= chunkSize; + id mtlEncoder = [mtlc createRenderEncoderForDest:dstOps->pTexture]; + if (mtlEncoder == nil) + return; + + [mtlEncoder setVertexBytes:pointsChunk.verts length:sizeof(pointsChunk.verts) atIndex:MeshVertexBuffer]; + [mtlEncoder drawPrimitives:MTLPrimitiveTypeLineStrip vertexStart:0 vertexCount:chunkSize + 1]; + if (drawCloseSegment) { + struct Vertex vertices[2] = { + {{prevX + transX, prevY + transY, 0.0}}, + {{firstX + transX, firstY + transY, 0.0}}, + }; + [mtlEncoder setVertexBytes:vertices length:sizeof(vertices) atIndex:MeshVertexBuffer]; + [mtlEncoder drawPrimitives:MTLPrimitiveTypeLine vertexStart:0 vertexCount:2]; + } + + [mtlEncoder endEncoding]; + } +} + +JNIEXPORT void JNICALL +Java_sun_java2d_metal_MTLRenderer_drawPoly + (JNIEnv *env, jobject mtlr, + jintArray xpointsArray, jintArray ypointsArray, + jint nPoints, jboolean isClosed, + jint transX, jint transY) +{ + jint *xPoints, *yPoints; + //TODO + J2dTraceNotImplPrimitive("MTLRenderer_drawPoly"); + J2dTraceLn(J2D_TRACE_INFO, "MTLRenderer_drawPoly"); +} + +void +MTLRenderer_DrawScanlines(MTLContext *mtlc, BMTLSDOps * dstOps, + jint scanlineCount, jint *scanlines) +{ + //TODO + J2dTraceNotImplPrimitive("MTLRenderer_DrawScanlines"); + J2dTraceLn(J2D_TRACE_INFO, "MTLRenderer_DrawScanlines"); +} + +void +MTLRenderer_FillRect(MTLContext *mtlc, BMTLSDOps * dstOps, jint x, jint y, jint w, jint h) +{ + //TODO + J2dTraceNotImplPrimitive("MTLRenderer_FillRect"); + J2dTraceLn(J2D_TRACE_INFO, "MTLRenderer_FillRect"); +} + +const int SPAN_BUF_SIZE=64; + +void +MTLRenderer_FillSpans(MTLContext *mtlc, BMTLSDOps * dstOps, jint spanCount, jint *spans) +{ + J2dTraceLn(J2D_TRACE_INFO, "MTLRenderer_FillSpans"); + if (mtlc == NULL || dstOps == NULL || dstOps->pTexture == NULL) { + J2dRlsTraceLn(J2D_TRACE_ERROR, "MTLRenderer_FillSpans: dest is null"); + return; + } + + while (spanCount > 0) { + __block struct { + jfloat spns[SPAN_BUF_SIZE*4]; + } spanStruct; + + __block jfloat sc = spanCount > SPAN_BUF_SIZE ? SPAN_BUF_SIZE : spanCount; + + for (int i = 0; i < sc; i++) { + spanStruct.spns[i * 4] = *(spans++); + spanStruct.spns[i * 4 + 1] = *(spans++); + spanStruct.spns[i * 4 + 2] = *(spans++); + spanStruct.spns[i * 4 + 3] = *(spans++); + } + + spanCount -= sc; + + id dest = dstOps->pTexture; + id mtlEncoder = [mtlc createRenderEncoderForDest:dest]; + if (mtlEncoder == nil) + return; + + for (int i = 0; i < sc; i++) { + jfloat x1 = spanStruct.spns[i * 4]; + jfloat y1 = spanStruct.spns[i * 4 + 1]; + jfloat x2 = spanStruct.spns[i * 4 + 2]; + jfloat y2 = spanStruct.spns[i * 4 + 3]; + + struct Vertex verts[PGRAM_VERTEX_COUNT] = { + {{x1, y1, 0.0}}, + {{x2, y1, 0.0}}, + {{x1, y2, 0.0}}, + {{x2, y1, 0.0}}, + {{x2, y2, 0.0}}, + {{x1, y2, 0.0}, + }}; + + [mtlEncoder setVertexBytes:verts length:sizeof(verts) atIndex:MeshVertexBuffer]; + [mtlEncoder drawPrimitives:MTLPrimitiveTypeTriangle vertexStart:0 vertexCount:PGRAM_VERTEX_COUNT]; + } + + [mtlEncoder endEncoding]; + [mtlEncoder release]; + } +} + +void +MTLRenderer_FillParallelogram(MTLContext *mtlc, BMTLSDOps * dstOps, + jfloat fx11, jfloat fy11, + jfloat dx21, jfloat dy21, + jfloat dx12, jfloat dy12) +{ + J2dTracePrimitive("MTLRenderer_FillParallelogram"); + + if (mtlc == NULL || dstOps == NULL || dstOps->pTexture == NULL) { + J2dRlsTraceLn(J2D_TRACE_ERROR, "MTLRenderer_FillParallelogram: current dest is null"); + return; + } + + id dest = dstOps->pTexture; + J2dTraceLn7(J2D_TRACE_INFO, + "MTLRenderer_FillParallelogram " + "(x=%6.2f y=%6.2f " + "dx1=%6.2f dy1=%6.2f " + "dx2=%6.2f dy2=%6.2f dst tex=%p)", + fx11, fy11, + dx21, dy21, + dx12, dy12, dest); + + struct Vertex verts[PGRAM_VERTEX_COUNT] = { + { {fx11, fy11, 0.0}}, + { {fx11+dx21, fy11+dy21, 0.0}}, + { {fx11+dx12, fy11+dy12, 0.0}}, + { {fx11+dx21, fy11+dy21, 0.0}}, + { {fx11 + dx21 + dx12, fy11+ dy21 + dy12, 0.0}}, + { {fx11+dx12, fy11+dy12, 0.0}, + }}; + + // Encode render command. + id mtlEncoder = [mtlc createRenderEncoderForDest:dest]; + if (mtlEncoder == nil) + return; + + [mtlEncoder setVertexBytes:verts length:sizeof(verts) atIndex:MeshVertexBuffer]; + [mtlEncoder drawPrimitives:MTLPrimitiveTypeTriangle vertexStart:0 vertexCount: PGRAM_VERTEX_COUNT]; + [mtlEncoder endEncoding]; +} + +void +MTLRenderer_DrawParallelogram(MTLContext *mtlc, BMTLSDOps * dstOps, + jfloat fx11, jfloat fy11, + jfloat dx21, jfloat dy21, + jfloat dx12, jfloat dy12, + jfloat lwr21, jfloat lwr12) +{ + //TODO + J2dTraceNotImplPrimitive("MTLRenderer_DrawParallelogram"); + // dx,dy for line width in the "21" and "12" directions. + jfloat ldx21 = dx21 * lwr21; + jfloat ldy21 = dy21 * lwr21; + jfloat ldx12 = dx12 * lwr12; + jfloat ldy12 = dy12 * lwr12; + + // calculate origin of the outer parallelogram + jfloat ox11 = fx11 - (ldx21 + ldx12) / 2.0f; + jfloat oy11 = fy11 - (ldy21 + ldy12) / 2.0f; + + J2dTraceLn8(J2D_TRACE_INFO, + "MTLRenderer_DrawParallelogram " + "(x=%6.2f y=%6.2f " + "dx1=%6.2f dy1=%6.2f lwr1=%6.2f " + "dx2=%6.2f dy2=%6.2f lwr2=%6.2f)", + fx11, fy11, + dx21, dy21, lwr21, + dx12, dy12, lwr12); + +} + +static GLhandleARB aaPgramProgram = 0; + +/* + * This shader fills the space between an outer and inner parallelogram. + * It can be used to draw an outline by specifying both inner and outer + * values. It fills pixels by estimating what portion falls inside the + * outer shape, and subtracting an estimate of what portion falls inside + * the inner shape. Specifying both inner and outer values produces a + * standard "wide outline". Specifying an inner shape that falls far + * outside the outer shape allows the same shader to fill the outer + * shape entirely since pixels that fall within the outer shape are never + * inside the inner shape and so they are filled based solely on their + * coverage of the outer shape. + * + * The setup code renders this shader over the bounds of the outer + * shape (or the only shape in the case of a fill operation) and + * sets the texture 0 coordinates so that 0,0=>0,1=>1,1=>1,0 in those + * texture coordinates map to the four corners of the parallelogram. + * Similarly the texture 1 coordinates map the inner shape to the + * unit square as well, but in a different coordinate system. + * + * When viewed in the texture coordinate systems the parallelograms + * we are filling are unit squares, but the pixels have then become + * tiny parallelograms themselves. Both of the texture coordinate + * systems are affine transforms so the rate of change in X and Y + * of the texture coordinates are essentially constants and happen + * to correspond to the size and direction of the slanted sides of + * the distorted pixels relative to the "square mapped" boundary + * of the parallelograms. + * + * The shader uses the dFdx() and dFdy() functions to measure the "rate + * of change" of these texture coordinates and thus gets an accurate + * measure of the size and shape of a pixel relative to the two + * parallelograms. It then uses the bounds of the size and shape + * of a pixel to intersect with the unit square to estimate the + * coverage of the pixel. Unfortunately, without a lot more work + * to calculate the exact area of intersection between a unit + * square (the original parallelogram) and a parallelogram (the + * distorted pixel), this shader only approximates the pixel + * coverage, but emperically the estimate is very useful and + * produces visually pleasing results, if not theoretically accurate. + */ +static const char *aaPgramShaderSource = + "void main() {" + // Calculate the vectors for the "legs" of the pixel parallelogram + // for the outer parallelogram. + " vec2 oleg1 = dFdx(gl_TexCoord[0].st);" + " vec2 oleg2 = dFdy(gl_TexCoord[0].st);" + // Calculate the bounds of the distorted pixel parallelogram. + " vec2 corner = gl_TexCoord[0].st - (oleg1+oleg2)/2.0;" + " vec2 omin = min(corner, corner+oleg1);" + " omin = min(omin, corner+oleg2);" + " omin = min(omin, corner+oleg1+oleg2);" + " vec2 omax = max(corner, corner+oleg1);" + " omax = max(omax, corner+oleg2);" + " omax = max(omax, corner+oleg1+oleg2);" + // Calculate the vectors for the "legs" of the pixel parallelogram + // for the inner parallelogram. + " vec2 ileg1 = dFdx(gl_TexCoord[1].st);" + " vec2 ileg2 = dFdy(gl_TexCoord[1].st);" + // Calculate the bounds of the distorted pixel parallelogram. + " corner = gl_TexCoord[1].st - (ileg1+ileg2)/2.0;" + " vec2 imin = min(corner, corner+ileg1);" + " imin = min(imin, corner+ileg2);" + " imin = min(imin, corner+ileg1+ileg2);" + " vec2 imax = max(corner, corner+ileg1);" + " imax = max(imax, corner+ileg2);" + " imax = max(imax, corner+ileg1+ileg2);" + // Clamp the bounds of the parallelograms to the unit square to + // estimate the intersection of the pixel parallelogram with + // the unit square. The ratio of the 2 rectangle areas is a + // reasonable estimate of the proportion of coverage. + " vec2 o1 = clamp(omin, 0.0, 1.0);" + " vec2 o2 = clamp(omax, 0.0, 1.0);" + " float oint = (o2.y-o1.y)*(o2.x-o1.x);" + " float oarea = (omax.y-omin.y)*(omax.x-omin.x);" + " vec2 i1 = clamp(imin, 0.0, 1.0);" + " vec2 i2 = clamp(imax, 0.0, 1.0);" + " float iint = (i2.y-i1.y)*(i2.x-i1.x);" + " float iarea = (imax.y-imin.y)*(imax.x-imin.x);" + // Proportion of pixel in outer shape minus the proportion + // of pixel in the inner shape == the coverage of the pixel + // in the area between the two. + " float coverage = oint/oarea - iint / iarea;" + " gl_FragColor = gl_Color * coverage;" + "}"; + +#define ADJUST_PGRAM(V1, DV, V2) \ + do { \ + if ((DV) >= 0) { \ + (V2) += (DV); \ + } else { \ + (V1) += (DV); \ + } \ + } while (0) + +// Invert the following transform: +// DeltaT(0, 0) == (0, 0) +// DeltaT(1, 0) == (DX1, DY1) +// DeltaT(0, 1) == (DX2, DY2) +// DeltaT(1, 1) == (DX1+DX2, DY1+DY2) +// TM00 = DX1, TM01 = DX2, (TM02 = X11) +// TM10 = DY1, TM11 = DY2, (TM12 = Y11) +// Determinant = TM00*TM11 - TM01*TM10 +// = DX1*DY2 - DX2*DY1 +// Inverse is: +// IM00 = TM11/det, IM01 = -TM01/det +// IM10 = -TM10/det, IM11 = TM00/det +// IM02 = (TM01 * TM12 - TM11 * TM02) / det, +// IM12 = (TM10 * TM02 - TM00 * TM12) / det, + +#define DECLARE_MATRIX(MAT) \ + jfloat MAT ## 00, MAT ## 01, MAT ## 02, MAT ## 10, MAT ## 11, MAT ## 12 + +#define GET_INVERTED_MATRIX(MAT, X11, Y11, DX1, DY1, DX2, DY2, RET_CODE) \ + do { \ + jfloat det = DX1*DY2 - DX2*DY1; \ + if (det == 0) { \ + RET_CODE; \ + } \ + MAT ## 00 = DY2/det; \ + MAT ## 01 = -DX2/det; \ + MAT ## 10 = -DY1/det; \ + MAT ## 11 = DX1/det; \ + MAT ## 02 = (DX2 * Y11 - DY2 * X11) / det; \ + MAT ## 12 = (DY1 * X11 - DX1 * Y11) / det; \ + } while (0) + +#define TRANSFORM(MAT, TX, TY, X, Y) \ + do { \ + TX = (X) * MAT ## 00 + (Y) * MAT ## 01 + MAT ## 02; \ + TY = (X) * MAT ## 10 + (Y) * MAT ## 11 + MAT ## 12; \ + } while (0) + +void +MTLRenderer_FillAAParallelogram(MTLContext *mtlc, BMTLSDOps *dstOps, + jfloat fx11, jfloat fy11, + jfloat dx21, jfloat dy21, + jfloat dx12, jfloat dy12) +{ + //TODO + J2dTraceNotImplPrimitive("MTLRenderer_FillAAParallelogram"); + DECLARE_MATRIX(om); + // parameters for parallelogram bounding box + jfloat bx11, by11, bx22, by22; + // parameters for uv texture coordinates of parallelogram corners + jfloat u11, v11, u12, v12, u21, v21, u22, v22; + + J2dTraceLn6(J2D_TRACE_INFO, + "MTLRenderer_FillAAParallelogram " + "(x=%6.2f y=%6.2f " + "dx1=%6.2f dy1=%6.2f " + "dx2=%6.2f dy2=%6.2f)", + fx11, fy11, + dx21, dy21, + dx12, dy12); + +} + +void +MTLRenderer_FillAAParallelogramInnerOuter(MTLContext *mtlc, MTLSDOps *dstOps, + jfloat ox11, jfloat oy11, + jfloat ox21, jfloat oy21, + jfloat ox12, jfloat oy12, + jfloat ix11, jfloat iy11, + jfloat ix21, jfloat iy21, + jfloat ix12, jfloat iy12) +{ + //TODO + J2dTraceNotImplPrimitive("MTLRenderer_FillAAParallelogramInnerOuter"); +} + +void +MTLRenderer_DrawAAParallelogram(MTLContext *mtlc, BMTLSDOps *dstOps, + jfloat fx11, jfloat fy11, + jfloat dx21, jfloat dy21, + jfloat dx12, jfloat dy12, + jfloat lwr21, jfloat lwr12) +{ + //TODO + J2dTraceNotImplPrimitive("MTLRenderer_DrawAAParallelogram"); + // dx,dy for line width in the "21" and "12" directions. + jfloat ldx21, ldy21, ldx12, ldy12; + // parameters for "outer" parallelogram + jfloat ofx11, ofy11, odx21, ody21, odx12, ody12; + // parameters for "inner" parallelogram + jfloat ifx11, ify11, idx21, idy21, idx12, idy12; + + J2dTraceLn8(J2D_TRACE_INFO, + "MTLRenderer_DrawAAParallelogram " + "(x=%6.2f y=%6.2f " + "dx1=%6.2f dy1=%6.2f lwr1=%6.2f " + "dx2=%6.2f dy2=%6.2f lwr2=%6.2f)", + fx11, fy11, + dx21, dy21, lwr21, + dx12, dy12, lwr12); + +} + +void +MTLRenderer_EnableAAParallelogramProgram() +{ + //TODO + J2dTraceNotImplPrimitive("MTLRenderer_EnableAAParallelogramProgram"); + J2dTraceLn(J2D_TRACE_INFO, "MTLRenderer_EnableAAParallelogramProgram"); +} + +void +MTLRenderer_DisableAAParallelogramProgram() +{ + //TODO + J2dTraceNotImplPrimitive("MTLRenderer_DisableAAParallelogramProgram"); + J2dTraceLn(J2D_TRACE_INFO, "MTLRenderer_DisableAAParallelogramProgram"); +} + +#endif /* !HEADLESS */ --- /dev/null 2019-05-16 19:17:11.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLSurfaceData.h 2019-05-16 19:17:11.000000000 +0300 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef MTLSurfaceData_h_Included +#define MTLSurfaceData_h_Included + +#import "MTLSurfaceDataBase.h" +#import "MTLGraphicsConfig.h" +#import "AWTWindow.h" +#import "MTLLayer.h" + +/** + * The CGLSDOps structure contains the CGL-specific information for a given + * MTLSurfaceData. It is referenced by the native MTLSDOps structure. + */ +typedef struct _MTLSDOps { + AWTView *peerData; + MTLLayer *layer; + jint argb[4]; // background clear color + MTLGraphicsConfigInfo *configInfo; +} MTLSDOps; + +#endif /* MTLSurfaceData_h_Included */ --- /dev/null 2019-05-16 19:17:13.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLSurfaceData.m 2019-05-16 19:17:12.000000000 +0300 @@ -0,0 +1,458 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#import + +#import "sun_java2d_metal_MTLSurfaceData.h" + +#import "jni_util.h" +#import "MTLRenderQueue.h" +#import "MTLGraphicsConfig.h" +#import "MTLSurfaceData.h" +#import "ThreadUtilities.h" +#include "jlong.h" + +/** + * The following methods are implemented in the windowing system (i.e. GLX + * and WGL) source files. + */ +extern jlong MTLSD_GetNativeConfigInfo(BMTLSDOps *mtlsdo); +extern jboolean MTLSD_InitMTLWindow(JNIEnv *env, MTLSDOps *mtlsdo); +extern void MTLSD_DestroyMTLSurface(JNIEnv *env, MTLSDOps *mtlsdo); + +void MTLSD_SetNativeDimensions(JNIEnv *env, BMTLSDOps *mtlsdo, jint w, jint h); + +/** + * This table contains the "pixel formats" for all system memory surfaces + * that OpenGL is capable of handling, indexed by the "PF_" constants defined + * in MTLSurfaceData.java. These pixel formats contain information that is + * passed to OpenGL when copying from a system memory ("Sw") surface to + * an OpenGL "Surface" (via glDrawPixels()) or "Texture" (via glTexImage2D()). + */ +MTLPixelFormat MTPixelFormats[] = {}; + +/** + * Given a starting value and a maximum limit, returns the first power-of-two + * greater than the starting value. If the resulting value is greater than + * the maximum limit, zero is returned. + */ +jint +MTLSD_NextPowerOfTwo(jint val, jint max) +{ + jint i; + + if (val > max) { + return 0; + } + + for (i = 1; i < val; i *= 2); + + return i; +} + +/** + * Returns true if both given dimensions are a power of two. + */ +static jboolean +MTLSD_IsPowerOfTwo(jint width, jint height) +{ + return (((width & (width-1)) | (height & (height-1))) == 0); +} + +/** + * Initializes an MTL texture, using the given width and height as + * a guide. + */ +JNIEXPORT jboolean JNICALL +Java_sun_java2d_metal_MTLSurfaceData_initTexture + (JNIEnv *env, jobject mtlsd, + jlong pData, jboolean isOpaque, + jboolean texNonPow2, jboolean texRect, + jint width, jint height) +{ + BMTLSDOps *bmtlsdo = (BMTLSDOps *)jlong_to_ptr(pData); + J2dTraceLn3(J2D_TRACE_INFO, "MTLSurfaceData_initTexture: w=%d h=%d p=%p", width, height, bmtlsdo); + + if (bmtlsdo == NULL) { + J2dRlsTraceLn(J2D_TRACE_ERROR, "MTLSurfaceData_initTexture: ops are null"); + return JNI_FALSE; + } + + if (width <= 0 || height <= 0) { + J2dRlsTraceLn2(J2D_TRACE_ERROR, "MTLSurfaceData_initTexture: texture dimensions is incorrect, w=%d, h=%d", width, height); + return JNI_FALSE; + } + + MTLSDOps *mtlsdo = (MTLSDOps *)bmtlsdo->privOps; + if (mtlsdo == NULL) { + J2dRlsTraceLn(J2D_TRACE_ERROR, "MTLSurfaceData_initTexture: MTLSDOps are null"); + return JNI_FALSE; + } + + if (mtlsdo->configInfo == NULL || mtlsdo->configInfo->context == NULL) { + J2dRlsTraceLn(J2D_TRACE_ERROR, "MTLSurfaceData_initTexture: MTLSDOps wasn't initialized (context is null)"); + return JNI_FALSE; + } + + MTLContext* ctx = mtlsdo->configInfo->context; + + MTLTextureDescriptor *textureDescriptor = [MTLTextureDescriptor texture2DDescriptorWithPixelFormat: MTLPixelFormatBGRA8Unorm width: width height: height mipmapped: NO]; + bmtlsdo->pTexture = [[ctx.device newTextureWithDescriptor: textureDescriptor] retain]; + bmtlsdo->isOpaque = isOpaque; + bmtlsdo->xOffset = 0; + bmtlsdo->yOffset = 0; + bmtlsdo->width = width; + bmtlsdo->height = height; + bmtlsdo->textureWidth = width; + bmtlsdo->textureHeight = height; + bmtlsdo->textureTarget = -1; + bmtlsdo->drawableType = MTLSD_TEXTURE; + + MTLSD_SetNativeDimensions(env, bmtlsdo, width, width); + J2dTraceLn4(J2D_TRACE_VERBOSE, "\tcreated MTLTexture [texture]: w=%d h=%d bp=%p [tex=%p]", width, height, bmtlsdo, bmtlsdo->pTexture); + + return JNI_TRUE; +} + +/** + * Initializes a framebuffer object, using the given width and height as + * a guide. See MTLSD_InitTextureObject() and MTLSD_initRTexture() + * for more information. + */ +JNIEXPORT jboolean JNICALL +Java_sun_java2d_metal_MTLSurfaceData_initRTexture + (JNIEnv *env, jobject mtlsd, + jlong pData, jboolean isOpaque, + jboolean texNonPow2, jboolean texRect, + jint width, jint height) +{ + + BMTLSDOps *bmtlsdo = (BMTLSDOps *)jlong_to_ptr(pData); + + if (bmtlsdo == NULL) { + J2dRlsTraceLn(J2D_TRACE_ERROR, + "MTLSurfaceData_initRTexture: BMTLSDOps are null"); + return JNI_FALSE; + } + + MTLSDOps *mtlsdo = (MTLSDOps *)bmtlsdo->privOps; + + if (mtlsdo == NULL) { + J2dRlsTraceLn(J2D_TRACE_ERROR, + "MTLSurfaceData_initRTexture: MTLSDOps are null"); + return JNI_FALSE; + } + + if (mtlsdo->configInfo == NULL || mtlsdo->configInfo->context == NULL) { + J2dRlsTraceLn(J2D_TRACE_ERROR, "MTLSurfaceData_initRTexture: MTLSDOps wasn't initialized (context is null)"); + return JNI_FALSE; + } + + const MTLContext* ctx = mtlsdo->configInfo->context; + MTLTextureDescriptor *textureDescriptor = [MTLTextureDescriptor texture2DDescriptorWithPixelFormat: MTLPixelFormatBGRA8Unorm width: width height: height mipmapped: NO]; + bmtlsdo->pTexture = [[ctx.device newTextureWithDescriptor: textureDescriptor] retain];; + + bmtlsdo->isOpaque = isOpaque; + bmtlsdo->xOffset = 0; + bmtlsdo->yOffset = 0; + bmtlsdo->width = width; + bmtlsdo->height = height; + bmtlsdo->textureWidth = width; + bmtlsdo->textureHeight = height; + bmtlsdo->textureTarget = -1; + bmtlsdo->drawableType = MTLSD_RT_TEXTURE; + + MTLSD_SetNativeDimensions(env, bmtlsdo, width, width); + J2dTraceLn4(J2D_TRACE_VERBOSE, "\tcreated MTLTexture [FBObject]: w=%d h=%d bp=%p [tex=%p]", width, height, bmtlsdo, bmtlsdo->pTexture); + + return JNI_TRUE; +} + +/** + * Initializes a surface in the backbuffer of a given double-buffered + * onscreen window for use in a BufferStrategy.Flip situation. The bounds of + * the backbuffer surface should always be kept in sync with the bounds of + * the underlying native window. + */ +JNIEXPORT jboolean JNICALL +Java_sun_java2d_metal_MTLSurfaceData_initFlipBackbuffer + (JNIEnv *env, jobject mtlsd, + jlong pData) +{ + //TODO + J2dTraceNotImplPrimitive("MTLSurfaceData_initFlipBackbuffer"); + MTLSDOps *mtlsdo = (MTLSDOps *)jlong_to_ptr(pData); + + J2dTraceLn(J2D_TRACE_INFO, "MTLSurfaceData_initFlipBackbuffer"); + return JNI_TRUE; +} + +JNIEXPORT jint JNICALL +Java_sun_java2d_metal_MTLSurfaceData_getTextureTarget + (JNIEnv *env, jobject mtlsd, + jlong pData) +{ + //TODO + J2dTraceNotImplPrimitive("MTLSurfaceData_getTextureTarget"); + MTLSDOps *mtlsdo = (MTLSDOps *)jlong_to_ptr(pData); + + J2dTraceLn(J2D_TRACE_INFO, "MTLSurfaceData_getTextureTarget"); + + return 0; +} + +JNIEXPORT jint JNICALL +Java_sun_java2d_metal_MTLSurfaceData_getTextureID + (JNIEnv *env, jobject mtlsd, + jlong pData) +{ + //TODO + J2dTraceNotImplPrimitive("MTLSurfaceData_getTextureID"); + return 0; +} + +/** + * Initializes nativeWidth/Height fields of the surfaceData object with + * passed arguments. + */ +void +MTLSD_SetNativeDimensions(JNIEnv *env, BMTLSDOps *mtlsdo, + jint width, jint height) +{ + jobject sdObject; + + sdObject = (*env)->NewLocalRef(env, mtlsdo->sdOps.sdObject); + if (sdObject == NULL) { + return; + } + + JNU_SetFieldByName(env, NULL, sdObject, "nativeWidth", "I", width); + if (!((*env)->ExceptionOccurred(env))) { + JNU_SetFieldByName(env, NULL, sdObject, "nativeHeight", "I", height); + } + + (*env)->DeleteLocalRef(env, sdObject); +} + +/** + * Deletes native OpenGL resources associated with this surface. + */ +void +MTLSD_Delete(JNIEnv *env, BMTLSDOps *mtlsdo) +{ + //TODO + J2dTraceNotImplPrimitive("MTLSD_Delete"); + J2dTraceLn1(J2D_TRACE_INFO, "MTLSD_Delete: type=%d", + mtlsdo->drawableType); +} + +/** + * This is the implementation of the general DisposeFunc defined in + * SurfaceData.h and used by the Disposer mechanism. It first flushes all + * native OpenGL resources and then frees any memory allocated within the + * native MTLSDOps structure. + */ +void +MTLSD_Dispose(JNIEnv *env, SurfaceDataOps *ops) +{ + MTLSDOps *mtlsdo = (MTLSDOps *)ops; + jlong pConfigInfo = MTLSD_GetNativeConfigInfo(mtlsdo); + + JNU_CallStaticMethodByName(env, NULL, "sun/java2d/metal/MTLSurfaceData", + "dispose", "(JJ)V", + ptr_to_jlong(ops), pConfigInfo); +} + +/** + * This is the implementation of the general surface LockFunc defined in + * SurfaceData.h. + */ +jint +MTLSD_Lock(JNIEnv *env, + SurfaceDataOps *ops, + SurfaceDataRasInfo *pRasInfo, + jint lockflags) +{ + JNU_ThrowInternalError(env, "MTLSD_Lock not implemented!"); + return SD_FAILURE; +} + +/** + * This is the implementation of the general GetRasInfoFunc defined in + * SurfaceData.h. + */ +void +MTLSD_GetRasInfo(JNIEnv *env, + SurfaceDataOps *ops, + SurfaceDataRasInfo *pRasInfo) +{ + JNU_ThrowInternalError(env, "MTLSD_GetRasInfo not implemented!"); +} + +/** + * This is the implementation of the general surface UnlockFunc defined in + * SurfaceData.h. + */ +void +MTLSD_Unlock(JNIEnv *env, + SurfaceDataOps *ops, + SurfaceDataRasInfo *pRasInfo) +{ + JNU_ThrowInternalError(env, "MTLSD_Unlock not implemented!"); +} + +/** + * This function disposes of any native windowing system resources associated + * with this surface. + */ +void +MTLSD_DestroyMTLSurface(JNIEnv *env, MTLSDOps *mtlsdo) +{ + J2dTraceLn(J2D_TRACE_INFO, "OGLSD_DestroyOGLSurface"); +} + +/** + * Returns a pointer (as a jlong) to the native CGLGraphicsConfigInfo + * associated with the given OGLSDOps. This method can be called from + * shared code to retrieve the native GraphicsConfig data in a platform- + * independent manner. + */ +jlong +MTLSD_GetNativeConfigInfo(BMTLSDOps *mtlsdo) +{ + J2dTraceLn(J2D_TRACE_INFO, "OGLSD_GetNativeConfigInfo"); + + return 0; +} + +/** + * This function initializes a native window surface and caches the window + * bounds in the given OGLSDOps. Returns JNI_TRUE if the operation was + * successful; JNI_FALSE otherwise. + */ +jboolean +MTLSD_InitMTLWindow(JNIEnv *env, MTLSDOps *oglsdo) +{ + J2dTraceLn(J2D_TRACE_INFO, "MTLSD_InitMTLWindow"); + + return JNI_TRUE; +} + +void +MTLSD_SwapBuffers(JNIEnv *env, jlong pPeerData) +{ + J2dTraceLn(J2D_TRACE_INFO, "OGLSD_SwapBuffers"); +} + +#pragma mark - +#pragma mark "--- CGLSurfaceData methods ---" + +extern LockFunc MTLSD_Lock; +extern GetRasInfoFunc MTLSD_GetRasInfo; +extern UnlockFunc MTLSD_Unlock; + + +JNIEXPORT void JNICALL +Java_sun_java2d_metal_MTLSurfaceData_initOps + (JNIEnv *env, jobject cglsd, + jlong pConfigInfo, jlong pPeerData, jlong layerPtr, + jint xoff, jint yoff, jboolean isOpaque) +{ + BMTLSDOps *bmtlsdo = (BMTLSDOps *)SurfaceData_InitOps(env, cglsd, sizeof(BMTLSDOps)); + MTLSDOps *mtlsdo = (MTLSDOps *)malloc(sizeof(MTLSDOps)); + + J2dTraceLn1(J2D_TRACE_INFO, "MTLSurfaceData_initOps p=%p", bmtlsdo); + J2dTraceLn1(J2D_TRACE_INFO, " pPeerData=%p", jlong_to_ptr(pPeerData)); + J2dTraceLn1(J2D_TRACE_INFO, " layerPtr=%p", jlong_to_ptr(layerPtr)); + J2dTraceLn2(J2D_TRACE_INFO, " xoff=%d, yoff=%d", (int)xoff, (int)yoff); + + if (mtlsdo == NULL) { + JNU_ThrowOutOfMemoryError(env, "creating native cgl ops"); + return; + } + + bmtlsdo->privOps = mtlsdo; + + bmtlsdo->sdOps.Lock = MTLSD_Lock; + bmtlsdo->sdOps.GetRasInfo = MTLSD_GetRasInfo; + bmtlsdo->sdOps.Unlock = MTLSD_Unlock; + bmtlsdo->sdOps.Dispose = MTLSD_Dispose; + + bmtlsdo->drawableType = MTLSD_UNDEFINED; + bmtlsdo->needsInit = JNI_TRUE; + bmtlsdo->xOffset = xoff; + bmtlsdo->yOffset = yoff; + bmtlsdo->isOpaque = isOpaque; + + mtlsdo->peerData = (AWTView *)jlong_to_ptr(pPeerData); + mtlsdo->layer = (MTLLayer *)jlong_to_ptr(layerPtr); + mtlsdo->configInfo = (MTLGraphicsConfigInfo *)jlong_to_ptr(pConfigInfo); + + if (mtlsdo->configInfo == NULL) { + free(mtlsdo); + JNU_ThrowNullPointerException(env, "Config info is null in initOps"); + } +} + +JNIEXPORT void JNICALL +Java_sun_java2d_metal_MTLSurfaceData_clearWindow +(JNIEnv *env, jobject cglsd) +{ + J2dTraceLn(J2D_TRACE_INFO, "CGLSurfaceData_clearWindow"); + + BMTLSDOps *mtlsdo = (MTLSDOps*) SurfaceData_GetOps(env, cglsd); + MTLSDOps *cglsdo = (MTLSDOps*) mtlsdo->privOps; + + cglsdo->peerData = NULL; + cglsdo->layer = NULL; +} + +JNIEXPORT void JNICALL +Java_sun_java2d_metal_MTLSurfaceData_validate + (JNIEnv *env, jobject jsurfacedata, + jint xoff, jint yoff, jint width, jint height, jboolean isOpaque) +{ + J2dTraceLn2(J2D_TRACE_INFO, "MTLLSurfaceData_validate: w=%d h=%d", width, height); + + BMTLSDOps *mtlsdo = (BMTLSDOps*)SurfaceData_GetOps(env, jsurfacedata); + mtlsdo->needsInit = JNI_TRUE; + mtlsdo->xOffset = xoff; + mtlsdo->yOffset = yoff; + + mtlsdo->width = width; + mtlsdo->height = height; + mtlsdo->isOpaque = isOpaque; + + if (mtlsdo->drawableType == MTLSD_WINDOW) { + // J2dTraceLn4(J2D_TRACE_INFO, "MTLContext_SetSurfaces: w=%d h=%d src=%p dst=%p", width, height, mtlsdo, mtlsdo); + [MTLContext setSurfacesEnv:env src:ptr_to_jlong(mtlsdo) dst:ptr_to_jlong(mtlsdo)]; + + // we have to explicitly tell the NSOpenGLContext that its target + // drawable has changed size + MTLSDOps *cglsdo = (MTLSDOps *)mtlsdo->privOps; + MTLContext *mtlc = cglsdo->configInfo->context; + + } +} --- /dev/null 2019-05-16 19:17:14.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLSurfaceDataBase.h 2019-05-16 19:17:13.000000000 +0300 @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef MTLSurfaceDataBase_h_Included +#define MTLSurfaceDataBase_h_Included + +#include "java_awt_image_AffineTransformOp.h" +#include "sun_java2d_metal_MTLSurfaceData.h" +#include "sun_java2d_pipe_hw_AccelSurface.h" + +#include "SurfaceData.h" +#include "Trace.h" +#include "MTLFuncs.h" + + +/** + * The MTLPixelFormat structure contains all the information OpenGL needs to + * know when copying from or into a particular system memory image buffer (via + * glDrawPixels(), glReadPixels, glTexSubImage2D(), etc). + * + * GLenum format; + * The pixel format parameter used in glDrawPixels() and other similar calls. + * Indicates the component ordering for each pixel (e.g. GL_BGRA). + * + * GLenum type; + * The pixel data type parameter used in glDrawPixels() and other similar + * calls. Indicates the data type for an entire pixel or for each component + * in a pixel (e.g. GL_UNSIGNED_BYTE with GL_BGR means a pixel consists of + * 3 unsigned byte components, blue first, then green, then red; + * GL_UNSIGNED_INT_8_8_8_8_REV with GL_BGRA means a pixel consists of 1 + * unsigned integer comprised of four byte components, alpha first, then red, + * then green, then blue). + * + * jint alignment; + * The byte alignment parameter used in glPixelStorei(GL_UNPACK_ALIGNMENT). A + * value of 4 indicates that each pixel starts on a 4-byte aligned region in + * memory, and so on. This alignment parameter helps OpenGL speed up pixel + * transfer operations by transferring memory in aligned blocks. + * + * jboolean hasAlpha; + * If true, indicates that this pixel format contains an alpha component. + * + * jboolean isPremult; + * If true, indicates that this pixel format contains color components that + * have been pre-multiplied by their corresponding alpha component. + */ +typedef struct { + //GLenum format; + //GLenum type; + jint format; + jint type; + jint alignment; + jboolean hasAlpha; + jboolean isPremult; +} MTPixelFormat; + +/** + * The MTLSDOps structure describes a native OpenGL surface and contains all + * information pertaining to the native surface. Some information about + * the more important/different fields: + * + * void *privOps; + * Pointer to native-specific (GLX, WGL, etc.) SurfaceData info, such as the + * native Drawable handle and GraphicsConfig data. + * + * jint drawableType; + * The surface type; can be any one of the surface type constants defined + * below (MTLSD_WINDOW, MTLSD_TEXTURE, etc). + * + * GLenum activeBuffer; + * Can be either GL_FRONT if this is the front buffer surface of an onscreen + * window or a pbuffer surface, or GL_BACK if this is the backbuffer surface + * of an onscreen window. + * + * jboolean isOpaque; + * If true, the surface should be treated as being fully opaque. If + * the underlying surface (e.g. pbuffer) has an alpha channel and isOpaque + * is true, then we should take appropriate action (i.e. call glColorMask() + * to disable writes into the alpha channel) to ensure that the surface + * remains fully opaque. + * + * jboolean needsInit; + * If true, the surface requires some one-time initialization, which should + * be performed after a context has been made current to the surface for + * the first time. + * + * jint x/yOffset + * The offset in pixels of the OpenGL viewport origin from the lower-left + * corner of the heavyweight drawable. For example, a top-level frame on + * Windows XP has lower-left insets of (4,4). The OpenGL viewport origin + * would typically begin at the lower-left corner of the client region (inside + * the frame decorations), but AWT/Swing will take the insets into account + * when rendering into that window. So in order to account for this, we + * need to adjust the OpenGL viewport origin by an x/yOffset of (-4,-4). On + * X11, top-level frames typically don't have this insets issue, so their + * x/yOffset would be (0,0) (the same applies to pbuffers). + * + * jint width/height; + * The cached surface bounds. For offscreen surface types (MTLSD_FBOBJECT, + * MTLSD_TEXTURE, etc.) these values must remain constant. Onscreen window + * surfaces (MTLSD_WINDOW, MTLSD_FLIP_BACKBUFFER, etc.) may have their + * bounds changed in response to a programmatic or user-initiated event, so + * these values represent the last known dimensions. To determine the true + * current bounds of this surface, query the native Drawable through the + * privOps field. + * + * GLuint textureID; + * The texture object handle, as generated by glGenTextures(). If this value + * is zero, the texture has not yet been initialized. + * + * jint textureWidth/Height; + * The actual bounds of the texture object for this surface. If the + * GL_ARB_texture_non_power_of_two extension is not present, the dimensions + * of an OpenGL texture object must be a power-of-two (e.g. 64x32 or 128x512). + * The texture image that we care about has dimensions specified by the width + * and height fields in this MTLSDOps structure. For example, if the image + * to be stored in the texture has dimensions 115x47, the actual OpenGL + * texture we allocate will have dimensions 128x64 to meet the pow2 + * restriction. The image bounds within the texture can be accessed using + * floating point texture coordinates in the range [0.0,1.0]. + * + * GLenum textureTarget; + * The texture target of the texture object for this surface. If this + * surface is not backed by a texture, this value is set to zero. Otherwise, + * this value is GL_TEXTURE_RECTANGLE_ARB when the GL_ARB_texture_rectangle + * extension is in use; if not, it is set to GL_TEXTURE_2D. + * + * GLint textureFilter; + * The current filter state for this texture object (can be either GL_NEAREST + * or GL_LINEAR). We cache this value here and check it before updating + * the filter state to avoid redundant calls to glTexParameteri() when the + * filter state remains constant (see the MTLSD_UPDATE_TEXTURE_FILTER() + * macro below). + * + * GLuint fbobjectID, depthID; + * The object handles for the framebuffer object and depth renderbuffer + * associated with this surface. These fields are only used when + * drawableType is MTLSD_FBOBJECT, otherwise they are zero. + */ +typedef struct { + SurfaceDataOps sdOps; + void *privOps; + jint drawableType; + jint activeBuffer; + jboolean isOpaque; + jboolean needsInit; + jint xOffset; + jint yOffset; + jint width; + jint height; + void* pTexture; + jint textureWidth; + jint textureHeight; + /* GLenum */ jint textureTarget; + /* GLint */ jint textureFilter; + /* GLuint */ jint fbobjectID; + /* GLuint */ jint depthID; +} BMTLSDOps; + +#define MTLSD_UNDEFINED sun_java2d_pipe_hw_AccelSurface_UNDEFINED +#define MTLSD_WINDOW sun_java2d_pipe_hw_AccelSurface_WINDOW +#define MTLSD_TEXTURE sun_java2d_pipe_hw_AccelSurface_TEXTURE +#define MTLSD_FLIP_BACKBUFFER sun_java2d_pipe_hw_AccelSurface_FLIP_BACKBUFFER +#define MTLSD_RT_TEXTURE sun_java2d_pipe_hw_AccelSurface_RT_TEXTURE + +/** + * These are shorthand names for the filtering method constants used by + * image transform methods. + */ +#define MTLSD_XFORM_DEFAULT 0 +#define MTLSD_XFORM_NEAREST_NEIGHBOR \ + java_awt_image_AffineTransformOp_TYPE_NEAREST_NEIGHBOR +#define MTLSD_XFORM_BILINEAR \ + java_awt_image_AffineTransformOp_TYPE_BILINEAR + +/** + * Exported methods. + */ +jint MTLSD_Lock(JNIEnv *env, + SurfaceDataOps *ops, SurfaceDataRasInfo *pRasInfo, + jint lockflags); +void MTLSD_GetRasInfo(JNIEnv *env, + SurfaceDataOps *ops, SurfaceDataRasInfo *pRasInfo); +void MTLSD_Unlock(JNIEnv *env, + SurfaceDataOps *ops, SurfaceDataRasInfo *pRasInfo); +void MTLSD_Dispose(JNIEnv *env, SurfaceDataOps *ops); +void MTLSD_Delete(JNIEnv *env, BMTLSDOps *mtlsdo); +jint MTLSD_NextPowerOfTwo(jint val, jint max); + +#endif /* MTLSurfaceDataBase_h_Included */ --- /dev/null 2019-05-16 19:17:15.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTextRenderer.h 2019-05-16 19:17:15.000000000 +0300 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef MTLTextRenderer_h_Included +#define MTLTextRenderer_h_Included + +#include +#include +#include "sun_java2d_pipe_BufferedTextPipe.h" +#include "MTLContext.h" +#include "MTLSurfaceData.h" + +#define BYTES_PER_GLYPH_IMAGE \ + sun_java2d_pipe_BufferedTextPipe_BYTES_PER_GLYPH_IMAGE +#define BYTES_PER_GLYPH_POSITION \ + sun_java2d_pipe_BufferedTextPipe_BYTES_PER_GLYPH_POSITION +#define BYTES_PER_POSITIONED_GLYPH \ + (BYTES_PER_GLYPH_IMAGE + BYTES_PER_GLYPH_POSITION) + +#define OFFSET_CONTRAST sun_java2d_pipe_BufferedTextPipe_OFFSET_CONTRAST +#define OFFSET_RGBORDER sun_java2d_pipe_BufferedTextPipe_OFFSET_RGBORDER +#define OFFSET_SUBPIXPOS sun_java2d_pipe_BufferedTextPipe_OFFSET_SUBPIXPOS +#define OFFSET_POSITIONS sun_java2d_pipe_BufferedTextPipe_OFFSET_POSITIONS + +void MTLTR_EnableGlyphVertexCache(MTLContext *mtlc); +void MTLTR_DisableGlyphVertexCache(MTLContext *mtlc); + +void MTLTR_DrawGlyphList(JNIEnv *env, MTLContext *mtlc, MTLSDOps *dstOps, + jint totalGlyphs, jboolean usePositions, + jboolean subPixPos, jboolean rgbOrder, + jint lcdContrast, + jfloat glyphListOrigX, jfloat glyphListOrigY, + unsigned char *images, unsigned char *positions); + +#endif /* MTLTextRenderer_h_Included */ --- /dev/null 2019-05-16 19:17:16.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTextRenderer.m 2019-05-16 19:17:16.000000000 +0300 @@ -0,0 +1,382 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef HEADLESS + +#include +#include +#include +#include + +#include "sun_java2d_metal_MTLTextRenderer.h" + +#include "SurfaceData.h" +#include "MTLContext.h" +#include "MTLRenderQueue.h" +#include "MTLTextRenderer.h" +#include "MTLVertexCache.h" +#include "AccelGlyphCache.h" + +/** + * The following constants define the inner and outer bounds of the + * accelerated glyph cache. + */ +#define MTLTR_CACHE_WIDTH 1024 +#define MTLTR_CACHE_HEIGHT 1024 +#define MTLTR_CACHE_CELL_WIDTH 64 +#define MTLTR_CACHE_CELL_HEIGHT 64 + +/** + * The current "glyph mode" state. This variable is used to track the + * codepath used to render a particular glyph. This variable is reset to + * MODE_NOT_INITED at the beginning of every call to MTLTR_DrawGlyphList(). + * As each glyph is rendered, the glyphMode variable is updated to reflect + * the current mode, so if the current mode is the same as the mode used + * to render the previous glyph, we can avoid doing costly setup operations + * each time. + */ +typedef enum { + MODE_NOT_INITED, + MODE_USE_CACHE_GRAY, + MODE_USE_CACHE_LCD, + MODE_NO_CACHE_GRAY, + MODE_NO_CACHE_LCD, + MODE_NO_CACHE_COLOR +} GlyphMode; +static GlyphMode glyphMode = MODE_NOT_INITED; + +/** + * There are two separate glyph caches: for AA and for LCD. + * Once one of them is initialized as either GRAY or LCD, it + * stays in that mode for the duration of the application. It should + * be safe to use this one glyph cache for all screens in a multimon + * environment, since the glyph cache texture is shared between all contexts, + * and (in theory) OpenGL drivers should be smart enough to manage that + * texture across all screens. + */ + +static GlyphCacheInfo *glyphCacheLCD = NULL; +static GlyphCacheInfo *glyphCacheAA = NULL; + +/** + * The handle to the LCD text fragment program object. + */ +static GLhandleARB lcdTextProgram = 0; + +/** + * This value tracks the previous LCD contrast setting, so if the contrast + * value hasn't changed since the last time the gamma uniforms were + * updated (not very common), then we can skip updating the unforms. + */ +static jint lastLCDContrast = -1; + +/** + * This value tracks the previous LCD rgbOrder setting, so if the rgbOrder + * value has changed since the last time, it indicates that we need to + * invalidate the cache, which may already store glyph images in the reverse + * order. Note that in most real world applications this value will not + * change over the course of the application, but tests like Font2DTest + * allow for changing the ordering at runtime, so we need to handle that case. + */ +static jboolean lastRGBOrder = JNI_TRUE; + +/** + * This constant defines the size of the tile to use in the + * MTLTR_DrawLCDGlyphNoCache() method. See below for more on why we + * restrict this value to a particular size. + */ +#define MTLTR_NOCACHE_TILE_SIZE 64 + +/** + * These constants define the size of the "cached destination" texture. + * This texture is only used when rendering LCD-optimized text, as that + * codepath needs direct access to the destination. There is no way to + * access the framebuffer directly from an OpenGL shader, so we need to first + * copy the destination region corresponding to a particular glyph into + * this cached texture, and then that texture will be accessed inside the + * shader. Copying the destination into this cached texture can be a very + * expensive operation (accounting for about half the rendering time for + * LCD text), so to mitigate this cost we try to bulk read a horizontal + * region of the destination at a time. (These values are empirically + * derived for the common case where text runs horizontally.) + * + * Note: It is assumed in various calculations below that: + * (MTLTR_CACHED_DEST_WIDTH >= MTLTR_CACHE_CELL_WIDTH) && + * (MTLTR_CACHED_DEST_WIDTH >= MTLTR_NOCACHE_TILE_SIZE) && + * (MTLTR_CACHED_DEST_HEIGHT >= MTLTR_CACHE_CELL_HEIGHT) && + * (MTLTR_CACHED_DEST_HEIGHT >= MTLTR_NOCACHE_TILE_SIZE) + */ +#define MTLTR_CACHED_DEST_WIDTH 1024 +#define MTLTR_CACHED_DEST_HEIGHT (MTLTR_CACHE_CELL_HEIGHT * 2) + +/** + * The handle to the "cached destination" texture object. + */ +static GLuint cachedDestTextureID = 0; + +/** + * The current bounds of the "cached destination" texture, in destination + * coordinate space. The width/height of these bounds will not exceed the + * MTLTR_CACHED_DEST_WIDTH/HEIGHT values defined above. These bounds are + * only considered valid when the isCachedDestValid flag is JNI_TRUE. + */ +static SurfaceDataBounds cachedDestBounds; + +/** + * This flag indicates whether the "cached destination" texture contains + * valid data. This flag is reset to JNI_FALSE at the beginning of every + * call to MTLTR_DrawGlyphList(). Once we copy valid destination data + * into the cached texture, this flag is set to JNI_TRUE. This way, we can + * limit the number of times we need to copy destination data, which is a + * very costly operation. + */ +static jboolean isCachedDestValid = JNI_FALSE; + +/** + * The bounds of the previously rendered LCD glyph, in destination + * coordinate space. We use these bounds to determine whether the glyph + * currently being rendered overlaps the previously rendered glyph (i.e. + * its bounding box intersects that of the previously rendered glyph). If + * so, we need to re-read the destination area associated with that previous + * glyph so that we can correctly blend with the actual destination data. + */ +static SurfaceDataBounds previousGlyphBounds; + +/** + * Initializes the one glyph cache (texture and data structure). + * If lcdCache is JNI_TRUE, the texture will contain RGB data, + * otherwise we will simply store the grayscale/monochrome glyph images + * as intensity values (which work well with the GL_MODULATE function). + */ +static jboolean +MTLTR_InitGlyphCache(jboolean lcdCache) +{ + //TODO + J2dTraceNotImplPrimitive("MTLTR_InitGlyphCache"); + + return JNI_TRUE; +} + +/** + * Adds the given glyph to the glyph cache (texture and data structure) + * associated with the given MTLContext. + */ +static void +MTLTR_AddTmTLyphCache(GlyphInfo *glyph, GLenum pixelFormat) +{ + //TODO + J2dTraceNotImplPrimitive("MTLTR_AddTmTLyphCache"); + + CacheCellInfo *ccinfo; + GlyphCacheInfo *gcinfo; + + J2dTraceLn(J2D_TRACE_INFO, "MTLTR_AddTmTLyphCache"); + J2dTracePrimitive("MTLTR_InitGlyphCache"); +} + +/** + * (Re)Initializes the gamma related uniforms. + * + * The given contrast value is an int in the range [100, 250] which we will + * then scale to fit in the range [1.0, 2.5]. + */ +static jboolean +MTLTR_UpdateLCDTextContrast(jint contrast) +{ + //TODO + J2dTraceNotImplPrimitive("MTLTR_UpdateLCDTextContrast"); + return JNI_TRUE; +} + +/** + * Updates the current gamma-adjusted source color ("src_adj") of the LCD + * text shader program. Note that we could calculate this value in the + * shader (e.g. just as we do for "dst_adj"), but would be unnecessary work + * (and a measurable performance hit, maybe around 5%) since this value is + * constant over the entire glyph list. So instead we just calculate the + * gamma-adjusted value once and update the uniform parameter of the LCD + * shader as needed. + */ +static jboolean +MTLTR_UpdateLCDTextColor(jint contrast) +{ + //TODO + J2dTraceNotImplPrimitive("MTLTR_UpdateLCDTextColor"); + return JNI_TRUE; +} + +/** + * Enables the LCD text shader and updates any related state, such as the + * gamma lookup table textures. + */ +static jboolean +MTLTR_EnableLCDGlyphModeState(GLuint glyphTextureID, + GLuint dstTextureID, + jint contrast) +{ + //TODO + J2dTraceNotImplPrimitive("MTLTR_EnableLCDGlyphModeState"); + return JNI_TRUE; +} + +void +MTLTR_EnableGlyphVertexCache(MTLContext *mtlc) +{ + //TODO + J2dTraceNotImplPrimitive("MTLTR_EnableGlyphVertexCache"); +} + +void +MTLTR_DisableGlyphVertexCache(MTLContext *mtlc) +{ + //TODO + J2dTraceLn(J2D_TRACE_INFO, "MTLTR_DisableGlyphVertexCache"); + J2dTraceNotImplPrimitive("MTLTR_DisableGlyphVertexCache"); + +} + +/** + * Disables any pending state associated with the current "glyph mode". + */ +void +MTLTR_DisableGlyphModeState() +{ + //TODO + J2dTraceNotImplPrimitive("MTLTR_DisableGlyphModeState"); + J2dTraceLn1(J2D_TRACE_VERBOSE, + "MTLTR_DisableGlyphModeState: mode=%d", glyphMode); +} + +static jboolean +MTLTR_DrawGrayscaleGlyphViaCache(MTLContext *mtlc, + GlyphInfo *ginfo, jint x, jint y) +{ + //TODO + J2dTraceNotImplPrimitive("MTLTR_DisableGlyphVertexCache"); + return JNI_TRUE; +} + +/** + * Evaluates to true if the rectangle defined by gx1/gy1/gx2/gy2 is + * inside outerBounds. + */ +#define INSIDE(gx1, gy1, gx2, gy2, outerBounds) \ + (((gx1) >= outerBounds.x1) && ((gy1) >= outerBounds.y1) && \ + ((gx2) <= outerBounds.x2) && ((gy2) <= outerBounds.y2)) + +/** + * Evaluates to true if the rectangle defined by gx1/gy1/gx2/gy2 intersects + * the rectangle defined by bounds. + */ +#define INTERSECTS(gx1, gy1, gx2, gy2, bounds) \ + ((bounds.x2 > (gx1)) && (bounds.y2 > (gy1)) && \ + (bounds.x1 < (gx2)) && (bounds.y1 < (gy2))) + +/** + * This method checks to see if the given LCD glyph bounds fall within the + * cached destination texture bounds. If so, this method can return + * immediately. If not, this method will copy a chunk of framebuffer data + * into the cached destination texture and then update the current cached + * destination bounds before returning. + */ +static void +MTLTR_UpdateCachedDestination(MTLSDOps *dstOps, GlyphInfo *ginfo, + jint gx1, jint gy1, jint gx2, jint gy2, + jint glyphIndex, jint totalGlyphs) +{ + //TODO + J2dTraceNotImplPrimitive("MTLTR_UpdateCachedDestination"); +} + +static jboolean +MTLTR_DrawLCDGlyphViaCache(MTLContext *mtlc, MTLSDOps *dstOps, + GlyphInfo *ginfo, jint x, jint y, + jint glyphIndex, jint totalGlyphs, + jboolean rgbOrder, jint contrast, + jint dstTextureID, jboolean * opened) +{ + //TODO + J2dTraceNotImplPrimitive("MTLTR_DrawLCDGlyphViaCache"); + return JNI_TRUE; +} + +static jboolean +MTLTR_DrawGrayscaleGlyphNoCache(MTLContext *mtlc, + GlyphInfo *ginfo, jint x, jint y) +{ + //TODO + J2dTraceNotImplPrimitive("MTLTR_DrawGrayscaleGlyphNoCache"); + return JNI_TRUE; +} + +static jboolean +MTLTR_DrawLCDGlyphNoCache(MTLContext *mtlc, MTLSDOps *dstOps, + GlyphInfo *ginfo, jint x, jint y, + jint rowBytesOffset, + jboolean rgbOrder, jint contrast, + jint dstTextureID) +{ + //TODO + J2dTraceNotImplPrimitive("MTLTR_DrawLCDGlyphNoCache"); + return JNI_TRUE; +} + +static jboolean +MTLTR_DrawColorGlyphNoCache(MTLContext *mtlc, GlyphInfo *ginfo, jint x, jint y) +{ + //TODO + J2dTraceNotImplPrimitive("MTLTR_DrawColorGlyphNoCache"); + return JNI_TRUE; +} + + +// see DrawGlyphList.c for more on this macro... +#define FLOOR_ASSIGN(l, r) \ + if ((r)<0) (l) = ((int)floor(r)); else (l) = ((int)(r)) + +void +MTLTR_DrawGlyphList(JNIEnv *env, MTLContext *mtlc, MTLSDOps *dstOps, + jint totalGlyphs, jboolean usePositions, + jboolean subPixPos, jboolean rgbOrder, jint lcdContrast, + jfloat glyphListOrigX, jfloat glyphListOrigY, + unsigned char *images, unsigned char *positions) +{ + //TODO + J2dTraceNotImplPrimitive("MTLTR_DrawGlyphList"); +} + +JNIEXPORT void JNICALL +Java_sun_java2d_metal_MTLTextRenderer_drawGlyphList + (JNIEnv *env, jobject self, + jint numGlyphs, jboolean usePositions, + jboolean subPixPos, jboolean rgbOrder, jint lcdContrast, + jfloat glyphListOrigX, jfloat glyphListOrigY, + jlongArray imgArray, jfloatArray posArray) +{ + //TODO + J2dTraceNotImplPrimitive("MTLTextRenderer_drawGlyphList"); +} + +#endif /* !HEADLESS */ --- /dev/null 2019-05-16 19:17:17.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTexturePool.h 2019-05-16 19:17:17.000000000 +0300 @@ -0,0 +1,37 @@ +#ifndef MTLTexturePool_h_Included +#define MTLTexturePool_h_Included +#import + +@interface MTLTexturePoolItem : NSObject +{ +@private + +id texture; +bool isBusy; +} + +@property (readwrite, retain) id texture; +@property (readwrite, assign) bool isBusy; + +- (id) initWithTexture:(id)tex; +@end + +// NOTE: owns all MTLTexture objects +@interface MTLTexturePool : NSObject +{ +@private + +id device; +NSMutableArray * pool; +} + +@property (readwrite, assign) id device; +@property (readwrite, retain) NSMutableArray * pool; + +- (id) initWithDevice:(id)device; +- (id) getTexture:(int)width height:(int)height format:(MTLPixelFormat)format; +- (void) markTextureFree:(id)texture; +- (void) markAllTexturesFree; +@end + +#endif /* MTLTexturePool_h_Included */ --- /dev/null 2019-05-16 19:17:18.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLTexurePool.m 2019-05-16 19:17:18.000000000 +0300 @@ -0,0 +1,92 @@ +#import "MTLTexturePool.h" +#import "Trace.h" + +@implementation MTLTexturePoolItem + +@synthesize texture; +@synthesize isBusy; + +- (id) initWithTexture:(id)tex { + self = [super init]; + if (self == nil) return self; + self.texture = tex; + isBusy = NO; + return self; +} +@end + +@implementation MTLTexturePool + +@synthesize device; +@synthesize pool; + +- (id) initWithDevice:(id)dev { + self = [super init]; + if (self == nil) return self; + + self.device = dev; + self.pool = [NSMutableArray arrayWithCapacity:10]; + return self; +} + +// NOTE: called from RQ-thread (on blit operations) +- (id) getTexture:(int)width height:(int)height format:(MTLPixelFormat)format { + @synchronized (self) { + // 1. find free item + // TODO: optimize search, use Map<(w,h,pf), TexPoolItem> + const int count = [self.pool count]; + for (int c = 0; c < count; ++c) { + MTLTexturePoolItem *tpi = [self.pool objectAtIndex:c]; + if (tpi == nil) + continue; + // TODO: use checks tpi.texture.width <= width && tpi.texture.height <= height + if (tpi.texture.width == width && tpi.texture.height == height && tpi.texture.pixelFormat == format && + !tpi.isBusy) { + tpi.isBusy = YES; + return tpi.texture; + } + } + + // 2. create + MTLTextureDescriptor *textureDescriptor = [MTLTextureDescriptor texture2DDescriptorWithPixelFormat:format width:width height:height mipmapped:NO]; + id tex = [self.device newTextureWithDescriptor:textureDescriptor]; + MTLTexturePoolItem *tpi = [[MTLTexturePoolItem alloc] initWithTexture:tex]; + [self.pool addObject:tpi]; + J2dTraceLn4(J2D_TRACE_VERBOSE, "MTLTexturePool: created pool item: tex=%p, w=%d h=%d, pf=%d", tex, width, height, format); + return tpi.texture; + } +}; + +// NOTE: called from completion-handler (pooled thread) +- (void) markTextureFree:(id)texture { + // TODO: optimize search, use Map<(w,h,pf), TexPoolItem> + @synchronized (self) { + const int count = [self.pool count]; + for (int c = 0; c < count; ++c) { + MTLTexturePoolItem * tpi = [self.pool objectAtIndex:c]; + if (tpi == nil) + continue; + if (tpi.texture == texture) { + tpi.isBusy = NO; + return; + } + } + J2dTraceLn1(J2D_TRACE_ERROR, "MTLTexturePool: can't find item with texture %p", texture); + } +} + +// NOTE: called from completion-handler (pooled thread) +- (void) markAllTexturesFree { + @synchronized (self) { + const int count = [self.pool count]; + for (int c = 0; c < count; ++c) { + MTLTexturePoolItem *tpi = [self.pool objectAtIndex:c]; + if (tpi == nil) + continue; + tpi.isBusy = NO; + } + } +} + + +@end \ No newline at end of file --- /dev/null 2019-05-16 19:17:20.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLUtils.h 2019-05-16 19:17:19.000000000 +0300 @@ -0,0 +1,6 @@ +#ifndef MTLUtils_h_Included +#define MTLUtils_h_Included + +#import + +#endif /* MTLUtils_h_Included */ --- /dev/null 2019-05-16 19:17:21.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLUtils.m 2019-05-16 19:17:20.000000000 +0300 @@ -0,0 +1,47 @@ +#include "MTLUtils.h" + +#include +#include +#include "common.h" +#include "Trace.h" + +extern void J2dTraceImpl(int level, jboolean cr, const char *string, ...); +void J2dTraceTraceVector(simd_float4 pt) { + J2dTraceImpl(J2D_TRACE_VERBOSE, JNI_FALSE, "[%lf %lf %lf %lf]", pt.x, pt.y, pt.z, pt.w); +} + +void checkTransform(float * position, simd_float4x4 transform4x4) { + J2dTraceImpl(J2D_TRACE_VERBOSE, JNI_FALSE, "check transform: "); + + simd_float4 fpt = simd_make_float4(position[0], position[1], position[2], 1.f); + simd_float4 fpt_trans = simd_mul(transform4x4, fpt); + J2dTraceTraceVector(fpt); + J2dTraceImpl(J2D_TRACE_VERBOSE, JNI_FALSE, " ===>>> "); + J2dTraceTraceVector(fpt_trans); + J2dTraceLn(J2D_TRACE_VERBOSE, " "); +} + +static void traceMatrix(simd_float4x4 * mtx) { + for (int row = 0; row < 4; ++row) { + J2dTraceLn4(J2D_TRACE_VERBOSE, " [%lf %lf %lf %lf]", + mtx->columns[0][row], mtx->columns[1][row], mtx->columns[2][row], mtx->columns[3][row]); + } +} + +void traceRaster(char * p, int width, int height, int stride) { + for (int y = 0; y < height; ++y) { + for (int x = 0; x < width; ++x) { + char pix0 = p[y*stride + x*4]; + char pix1 = p[y*stride + x*4 + 1]; + char pix2 = p[y*stride + x*4 + 2]; + char pix3 = p[y*stride + x*4 + 3]; + J2dTrace4(J2D_TRACE_INFO, "[%d,%d,%d,%d], ", pix0, pix1, pix2, pix3); + } + J2dTraceLn(J2D_TRACE_INFO, ""); + } +} + +void tracePoints(jint nPoints, jint *xPoints, jint *yPoints) { + for (int i = 0; i < nPoints; i++) + J2dTraceLn2(J2D_TRACE_INFO, "\t(%d, %d)", *(xPoints++), *(yPoints++)); +} --- /dev/null 2019-05-16 19:17:22.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLVertexCache.h 2019-05-16 19:17:22.000000000 +0300 @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef MTLVertexCache_h_Included +#define MTLVertexCache_h_Included + +#include "j2d_md.h" +#include "MTLContext.h" + +/** + * Constants that control the size of the vertex cache. + */ +#define MTLVC_MAX_INDEX 1024 + +/** + * Constants that control the size of the texture tile cache used for + * mask operations. + */ +#define MTLVC_MASK_CACHE_TILE_WIDTH 32 +#define MTLVC_MASK_CACHE_TILE_HEIGHT 32 +#define MTLVC_MASK_CACHE_TILE_SIZE \ + (MTLVC_MASK_CACHE_TILE_WIDTH * MTLVC_MASK_CACHE_TILE_HEIGHT) + +#define MTLVC_MASK_CACHE_WIDTH_IN_TILES 8 +#define MTLVC_MASK_CACHE_HEIGHT_IN_TILES 4 + +#define MTLVC_MASK_CACHE_WIDTH_IN_TEXELS \ + (MTLVC_MASK_CACHE_TILE_WIDTH * MTLVC_MASK_CACHE_WIDTH_IN_TILES) +#define MTLVC_MASK_CACHE_HEIGHT_IN_TEXELS \ + (MTLVC_MASK_CACHE_TILE_HEIGHT * MTLVC_MASK_CACHE_HEIGHT_IN_TILES) + +/* + * We reserve one (fully opaque) tile in the upper-right corner for + * operations where the mask is null. + */ +#define MTLVC_MASK_CACHE_MAX_INDEX \ + ((MTLVC_MASK_CACHE_WIDTH_IN_TILES * MTLVC_MASK_CACHE_HEIGHT_IN_TILES) - 1) +#define MTLVC_MASK_CACHE_SPECIAL_TILE_X \ + (MTLVC_MASK_CACHE_WIDTH_IN_TEXELS - MTLVC_MASK_CACHE_TILE_WIDTH) +#define MTLVC_MASK_CACHE_SPECIAL_TILE_Y \ + (MTLVC_MASK_CACHE_HEIGHT_IN_TEXELS - MTLVC_MASK_CACHE_TILE_HEIGHT) + +/** + * Exported methods. + */ +jboolean MTLVertexCache_InitVertexCache(MTLContext *mtlc); +void MTLVertexCache_FlushVertexCache(); +void MTLVertexCache_RestoreColorState(MTLContext *mtlc); + +void MTLVertexCache_EnableMaskCache(MTLContext *mtlc); +void MTLVertexCache_DisableMaskCache(MTLContext *mtlc); +void MTLVertexCache_AddMaskQuad(MTLContext *mtlc, + jint srcx, jint srcy, + jint dstx, jint dsty, + jint width, jint height, + jint maskscan, void *mask); + +void MTLVertexCache_AddGlyphQuad(MTLContext *mtlc, + jfloat tx1, jfloat ty1, + jfloat tx2, jfloat ty2, + jfloat dx1, jfloat dy1, + jfloat dx2, jfloat dy2); + +#endif /* MTLVertexCache_h_Included */ --- /dev/null 2019-05-16 19:17:23.000000000 +0300 +++ new/src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLVertexCache.m 2019-05-16 19:17:23.000000000 +0300 @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef HEADLESS + +#include +#include + +#include "sun_java2d_SunGraphics2D.h" + +#include "MTLPaints.h" +#include "MTLVertexCache.h" + +typedef struct _J2DVertex { + jfloat tx, ty; + jubyte r, g, b, a; + jfloat dx, dy; +} J2DVertex; + +static J2DVertex *vertexCache = NULL; +static jint vertexCacheIndex = 0; + +static jint maskCacheTexID = 0; +static jint maskCacheIndex = 0; + +#define MTLVC_ADD_VERTEX(TX, TY, R, G, B, A, DX, DY) \ + do { \ + J2DVertex *v = &vertexCache[vertexCacheIndex++]; \ + v->tx = TX; \ + v->ty = TY; \ + v->r = R; \ + v->g = G; \ + v->b = B; \ + v->a = A; \ + v->dx = DX; \ + v->dy = DY; \ + } while (0) + +#define MTLVC_ADD_QUAD(TX1, TY1, TX2, TY2, DX1, DY1, DX2, DY2, R, G, B, A) \ + do { \ + MTLVC_ADD_VERTEX(TX1, TY1, R, G, B, A, DX1, DY1); \ + MTLVC_ADD_VERTEX(TX2, TY1, R, G, B, A, DX2, DY1); \ + MTLVC_ADD_VERTEX(TX2, TY2, R, G, B, A, DX2, DY2); \ + MTLVC_ADD_VERTEX(TX1, TY2, R, G, B, A, DX1, DY2); \ + } while (0) + +jboolean +MTLVertexCache_InitVertexCache(MTLContext *mtlc) +{ + //TODO + J2dTraceNotImplPrimitive("MTLVertexCache_InitVertexCache"); + J2dTraceLn(J2D_TRACE_INFO, "MTLVertexCache_InitVertexCache"); + return JNI_TRUE; +} + +void +MTLVertexCache_FlushVertexCache() +{ + // TODO + J2dTraceNotImplPrimitive("MTLVertexCache_FlushVertexCache"); + J2dTraceLn(J2D_TRACE_INFO, "MTLVertexCache_FlushVertexCache"); + vertexCacheIndex = 0; +} + +/** + * This method is somewhat hacky, but necessary for the foreseeable future. + * The problem is the way OpenGL handles color values in vertex arrays. When + * a vertex in a vertex array contains a color, and then the vertex array + * is rendered via glDrawArrays(), the global OpenGL color state is actually + * modified each time a vertex is rendered. This means that after all + * vertices have been flushed, the global OpenGL color state will be set to + * the color of the most recently rendered element in the vertex array. + * + * The reason this is a problem for us is that we do not want to flush the + * vertex array (in the case of mask/glyph operations) or issue a glEnd() + * (in the case of non-antialiased primitives) everytime the current color + * changes, which would defeat any benefit from batching in the first place. + * We handle this in practice by not calling CHECK/RESET_PREVIOUS_OP() when + * the simple color state is changing in MTLPaints_SetColor(). This is + * problematic for vertex caching because we may end up with the following + * situation, for example: + * SET_COLOR (orange) + * MASK_FILL + * MASK_FILL + * SET_COLOR (blue; remember, this won't cause a flush) + * FILL_RECT (this will cause the vertex array to be flushed) + * + * In this case, we would actually end up rendering an orange FILL_RECT, + * not a blue one as intended, because flushing the vertex cache flush would + * override the color state from the most recent SET_COLOR call. + * + * Long story short, the easiest way to resolve this problem is to call + * this method just after disabling the mask/glyph cache, which will ensure + * that the appropriate color state is restored. + */ +void +MTLVertexCache_RestoreColorState(MTLContext *mtlc) +{ + // TODO + J2dTraceNotImplPrimitive("MTLVertexCache_RestoreColorState"); + if (mtlc.paintState == sun_java2d_SunGraphics2D_PAINT_ALPHACOLOR) { + [mtlc setColor:mtlc.pixel]; + } +} + +static jboolean +MTLVertexCache_InitMaskCache() +{ + // TODO + J2dTraceNotImplPrimitive("MTLVertexCache_InitMaskCache"); + J2dTraceLn(J2D_TRACE_INFO, "MTLVertexCache_InitMaskCache"); + return JNI_TRUE; +} + +void +MTLVertexCache_EnableMaskCache(MTLContext *mtlc) +{ + // TODO + J2dTraceNotImplPrimitive("MTLVertexCache_EnableMaskCache"); + J2dTraceLn(J2D_TRACE_INFO, "MTLVertexCache_EnableMaskCache"); +} + +void +MTLVertexCache_DisableMaskCache(MTLContext *mtlc) +{ + // TODO + J2dTraceNotImplPrimitive("MTLVertexCache_DisableMaskCache"); + J2dTraceLn(J2D_TRACE_INFO, "MTLVertexCache_DisableMaskCache"); + maskCacheIndex = 0; +} + +void +MTLVertexCache_AddMaskQuad(MTLContext *mtlc, + jint srcx, jint srcy, + jint dstx, jint dsty, + jint width, jint height, + jint maskscan, void *mask) +{ + // TODO + J2dTraceNotImplPrimitive("MTLVertexCache_AddMaskQuad"); +} + +void +MTLVertexCache_AddGlyphQuad(MTLContext *mtlc, + jfloat tx1, jfloat ty1, jfloat tx2, jfloat ty2, + jfloat dx1, jfloat dy1, jfloat dx2, jfloat dy2) +{ + // TODO + J2dTraceNotImplPrimitive("MTLVertexCache_AddGlyphQuad"); + J2dTraceLn(J2D_TRACE_INFO, "MTLVertexCache_AddGlyphQuad"); +} + +#endif /* !HEADLESS */ --- /dev/null 2019-05-16 19:17:24.000000000 +0300 +++ new/test/jdk/jbu/perf/metal/MetalPerfTest.java 2019-05-16 19:17:24.000000000 +0300 @@ -0,0 +1,654 @@ +/* + * Copyright 2019 JetBrains s.r.o. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package perf.metal; + +import org.junit.Test; + +import javax.imageio.ImageIO; +import javax.swing.*; +import java.awt.*; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.geom.AffineTransform; +import java.awt.geom.Point2D; +import java.awt.geom.QuadCurve2D; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.atomic.AtomicBoolean; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +public class MetalPerfTest { + private final static int N = 500; + private final static float WIDTH = 800; + private final static float HEIGHT = 800; + private final static float R = 25; + private final static int BW = 50; + private final static int BH = 50; + private final static int COUNT = 300; + private final static int DELAY = 10; + private final static int RESOLUTION = 5; + private final static int COLOR_TOLERANCE = 10; + + + interface Renderable { + void render(Graphics2D g2d); + void update(); + } + + static class Particles { + private float[] bx; + private float[] by; + private float[] vx; + private float[] vy; + private float r; + private int n; + + private float x0; + private float y0; + private float width; + private float height; + + Particles(int n, float r, float x0, float y0, float width, float height) { + bx = new float[n]; + by = new float[n]; + vx = new float[n]; + vy = new float[n]; + this.n = n; + this.r = r; + this.x0 = x0; + this.y0 = y0; + this.width = width; + this.height = height; + for (int i = 0; i < n; i++) { + bx[i] = (float) (x0 + r + 0.1 + Math.random() * (width - 2 * r - 0.2 - x0)); + by[i] = (float) (y0 + r + 0.1 + Math.random() * (height - 2 * r - 0.2 - y0)); + vx[i] = 0.1f * (float) (Math.random() * 2 * r - r); + vy[i] = 0.1f * (float) (Math.random() * 2 * r - r); + } + + } + + void render(Graphics2D g2d, ParticleRenderer renderer) { + for (int i = 0; i < n; i++) { + renderer.render(g2d, i, bx, by, vx, vy); + } + } + + void update() { + for (int i = 0; i < n; i++) { + bx[i] += vx[i]; + if (bx[i] + r > width || bx[i] - r < x0) vx[i] = -vx[i]; + by[i] += vy[i]; + if (by[i] + r > height || by[i] - r < y0) vy[i] = -vy[i]; + } + + } + } + + interface ParticleRenderer { + void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy); + + } + + static class FlatParticleRenderer implements ParticleRenderer { + Color[] colors; + float r; + + FlatParticleRenderer(int n, float r) { + colors = new Color[n]; + this.r = r; + for (int i = 0; i < n; i++) { + colors[i] = new Color((float) Math.random(), + (float) Math.random(), (float) Math.random()); + } + } + + @Override + public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) { + g2d.setColor(colors[id % colors.length]); + g2d.fillOval((int)(x[id] - r), (int)(y[id] - r), (int)(2*r), (int)(2*r)); + } + + } + + static class FlatOvalRotParticleRenderer extends FlatParticleRenderer { + + + FlatOvalRotParticleRenderer(int n, float r) { + super(n, r); + } + + void setPaint(Graphics2D g2d, int id) { + g2d.setColor(colors[id % colors.length]); + } + + @Override + public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) { + setPaint(g2d, id); + if (Math.abs(vx[id] + vy[id]) > 0.001) { + AffineTransform t = (AffineTransform) g2d.getTransform().clone(); + double l = vx[id] / Math.sqrt(vx[id] * vx[id] + vy[id] * vy[id]); + if (vy[id] < 0) { + l = -l; + } + g2d.translate(x[id], y[id]); + g2d.rotate(Math.acos(l)); + g2d.fillOval(-(int)r, (int)(-0.5*r), (int) (2 * r), (int)r); + g2d.setTransform(t); + } else { + g2d.fillOval((int)(x[id] - r), (int)(y[id] - 0.5*r), + (int) (2 * r), (int) r); + } + } + } + + static class LinGradOvalRotParticleRenderer extends FlatOvalRotParticleRenderer { + + + LinGradOvalRotParticleRenderer(int n, float r) { + super(n, r); + } + + @Override + void setPaint(Graphics2D g2d, int id) { + Point2D start = new Point2D.Double(- r, - 0.5*r); + Point2D end = new Point2D.Double( 2 * r, r); + float[] dist = {0.0f, 1.0f}; + Color[] cls = {colors[id %colors.length], colors[(colors.length - id) %colors.length]}; + LinearGradientPaint p = + new LinearGradientPaint(start, end, dist, cls); + g2d.setPaint(p); + } + } + + static class FlatBoxParticleRenderer extends FlatParticleRenderer { + + + FlatBoxParticleRenderer(int n, float r) { + super(n, r); + } + @Override + public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) { + g2d.setColor(colors[id % colors.length]); + g2d.fillRect((int)(x[id] - r), (int)(y[id] - r), (int)(2*r), (int)(2*r)); + + } + + } + + static class ImgParticleRenderer extends FlatParticleRenderer { + BufferedImage dukeImg; + + ImgParticleRenderer(int n, float r) { + super(n, r); + String testDataStr = System.getProperty("testdata"); + assertNotNull("testdata property is not set", testDataStr); + + File testData = new File(testDataStr, "perf" + File.separator + "metal"); + assertTrue("Test data dir does not exist", testData.exists()); + File dukeFile = new File(testData, "duke.png"); + + if (!dukeFile.exists()) throw new RuntimeException(dukeFile.toString() + " not found"); + + try { + dukeImg = ImageIO.read(dukeFile); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @Override + public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) { + g2d.setColor(colors[id % colors.length]); + g2d.drawImage(dukeImg, (int)(x[id] - r), (int)(y[id] - r), (int)(2*r), (int)(2*r), null); + } + + } + + static class FlatBoxRotParticleRenderer extends FlatParticleRenderer { + + + FlatBoxRotParticleRenderer(int n, float r) { + super(n, r); + } + @Override + public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) { + g2d.setColor(colors[id % colors.length]); + if (Math.abs(vx[id] + vy[id]) > 0.001) { + AffineTransform t = (AffineTransform) g2d.getTransform().clone(); + double l = vx[id] / Math.sqrt(vx[id] * vx[id] + vy[id] * vy[id]); + if (vy[id] < 0) { + l = -l; + } + g2d.translate(x[id], y[id]); + g2d.rotate(Math.acos(l)); + g2d.fillRect(-(int)r, -(int)r, (int) (2 * r), (int) (2 * r)); + g2d.setTransform(t); + } else { + g2d.fillRect((int)(x[id] - r), (int)(y[id] - r), + (int) (2 * r), (int) (2 * r)); + } + } + } + + static class WiredParticleRenderer extends FlatParticleRenderer { + + + WiredParticleRenderer(int n, float r) { + super(n, r); + } + @Override + public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) { + g2d.setColor(colors[id % colors.length]); + g2d.drawOval((int)(x[id] - r), (int)(y[id] - r), (int)(2*r), (int)(2*r)); + } + + } + static class WiredBoxParticleRenderer extends FlatParticleRenderer { + + WiredBoxParticleRenderer(int n, float r) { + super(n, r); + } + + @Override + public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) { + g2d.setColor(colors[id % colors.length]); + g2d.drawRect((int)(x[id] - r), (int)(y[id] - r), (int)(2*r), (int)(2*r)); + } + + } + static class SegParticleRenderer extends FlatParticleRenderer { + + SegParticleRenderer(int n, float r) { + super(n, r); + } + + @Override + public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) { + double v = Math.sqrt(vx[id]*vx[id]+vy[id]*vy[id]); + float nvx = (float) (vx[id]/v); + float nvy = (float) (vy[id]/v); + g2d.setColor(colors[id % colors.length]); + g2d.drawLine((int)(x[id] - r*nvx), (int)(y[id] - r*nvy), + (int)(x[id] + 2*r*nvx), (int)(y[id] + 2*r*nvy)); + } + + } + + + static class WiredQuadParticleRenderer extends FlatParticleRenderer { + + WiredQuadParticleRenderer(int n, float r) { + super(n, r); + } + + @Override + public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) { + if (id > 2 && (id % 3) == 0) { + g2d.setColor(colors[id % colors.length]); + g2d.draw(new QuadCurve2D.Float(x[id-3], y[id-3], x[id-2], y[id-2], x[id-1], y[id-1])); + } + + } + } + + static class FlatQuadParticleRenderer extends FlatParticleRenderer { + + FlatQuadParticleRenderer(int n, float r) { + super(n, r); + } + + @Override + public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) { + if (id > 2 && (id % 3) == 0) { + g2d.setColor(colors[id % colors.length]); + g2d.fill(new QuadCurve2D.Float(x[id-3], y[id-3], x[id-2], y[id-2], x[id-1], y[id-1])); + } + + } + } + + class PerfMeter { + + private int frame = 0; + + private JPanel panel; + + private long time; + private double execTime = 0; + private Color expColor = Color.RED; + AtomicBoolean waiting = new AtomicBoolean(false); + + double exec(final Renderable renderable) throws Exception{ + final CountDownLatch latch = new CountDownLatch(COUNT); + final CountDownLatch latchFrame = new CountDownLatch(1); + + final JFrame f = new JFrame(); + f.addWindowListener(new WindowAdapter() { + @Override + public void windowClosed(WindowEvent e) { + latchFrame.countDown(); + } + }); + + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + + panel = new JPanel() + { + @Override + protected void paintComponent(Graphics g) { + + super.paintComponent(g); + time = System.nanoTime(); + Graphics2D g2d = (Graphics2D) g; + renderable.render(g2d); + g2d.setColor(expColor); + g.fillRect(0, 0, BW, BH); + } + }; + + panel.setPreferredSize(new Dimension((int)(WIDTH + BW), (int)(HEIGHT + BH))); + panel.setBackground(Color.BLACK); + f.add(panel); + f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + f.pack(); + f.setVisible(true); + } + }); + Robot robot = new Robot(); + + Timer timer = new Timer(DELAY, e -> { + + if (waiting.compareAndSet(false, true)) { + Color c = robot.getPixelColor(panel.getTopLevelAncestor().getX() + 25, + panel.getTopLevelAncestor().getY() + 25); + if (isAlmostEqual(c, Color.BLUE)) { + expColor = Color.RED; + } else { + expColor = Color.BLUE; + } + renderable.update(); + panel.getParent().repaint(); + + } else { + while (!isAlmostEqual( + robot.getPixelColor( + panel.getTopLevelAncestor().getX() + BW / 2, + panel.getTopLevelAncestor().getY() + BH / 2), + expColor)) + { + try { + Thread.sleep(RESOLUTION); + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + } + time = System.nanoTime() - time; + execTime += time; + frame++; + waiting.set(false); + } + + latch.countDown(); + }); + timer.start(); + latch.await(); + SwingUtilities.invokeAndWait(() -> { + timer.stop(); + f.setVisible(false); + f.dispose(); + }); + + latchFrame.await(); + return 1e9/(execTime / frame); + } + + private boolean isAlmostEqual(Color c1, Color c2) { + return Math.abs(c1.getRed() - c2.getRed()) < COLOR_TOLERANCE || + Math.abs(c1.getGreen() - c2.getGreen()) < COLOR_TOLERANCE || + Math.abs(c1.getBlue() - c2.getBlue()) < COLOR_TOLERANCE; + + } + } + + private static final Particles balls = new Particles(N, R, BW, BH, WIDTH, HEIGHT); + private static final ParticleRenderer flatRenderer = new FlatParticleRenderer(N, R); + private static final ParticleRenderer flatOvalRotRenderer = new FlatOvalRotParticleRenderer(N, R); + private static final ParticleRenderer flatBoxRenderer = new FlatBoxParticleRenderer(N, R); + private static final ParticleRenderer flatBoxRotRenderer = new FlatBoxRotParticleRenderer(N, R); + private static final ParticleRenderer linGradOvalRotRenderer = new LinGradOvalRotParticleRenderer(N, R); + private static final ParticleRenderer wiredRenderer = new WiredParticleRenderer(N, R); + private static final ParticleRenderer wiredBoxRenderer = new WiredBoxParticleRenderer(N, R); + private static final ParticleRenderer segRenderer = new SegParticleRenderer(N, R); + private static final ParticleRenderer flatQuadRenderer = new FlatQuadParticleRenderer(N, R); + private static final ParticleRenderer wiredQuadRenderer = new WiredQuadParticleRenderer(N, R); + private static final ParticleRenderer imgRenderer = new ImgParticleRenderer(N, R); + + + @Test + public void testFlatBubbles() throws Exception { + + double fps = (new PerfMeter()).exec(new Renderable() { + @Override + public void render(Graphics2D g2d) { + balls.render(g2d, flatRenderer); + } + + @Override + public void update() { + balls.update(); + } + }); + + System.out.println(fps); + } + + @Test + public void testFlatBoxBubbles() throws Exception { + + double fps = (new PerfMeter()).exec(new Renderable() { + @Override + public void render(Graphics2D g2d) { + balls.render(g2d, flatBoxRenderer); + } + + @Override + public void update() { + balls.update(); + } + }); + + System.out.println(fps); + } + + @Test + public void testImgBubbles() throws Exception { + + double fps = (new PerfMeter()).exec(new Renderable() { + @Override + public void render(Graphics2D g2d) { + balls.render(g2d, imgRenderer); + } + + @Override + public void update() { + balls.update(); + } + }); + + System.out.println(fps); + } + + @Test + public void testFlatBoxRotBubbles() throws Exception { + + double fps = (new PerfMeter()).exec(new Renderable() { + @Override + public void render(Graphics2D g2d) { + balls.render(g2d, flatBoxRotRenderer); + } + + @Override + public void update() { + balls.update(); + } + }); + + System.out.println(fps); + } + + @Test + public void testFlatOvalRotBubbles() throws Exception { + + double fps = (new PerfMeter()).exec(new Renderable() { + @Override + public void render(Graphics2D g2d) { + balls.render(g2d, flatOvalRotRenderer); + } + + @Override + public void update() { + balls.update(); + } + }); + + System.out.println(fps); + } + + @Test + public void testLinGradOvalRotBubbles() throws Exception { + + double fps = (new PerfMeter()).exec(new Renderable() { + @Override + public void render(Graphics2D g2d) { + balls.render(g2d, linGradOvalRotRenderer); + } + + @Override + public void update() { + balls.update(); + } + }); + + System.out.println(fps); + } + + + @Test + public void testWiredBubbles() throws Exception { + + double fps = (new PerfMeter()).exec(new Renderable() { + @Override + public void render(Graphics2D g2d) { + balls.render(g2d, wiredRenderer); + } + + @Override + public void update() { + balls.update(); + } + }); + + System.out.println(fps); + } + + @Test + public void testWiredBoxBubbles() throws Exception { + + double fps = (new PerfMeter()).exec(new Renderable() { + @Override + public void render(Graphics2D g2d) { + balls.render(g2d, wiredBoxRenderer); + } + + @Override + public void update() { + balls.update(); + } + }); + + System.out.println(fps); + } + + @Test + public void testLines() throws Exception { + + double fps = (new PerfMeter()).exec(new Renderable() { + @Override + public void render(Graphics2D g2d) { + balls.render(g2d, segRenderer); + } + + @Override + public void update() { + balls.update(); + } + }); + + System.out.println(fps); + } + + @Test + public void testFlatQuad() throws Exception { + + double fps = (new PerfMeter()).exec(new Renderable() { + @Override + public void render(Graphics2D g2d) { + balls.render(g2d, flatQuadRenderer); + } + + @Override + public void update() { + balls.update(); + } + }); + + System.out.println(fps); + } + + @Test + public void testWiredQuad() throws Exception { + + double fps = (new PerfMeter()).exec(new Renderable() { + @Override + public void render(Graphics2D g2d) { + balls.render(g2d, wiredQuadRenderer); + } + + @Override + public void update() { + balls.update(); + } + }); + + System.out.println(fps); + } + +} Binary files /dev/null and new/test/jdk/jbu/testdata/perf/metal/duke.png differ