diff options
author | Sven Gothel <[email protected]> | 2014-06-08 18:04:51 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-06-08 18:04:51 +0200 |
commit | 58153310faa4089417037e67e06c0812908cecd2 (patch) | |
tree | bdb8aa75de6d2ec5ef9b351f0d0fc67fa18096ba /src/nativewindow/classes/jogamp | |
parent | 3fb76fcef1e6dd552ec0f677af67baf3186a1434 (diff) |
Bug 741 HiDPI: Simplify ScalableSurface (2): Add request pixelScale API entry, fixed NewtCanvasAWT use-case
We require the requested pixelScale in NewtCanvasAWT if the NEWT window (child)
is not yet realized, so the JAWTWindow can receive the request,
since realized/current pixelScale is still 1.
Remove return value (requested pixel scale):
- public int[] setSurfaceScale(final int[] result, final int[] pixelScale);
+ public void setSurfaceScale(final int[] pixelScale);
Add API hook to query requested pixel scale:
+ int[] getRequestedSurfaceScale(final int[] result);
Unique name for get[Current]*:
- public int[] getSurfaceScale(final int[] result);
+ public int[] getCurrentSurfaceScale(final int[] result);
Diffstat (limited to 'src/nativewindow/classes/jogamp')
3 files changed, 12 insertions, 11 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/SurfaceScaleUtils.java b/src/nativewindow/classes/jogamp/nativewindow/SurfaceScaleUtils.java index 4586812e1..22e67ecff 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/SurfaceScaleUtils.java +++ b/src/nativewindow/classes/jogamp/nativewindow/SurfaceScaleUtils.java @@ -95,7 +95,7 @@ public class SurfaceScaleUtils { * Validate the given requested pixelScale value pair, i.e. clip it to the * limits of {@link ScalableSurface#AUTOMAX_PIXELSCALE} and {@link #getPlatformMaxPixelScale(int[])} * <p> - * To be used by {@link ScalableSurface#setSurfaceScale(int[], int[])} implementations. + * To be used by {@link ScalableSurface#setSurfaceScale(int[])} implementations. * </p> * * @param result int[2] storage for result diff --git a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java index 96862cbd6..8f9379130 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java +++ b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java @@ -104,7 +104,7 @@ public class WrappedSurface extends ProxySurfaceImpl implements ScalableSurface /** * {@inheritDoc} * <p> - * {@link WrappedSurface}'s implementation uses the {@link #setSurfaceScale(int[], int[]) given pixelScale} directly. + * {@link WrappedSurface}'s implementation uses the {@link #setSurfaceScale(int[]) given pixelScale} directly. * </p> */ @Override @@ -117,7 +117,7 @@ public class WrappedSurface extends ProxySurfaceImpl implements ScalableSurface /** * {@inheritDoc} * <p> - * {@link WrappedSurface}'s implementation uses the {@link #setSurfaceScale(int[], int[]) given pixelScale} directly. + * {@link WrappedSurface}'s implementation uses the {@link #setSurfaceScale(int[]) given pixelScale} directly. * </p> */ @Override @@ -147,17 +147,19 @@ public class WrappedSurface extends ProxySurfaceImpl implements ScalableSurface * </p> */ @Override - public final int[] setSurfaceScale(final int[] result, final int[] pixelScale) { + public final void setSurfaceScale(final int[] pixelScale) { hasPixelScale[0] = pixelScale[0]; hasPixelScale[1] = pixelScale[1]; - if( null != result ) { - System.arraycopy(hasPixelScale, 0, result, 0, 2); - } + } + + @Override + public final int[] getRequestedSurfaceScale(final int[] result) { + System.arraycopy(hasPixelScale, 0, result, 0, 2); return result; } @Override - public final int[] getSurfaceScale(final int[] result) { + public final int[] getCurrentSurfaceScale(final int[] result) { System.arraycopy(hasPixelScale, 0, result, 0, 2); return result; } diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java index 695fdac88..3728bfb59 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java +++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java @@ -114,8 +114,8 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface { } @Override - public int[] setSurfaceScale(final int[] result, final int[] pixelScale) { - super.setSurfaceScale(result, pixelScale); + public void setSurfaceScale(final int[] pixelScale) { + super.setSurfaceScale(pixelScale); if( 0 != getWindowHandle() ) { // locked at least once ! final int hadPixelScaleX = getPixelScaleX(); updatePixelScale(); @@ -132,7 +132,6 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface { }); } } - return result; } @Override |