diff options
author | Sven Gothel <[email protected]> | 2020-01-17 15:17:17 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-01-17 15:17:17 +0100 |
commit | ba83a59363023ba0cc314746d7864ccf2cdd4d7a (patch) | |
tree | d21c28e75cc4b4c6fd20fb2956ce0ba1717e6240 | |
parent | e03204605f95dc3586d8e3582250211954542be5 (diff) |
Bug 1374: NEWT/AWT: Annotation regarding general High-DPI for even non native DPI toolkit aware platforms (Linux, Windows)
NEWT + NewtCanvasAWT:
Maybe create "interface ScalableSurface.Upstream {
void pixelScaleChangeNotify(final float[] curPixelScale, final float[] minPixelScale, final float[] maxPixelScale); }"
to allow downstream to notify upstream ScalableSurface implementations like NEWT's Window to act accordingly.
+++
AWT GLCanvas: Add remark where to add the potential pixel scale.
-rwxr-xr-x | make/scripts/tests-win.bat | 3 | ||||
-rw-r--r-- | make/scripts/tests.sh | 4 | ||||
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/awt/GLCanvas.java | 6 | ||||
-rw-r--r-- | src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java | 3 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/WindowImpl.java | 15 |
5 files changed, 28 insertions, 3 deletions
diff --git a/make/scripts/tests-win.bat b/make/scripts/tests-win.bat index 2036ead2c..e21273fef 100755 --- a/make/scripts/tests-win.bat +++ b/make/scripts/tests-win.bat @@ -16,6 +16,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGea REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelsAWT %* REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.DemoGLJPanelPerf02AWT %* REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT %* +scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.swt.TestGLCanvasSWTNewtCanvasSWTPosInTabs %* REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NewtCanvasAWT %* REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestElektronenMultipliziererNEWT %* REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl3.newt.TestGeomShader01TextureGL3NEWT %* @@ -160,7 +161,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.parenting.TestParenti REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.parenting.TestTranslucentParentingAWT %* REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.parenting.TestTranslucentChildWindowBug632NEWT %* -scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.swt.TestSWTAccessor02NewtGLWindow %* +REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.swt.TestSWTAccessor02NewtGLWindow %* REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.swt.TestSWTAccessor03AWTGLn %* REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.swt.TestSWTJOGLGLCanvas01GLn %* REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.swt.TestNewtCanvasSWTGLn %* diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index 1ac651c7d..220662262 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -488,8 +488,8 @@ function testawtswt() { #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2SimpleNEWT $* #testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT $* #testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT $* -#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT $* -testswt com.jogamp.opengl.test.junit.jogl.swt.TestGLCanvasSWTNewtCanvasSWTPosInTabs $* +testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT $* +#testswt com.jogamp.opengl.test.junit.jogl.swt.TestGLCanvasSWTNewtCanvasSWTPosInTabs $* #testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestRulerNEWT01 $* #testnoawt com.jogamp.opengl.test.junit.graph.demos.GPUUISceneNewtDemo $* diff --git a/src/jogl/classes/com/jogamp/opengl/awt/GLCanvas.java b/src/jogl/classes/com/jogamp/opengl/awt/GLCanvas.java index 5e440092b..0d1b272ba 100644 --- a/src/jogl/classes/com/jogamp/opengl/awt/GLCanvas.java +++ b/src/jogl/classes/com/jogamp/opengl/awt/GLCanvas.java @@ -707,6 +707,12 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing private void createJAWTDrawableAndContext() { if ( !Beans.isDesignTime() ) { + + /** + * FIXME: Bug 1373, 1374: Implement general High-DPI for even non native DPI toolkit aware platforms (Linux, Windows) + JAWTUtil.getPixelScale(awtConfig.getAWTGraphicsConfiguration(), minPixelScale, maxPixelScale); + SurfaceScaleUtils.setNewPixelScale(hasPixelScale, hasPixelScale, reqPixelScale, minPixelScale, maxPixelScale, DEBUG ? getClass().getSimpleName() : null); + */ jawtWindow = (JAWTWindow) NativeWindowFactory.getNativeWindow(this, awtConfig); jawtWindow.setShallUseOffscreenLayer(shallUseOffscreenLayer); jawtWindow.lockSurface(); diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java index 66f50781f..ae692a2be 100644 --- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java +++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java @@ -643,6 +643,9 @@ public class NewtCanvasAWT extends java.awt.Canvas implements NativeWindowHolder if( dWin instanceof WindowImpl ) { final float[] maxPixelScale = jawtWindow.getMaximumSurfaceScale(new float[2]); final float[] minPixelScale = jawtWindow.getMinimumSurfaceScale(new float[2]); + // FIXME: Bug 1373, 1374: Implement general High-DPI for even non native DPI toolkit aware platforms (Linux, Windows) + // final float[] curPixelScale = jawtWindow.getCurrentSurfaceScale(new float[2]); + // ((WindowImpl)dWin).pixelScaleChangeNotify(curPixelScale, minPixelScale, maxPixelScale); ((WindowImpl)dWin).pixelScaleChangeNotify(minPixelScale, maxPixelScale, true); // ((WindowImpl)dWin).sizeChangedNotify(true /* defer */, getWidth(), getHeight(), true /* force */); } else { diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java index 176a33669..8ef137b34 100644 --- a/src/newt/classes/jogamp/newt/WindowImpl.java +++ b/src/newt/classes/jogamp/newt/WindowImpl.java @@ -2643,6 +2643,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer return hasPixelScale[1]; } + /** + * {@inheritDoc} + * <p> + * FIXME: Bug 1373, 1374: Implement general High-DPI for even non native DPI toolkit aware platforms (Linux, Windows) + * </p> + */ @Override public boolean setSurfaceScale(final float[] pixelScale) { System.arraycopy(pixelScale, 0, reqPixelScale, 0, 2); @@ -4561,6 +4567,15 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer /** * Notify to update the pixel-scale values. + * <p> + * FIXME: Bug 1373, 1374: Implement general High-DPI for even non native DPI toolkit aware platforms (Linux, Windows) + * A variation may be be desired like + * {@code pixelScaleChangeNotify(final float[] curPixelScale, final float[] minPixelScale, final float[] maxPixelScale)}. + * </p> + * <p> + * Maybe create interface {@code ScalableSurface.Upstream} with above method, + * to allow downstream to notify upstream ScalableSurface implementations like NEWT's {@link Window} to act accordingly. + * </p> * @param minPixelScale * @param maxPixelScale * @param reset if {@code true} {@link #setSurfaceScale(float[]) reset pixel-scale} w/ {@link #getRequestedSurfaceScale(float[]) requested values} |