Skip to content

Commit

Permalink
Bug 1374: NEWT/AWT: Annotation regarding general High-DPI for even no…
Browse files Browse the repository at this point in the history
…n 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.
  • Loading branch information
sgothel committed Jan 17, 2020
1 parent e032046 commit ba83a59
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
3 changes: 2 additions & 1 deletion make/scripts/tests-win.bat
Expand Up @@ -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 %*
Expand Down Expand Up @@ -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 %*
Expand Down
4 changes: 2 additions & 2 deletions make/scripts/tests.sh
Expand Up @@ -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 $*
Expand Down
6 changes: 6 additions & 0 deletions src/jogl/classes/com/jogamp/opengl/awt/GLCanvas.java
Expand Up @@ -707,6 +707,12 @@ public float[] getMaximumSurfaceScale(final float[] result) {

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();
Expand Down
3 changes: 3 additions & 0 deletions src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
Expand Up @@ -643,6 +643,9 @@ private final boolean updatePixelScale(final GraphicsConfiguration gc) {
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 {
Expand Down
15 changes: 15 additions & 0 deletions src/newt/classes/jogamp/newt/WindowImpl.java
Expand Up @@ -2643,6 +2643,12 @@ protected final float getPixelScaleY() {
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);
Expand Down Expand Up @@ -4561,6 +4567,15 @@ private long waitForVisible(final boolean visible, final boolean failFast, final

/**
* 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}
Expand Down

0 comments on commit ba83a59

Please sign in to comment.