From 3fb76fcef1e6dd552ec0f677af67baf3186a1434 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 8 Jun 2014 15:57:53 +0200 Subject: Bug 741 HiDPI: Simplify ScalableSurface [set|get]SurfaceScale(..) spec, which also fixed JAWTWindow getSurfaceScale() issue on Windows Let setSurfaceScale(..) return the validated requested values and getSurfaceScale(..) always the current values. This removes complication and solves a bug w/ JAWTWindow on Windows, where we used 'drawable' as an indicator for 'previous locked' state. The latter is not true since on Windows 'drawable' is set to null in unlock, getWindowHandle() should be taken instead. --- .../classes/com/jogamp/nativewindow/awt/JAWTWindow.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/nativewindow/classes/com/jogamp') diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java index efe9409ac..d235a2a29 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java @@ -277,14 +277,17 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, *

*/ @Override - public void setSurfaceScale(final int[] pixelScale) { + public int[] setSurfaceScale(final int[] result, final int[] pixelScale) { SurfaceScaleUtils.validateReqPixelScale(reqPixelScale, pixelScale, DEBUG ? getClass().getSimpleName() : null); + if( null != result ) { + System.arraycopy(reqPixelScale, 0, result, 0, 2); + } + return result; } @Override public final int[] getSurfaceScale(final int[] result) { - // 0 != drawable -> locked at least once ! - System.arraycopy(0 != drawable ? hasPixelScale : reqPixelScale, 0, result, 0, 2); + System.arraycopy(hasPixelScale, 0, result, 0, 2); return result; } -- cgit v1.2.3