aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/jogamp
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/jogamp
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/jogamp')
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java4
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java17
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java4
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java4
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java14
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java4
6 files changed, 17 insertions, 30 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
index dd1b6f185..969e012a6 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
@@ -150,12 +150,12 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
@Override
public final int getSurfaceWidth() {
- return upstream.getPixelWidth(this);
+ return upstream.getSurfaceWidth(this);
}
@Override
public final int getSurfaceHeight() {
- return upstream.getPixelHeight(this);
+ return upstream.getSurfaceHeight(this);
}
@Override
diff --git a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
index 5601dac02..902223c80 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
@@ -98,20 +98,13 @@ public class WrappedSurface extends ProxySurfaceImpl {
}
@Override
- public final int[] getWindowUnitXY(int[] result, final int[] pixelUnitXY) {
- final int scale = 1; // FIXME: Use 'scale' ..
- result[0] = pixelUnitXY[0] / scale;
- result[1] = pixelUnitXY[1] / scale;
- return result;
+ public final int[] convertToWindowUnits(final int[] pixelUnitsAndResult) {
+ return pixelUnitsAndResult; // FIXME HiDPI: use 'pixelScale'
}
@Override
- public final int[] getPixelUnitXY(int[] result, final int[] windowUnitXY) {
- final int scale = 1; // FIXME: Use 'scale' ..
- result[0] = windowUnitXY[0] * scale;
- result[1] = windowUnitXY[1] * scale;
- return result;
+ public final int[] convertToPixelUnits(final int[] windowUnitsAndResult) {
+ return windowUnitsAndResult; // FIXME HiDPI: use 'pixelScale'
}
-
-}
+} \ No newline at end of file
diff --git a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java
index 5a51aca3e..98ea68f4f 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java
@@ -11,10 +11,10 @@ public class OSXDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
long nsWindow;
/**
- * @param width the initial width as returned by {@link NativeSurface#getSurfaceWidth()} via {@link UpstreamSurfaceHook#getPixelWidth(ProxySurface)},
+ * @param width the initial width as returned by {@link NativeSurface#getSurfaceWidth()} via {@link UpstreamSurfaceHook#getSurfaceWidth(ProxySurface)},
* not the actual dummy surface width.
* The latter is platform specific and small
- * @param height the initial height as returned by {@link NativeSurface#getSurfaceHeight()} via {@link UpstreamSurfaceHook#getPixelHeight(ProxySurface)},
+ * @param height the initial height as returned by {@link NativeSurface#getSurfaceHeight()} via {@link UpstreamSurfaceHook#getSurfaceHeight(ProxySurface)},
* not the actual dummy surface height,
* The latter is platform specific and small
*/
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java
index 9c74950e0..bf59a6639 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java
@@ -9,10 +9,10 @@ import com.jogamp.nativewindow.UpstreamSurfaceHookMutableSize;
public class GDIDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize {
/**
- * @param width the initial width as returned by {@link NativeSurface#getSurfaceWidth()} via {@link UpstreamSurfaceHook#getPixelWidth(ProxySurface)},
+ * @param width the initial width as returned by {@link NativeSurface#getSurfaceWidth()} via {@link UpstreamSurfaceHook#getSurfaceWidth(ProxySurface)},
* not the actual dummy surface width.
* The latter is platform specific and small
- * @param height the initial height as returned by {@link NativeSurface#getSurfaceHeight()} via {@link UpstreamSurfaceHook#getPixelHeight(ProxySurface)},
+ * @param height the initial height as returned by {@link NativeSurface#getSurfaceHeight()} via {@link UpstreamSurfaceHook#getSurfaceHeight(ProxySurface)},
* not the actual dummy surface height,
* The latter is platform specific and small
*/
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
index c4ec0f653..c9e48e94e 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
@@ -130,19 +130,13 @@ public class GDISurface extends ProxySurfaceImpl {
}
@Override
- public final int[] getWindowUnitXY(int[] result, final int[] pixelUnitXY) {
- if( pixelUnitXY != result ) { // no scale factor, window units == pixel units
- System.arraycopy(pixelUnitXY, 0, result, 0, 2);
- }
- return result;
+ public final int[] convertToWindowUnits(final int[] pixelUnitsAndResult) {
+ return pixelUnitsAndResult; // no pixelScale factor
}
@Override
- public final int[] getPixelUnitXY(int[] result, final int[] windowUnitXY) {
- if( windowUnitXY != result ) { // no scale factor, window units == pixel units
- System.arraycopy(windowUnitXY, 0, result, 0, 2);
- }
- return result;
+ public final int[] convertToPixelUnits(final int[] windowUnitsAndResult) {
+ return windowUnitsAndResult; // no pixelScale factor
}
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java
index 31d168fea..53b303071 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java
@@ -14,10 +14,10 @@ import com.jogamp.nativewindow.x11.X11GraphicsScreen;
public class X11DummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize {
/**
- * @param width the initial width as returned by {@link NativeSurface#getSurfaceWidth()} via {@link UpstreamSurfaceHook#getPixelWidth(ProxySurface)},
+ * @param width the initial width as returned by {@link NativeSurface#getSurfaceWidth()} via {@link UpstreamSurfaceHook#getSurfaceWidth(ProxySurface)},
* not the actual dummy surface width.
* The latter is platform specific and small
- * @param height the initial height as returned by {@link NativeSurface#getSurfaceHeight()} via {@link UpstreamSurfaceHook#getPixelHeight(ProxySurface)},
+ * @param height the initial height as returned by {@link NativeSurface#getSurfaceHeight()} via {@link UpstreamSurfaceHook#getSurfaceHeight(ProxySurface)},
* not the actual dummy surface height,
* The latter is platform specific and small
*/