diff options
author | Sven Gothel <[email protected]> | 2014-06-08 15:57:53 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-06-08 15:57:53 +0200 |
commit | 3fb76fcef1e6dd552ec0f677af67baf3186a1434 (patch) | |
tree | 00ff910246e857cf53d56f58f79e1c38896b912d /src/nativewindow/classes/com | |
parent | 2571ed0b5ef14155d204540d38b564a7d4cd47b6 (diff) |
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.
Diffstat (limited to 'src/nativewindow/classes/com')
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java | 9 |
1 files changed, 6 insertions, 3 deletions
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, * </p> */ @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; } |