From 2d83e346b1e737f9efc0e782ddbd2a9be6a4cd35 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 15 Jun 2013 08:14:19 +0200 Subject: AWTGraphicsConfiguration: Allow null capsRequested; NewtCanvasAWT: Avoid NPE @ addNotify() w/o newtChild --- .../com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/nativewindow') diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java index 2a152ff35..7e3d30a47 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java @@ -74,8 +74,9 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple /** * @param capsChosen if null, capsRequested is copied and aligned - * with the graphics Capabilities of the AWT Component to produce the chosen Capabilities. + * with the graphics {@link Capabilities} of the AWT Component to produce the chosen {@link Capabilities}. * Otherwise the capsChosen is used. + * @param capsRequested if null, default {@link Capabilities} are used, otherwise the given values. */ public static AWTGraphicsConfiguration create(Component awtComp, CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested) { final GraphicsConfiguration awtGfxConfig = awtComp.getGraphicsConfiguration(); @@ -91,6 +92,9 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple final AWTGraphicsDevice awtDevice = new AWTGraphicsDevice(awtGraphicsDevice, AbstractGraphicsDevice.DEFAULT_UNIT); final AWTGraphicsScreen awtScreen = new AWTGraphicsScreen(awtDevice); + if(null==capsRequested) { + capsRequested = new Capabilities(); + } if(null==capsChosen) { GraphicsConfiguration gc = awtGraphicsDevice.getDefaultConfiguration(); capsChosen = AWTGraphicsConfiguration.setupCapabilitiesRGBABits(capsRequested, gc); -- cgit v1.2.3