summaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/com
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-05-22 07:09:23 +0200
committerSven Gothel <[email protected]>2014-05-22 07:09:23 +0200
commitfb57c652fee6be133990cd7afbbd2fdfc084afaa (patch)
tree7993fe001b291eb83519bf02f34639502f2afb22 /src/nativewindow/classes/com
parentf9a00b91dcd146c72a50237b62270f33bd0da98e (diff)
Bug 742 HiDPI: [Core API Change] Distinguish window-units and pixel-units: Refine commit f9a00b91dcd146c72a50237b62270f33bd0da98e
- Using comment tag 'FIXME HiDPI' to locate remaining issues - Fix remaining 'getPixel*(..)' -> 'getSurface*(..)' - UpstreamSurfaceHook - Fix usage (one by one) of - NativeWindow: getWindowWidth() / getWindowHeight() - NativeSurface/GLDrawable: getSurfaceWidth() / getSurfaceHeight() - mention window- or pixel units in API doc where required - use 'setSurfaceSize(..)' where appropriate to match 'getSurface*()' - GLFBODrawable - GLOffscreenAutoDrawable - UpstreamSurfaceHook.MutableSize - NativeWindow's Point: Add API doc and 'Point scaleInv(..)' - NativeSurface Simplify new conversion methods and use single in-place storage - 'int[] getWindowUnitXY(int[], int[])' -> 'int[] convertToWindowUnits(int[], int[])' - 'int[] getPixelUnitXY(int[], int[])' -> 'int[] convertToPixelUnits(int[], int[])' - NEWT Screen/Monitor - Assume screen/window units - TODO: Refine semantics - Monitor resolution probably is in pixel units ?! - Including the Rectangle/Monitor association etc etc - NEWT Window - Add setSurfaceSize(..) for convenience - Add 'Point convertToWindowUnits(final Point pixelUnitsAndResult)', etc .. - All window ops are using window units (size, pos, ..), but methods operating on the surface/drawable: windowRepaint(..) .. - TODO: Consider changing method names 'window*(..)' to 'surface*(..)' actually operating on surface/drawable - Window.windowRepaint(..) - GLAutoDrawableDelegate.windowResizedOp(..) (maybe all similar methods in here) - NEWT Mouse/Pointer Events - Using pixel units
Diffstat (limited to 'src/nativewindow/classes/com')
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java6
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java6
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/UpstreamWindowHookMutableSizePos.java3
-rw-r--r--src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java16
4 files changed, 17 insertions, 14 deletions
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java b/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java
index db4a979d1..9a462105f 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java
@@ -10,7 +10,7 @@ public class DelegatedUpstreamSurfaceHookWithSurfaceSize implements UpstreamSurf
/**
* @param upstream optional upstream UpstreamSurfaceHook used for {@link #create(ProxySurface)} and {@link #destroy(ProxySurface)}.
- * @param surface mandatory {@link NativeSurface} used for {@link #getPixelWidth(ProxySurface)} and {@link #getPixelHeight(ProxySurface)}
+ * @param surface mandatory {@link NativeSurface} used for {@link #getSurfaceWidth(ProxySurface)} and {@link #getSurfaceHeight(ProxySurface)}
*/
public DelegatedUpstreamSurfaceHookWithSurfaceSize(UpstreamSurfaceHook upstream, NativeSurface surface) {
this.upstream = upstream;
@@ -35,12 +35,12 @@ public class DelegatedUpstreamSurfaceHookWithSurfaceSize implements UpstreamSurf
}
@Override
- public final int getPixelWidth(ProxySurface s) {
+ public final int getSurfaceWidth(ProxySurface s) {
return surface.getSurfaceWidth();
}
@Override
- public final int getPixelHeight(ProxySurface s) {
+ public final int getSurfaceHeight(ProxySurface s) {
return surface.getSurfaceHeight();
}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java
index 5910f5fea..25e2bbd49 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java
@@ -16,18 +16,18 @@ public class UpstreamSurfaceHookMutableSize implements UpstreamSurfaceHook.Mutab
}
@Override
- public final void setPixelSize(int width, int height) {
+ public final void setSurfaceSize(int width, int height) {
this.pixWidth = width;
this.pixHeight = height;
}
@Override
- public final int getPixelWidth(ProxySurface s) {
+ public final int getSurfaceWidth(ProxySurface s) {
return pixWidth;
}
@Override
- public final int getPixelHeight(ProxySurface s) {
+ public final int getSurfaceHeight(ProxySurface s) {
return pixHeight;
}
@Override
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamWindowHookMutableSizePos.java b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamWindowHookMutableSizePos.java
index f761b522a..2e9a33801 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamWindowHookMutableSizePos.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamWindowHookMutableSizePos.java
@@ -28,6 +28,9 @@ public class UpstreamWindowHookMutableSizePos extends UpstreamSurfaceHookMutable
public final void setWinSize(int winWidth, int winHeight) {
this.winWidth= winWidth;
this.winHeight= winHeight;
+ // FIXME HiDPI: Use pixelScale ?!
+ // FIXME HiDPI: Consider setting winWidth/winHeight by setSurfaceSize(..) (back-propagation)
+ this.setSurfaceSize(winWidth, winHeight);
}
public final int getX() {
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
index e35716c49..24bc8fa51 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
@@ -648,19 +648,19 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
}
@Override
- public final int[] getWindowUnitXY(int[] result, final int[] pixelUnitXY) {
+ public final int[] convertToWindowUnits(final int[] pixelUnitsAndResult) {
final int scale = getPixelScale();
- result[0] = pixelUnitXY[0] / scale;
- result[1] = pixelUnitXY[1] / scale;
- return result;
+ pixelUnitsAndResult[0] /= scale;
+ pixelUnitsAndResult[1] /= scale;
+ return pixelUnitsAndResult;
}
@Override
- public final int[] getPixelUnitXY(int[] result, final int[] windowUnitXY) {
+ public final int[] convertToPixelUnits(final int[] windowUnitsAndResult) {
final int scale = getPixelScale();
- result[0] = windowUnitXY[0] * scale;
- result[1] = windowUnitXY[1] * scale;
- return result;
+ windowUnitsAndResult[0] *= scale;
+ windowUnitsAndResult[1] *= scale;
+ return windowUnitsAndResult;
}
@Override