From bc05d39965ec513a468b841dd1e696c2e371fdd2 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 2 Mar 2023 23:41:20 +0100 Subject: Drop redundant NativeWindowFactory.getDefaultToolkitLock(type, deviceHandle) variant --- .../jogamp/nativewindow/DefaultGraphicsDevice.java | 4 ++-- .../com/jogamp/nativewindow/NativeWindowFactory.java | 19 +------------------ .../jogamp/nativewindow/x11/X11GraphicsDevice.java | 4 ++-- 3 files changed, 5 insertions(+), 22 deletions(-) (limited to 'src/nativewindow') diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/DefaultGraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/DefaultGraphicsDevice.java index 56c196132..4210046d6 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/DefaultGraphicsDevice.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/DefaultGraphicsDevice.java @@ -72,12 +72,12 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice /** * Create an instance with the system default {@link ToolkitLock}. - * gathered via {@link NativeWindowFactory#getDefaultToolkitLock(String, long)}. + * gathered via {@link NativeWindowFactory#getDefaultToolkitLock(String)}. * @param type * @param handle */ public DefaultGraphicsDevice(final String type, final String connection, final int unitID, final long handle) { - this(type, connection, unitID, handle, NativeWindowFactory.getDefaultToolkitLock(type, handle)); + this(type, connection, unitID, handle, NativeWindowFactory.getDefaultToolkitLock(type)); } /** diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java index 332854fcc..29829be18 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowFactory.java @@ -540,24 +540,6 @@ public abstract class NativeWindowFactory { return NativeWindowFactoryImpl.getNullToolkitLock(); } - /** - * Provides the default {@link ToolkitLock} for type and deviceHandle. - * - */ - public static ToolkitLock getDefaultToolkitLock(final String type, final long deviceHandle) { - if( requiresToolkitLock ) { - if( TYPE_AWT == type && isAWTAvailable() ) { // uses .intern()! - return getAWTToolkitLock(); - } - return ResourceToolkitLock.create(); - } - return NativeWindowFactoryImpl.getNullToolkitLock(); - } - /** * @param device * @param screen -1 is default screen of the given device, e.g. maybe 0 or determined by native API. >= 0 is specific screen @@ -717,6 +699,7 @@ public abstract class NativeWindowFactory { public static AbstractGraphicsDevice createDevice(final String displayConnection, final boolean own) { return createDevice(NativeWindowFactory.getNativeWindowType(true), displayConnection, own); } + /** * Creates a native device type, following the given {@link #getNativeWindowType(boolean) native-window-type}. *

diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java index 5e706884c..29ed5e8fd 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java @@ -61,11 +61,11 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl } /** Constructs a new X11GraphicsDevice corresponding to the given native display handle and default - * {@link com.jogamp.nativewindow.ToolkitLock} via {@link NativeWindowFactory#getDefaultToolkitLock(String, long)}. + * {@link com.jogamp.nativewindow.ToolkitLock} via {@link NativeWindowFactory#getDefaultToolkitLock(String)}. * @see DefaultGraphicsDevice#DefaultGraphicsDevice(String, String, int, long) */ public X11GraphicsDevice(final long display, final int unitID, final boolean owner) { - this(display, unitID, NativeWindowFactory.getDefaultToolkitLock(NativeWindowFactory.TYPE_X11, display), owner); + this(display, unitID, NativeWindowFactory.getDefaultToolkitLock(NativeWindowFactory.TYPE_X11), owner); } /** -- cgit v1.2.3