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/javax | |
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/javax')
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/ScalableSurface.java | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/ScalableSurface.java b/src/nativewindow/classes/javax/media/nativewindow/ScalableSurface.java index f6101034b..de6ba51d7 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/ScalableSurface.java +++ b/src/nativewindow/classes/javax/media/nativewindow/ScalableSurface.java @@ -30,7 +30,7 @@ package javax.media.nativewindow; /** * Adding mutable surface pixel scale property to implementing class, usually to a {@link NativeSurface} implementation, - * see {@link #setSurfaceScale(int[], int[])}. + * see {@link #setSurfaceScale(int[])}. */ public interface ScalableSurface { /** Setting surface-pixel-scale of {@value}, results in same pixel- and window-units. */ @@ -39,8 +39,7 @@ public interface ScalableSurface { public static final int AUTOMAX_PIXELSCALE = 0; /** - * Request a pixel scale in x- and y-direction for the associated {@link NativeSurface} - * and return the validated requested value, see below. + * Request a pixel scale in x- and y-direction for the associated {@link NativeSurface}. * <p> * Default pixel scale request for both directions is {@link #AUTOMAX_PIXELSCALE}. * </p> @@ -51,17 +50,24 @@ public interface ScalableSurface { * <p> * The <i>requested</i> pixel scale will be validated against platform limits before native scale-setup, * i.e. clipped to {@link #IDENTITY_PIXELSCALE} if not supported or clipped to the platform maximum. + * It can be queried via {@link #getRequestedSurfaceScale(int[])}. * </p> * <p> * The actual <i>realized</i> pixel scale values of the {@link NativeSurface} - * can be queried via {@link #getSurfaceScale(int[])} or + * can be queried via {@link #getCurrentSurfaceScale(int[])} or * computed via <code>surface.{@link NativeSurface#convertToPixelUnits(int[]) convertToPixelUnits}(new int[] { 1, 1 })</code> * </p> - * @param result int[2] storage for the result, maybe null - * @param pixelScale <i>requested</i> surface pixel scale int[2] values for x- and y-direction. - * @return the passed storage containing the validated requested pixelSize for chaining, if storage is not null + * @param pixelScale <i>requested</i> surface pixel scale int[2] values for x- and y-direction. */ - public int[] setSurfaceScale(final int[] result, final int[] pixelScale); + public void setSurfaceScale(final int[] pixelScale); + + /** + * Returns the requested pixel scale of the associated {@link NativeSurface}. + * + * @param result int[2] storage for the result + * @return the passed storage containing the requested pixelSize for chaining + */ + int[] getRequestedSurfaceScale(final int[] result); /** * Returns the current pixel scale of the associated {@link NativeSurface}. @@ -69,6 +75,6 @@ public interface ScalableSurface { * @param result int[2] storage for the result * @return the passed storage containing the current pixelSize for chaining */ - public int[] getSurfaceScale(final int[] result); + public int[] getCurrentSurfaceScale(final int[] result); } |