diff options
author | Sven Gothel <[email protected]> | 2023-05-15 06:47:22 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-05-15 06:47:22 +0200 |
commit | 900c35c6a49e0d53e38dd07da709bf81e28abd3e (patch) | |
tree | 97a10ef8c5e0609f66545f19a0b370e183af132f /src/nativewindow/classes/jogamp | |
parent | cc5e46d8096a9395246518ad413385167f5f8eee (diff) |
HiDPI: Revise AWT GLCanvas/GLJPanel ScalableSurface: No setSurfaceScale(), have AWT toolkit define pixelScale only (simplification)
This aligns with Glenn's initial AWT patch commit e5e7514d649cd7dd28bbb8e04b72338dc09c2c83, i.e. removing redundancies...
Tested on Linux, Windows and MacOS w/ GLCanvas, GLJPanel and GLWindow using pixelScale values:
- Linux: 1, 2
- Windows: 1, 1.25, 2
- MacOS: 1, 2
Diffstat (limited to 'src/nativewindow/classes/jogamp')
-rw-r--r-- | src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java | 11 | ||||
-rw-r--r-- | src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java | 21 |
2 files changed, 10 insertions, 22 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java index 769041f10..093625cb3 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java +++ b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java @@ -1,5 +1,5 @@ /** - * Copyright 2010 JogAmp Community. All rights reserved. + * Copyright 2010-2023 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: @@ -132,6 +132,15 @@ public class WrappedSurface extends ProxySurfaceImpl implements ScalableSurface /** * {@inheritDoc} * <p> + * This implementation returns false, i.e. not supporting manual change of pixel-scale. + * </p> + */ + @Override + public final boolean canSetSurfaceScale() { return false; } + + /** + * {@inheritDoc} + * <p> * {@link WrappedSurface}'s implementation is to simply pass the given pixelScale * from the caller <i>down</i> to this instance without validation to be applied in the {@link #convertToPixelUnits(int[]) conversion} {@link #convertToWindowUnits(int[]) methods} <b>only</b>.<br/> * This allows the caller to pass down knowledge about window- and pixel-unit conversion and utilize mentioned conversion methods. diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java index 40fb48f33..ffd75f038 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java @@ -125,27 +125,6 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface { } @Override - public boolean setSurfaceScale(final float[] pixelScale) { - super.setSurfaceScale(pixelScale); - if( 0 != getWindowHandle() && setReqPixelScale() ) { // locked at least once _and_ updated pixel-scale - if( 0 != getAttachedSurfaceLayer() ) { - OSXUtil.RunOnMainThread(false /* wait */, false, new Runnable() { - @Override - public void run() { - final long osl = getAttachedSurfaceLayer(); - if( 0 != rootSurfaceLayer && 0 != osl ) { - OSXUtil.SetCALayerPixelScale(rootSurfaceLayer, osl, getPixelScaleX()); - } - } - }); - } - return true; - } else { - return false; - } - } - - @Override protected void attachSurfaceLayerImpl(final long _offscreenSurfaceLayer) { OSXUtil.RunOnMainThread(false /* wait */, false /* kickNSApp */, new Runnable() { @Override |