summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/javax/media/opengl')
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLCanvas.java20
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLJPanel.java14
2 files changed, 19 insertions, 15 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
index e95491f6b..12db86475 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
@@ -663,29 +663,31 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
}
@Override
- public final int[] setSurfaceScale(final int[] result, final int[] pixelScale) {
+ public final void setSurfaceScale(final int[] pixelScale) {
SurfaceScaleUtils.validateReqPixelScale(reqPixelScale, pixelScale, DEBUG ? getClass().getSimpleName() : null);
- if( null != result ) {
- System.arraycopy(reqPixelScale, 0, result, 0, 2);
- }
if( isRealized() ) {
final ScalableSurface ns = jawtWindow;
if( null != ns ) {
- ns.setSurfaceScale(result, reqPixelScale);
+ ns.setSurfaceScale(reqPixelScale);
final int hadPixelScaleX = hasPixelScale[0];
final int hadPixelScaleY = hasPixelScale[1];
- ns.getSurfaceScale(hasPixelScale);
+ ns.getCurrentSurfaceScale(hasPixelScale);
if( hadPixelScaleX != hasPixelScale[0] || hadPixelScaleY != hasPixelScale[1] ) {
reshapeImpl(getWidth(), getHeight());
display();
}
}
}
+ }
+
+ @Override
+ public final int[] getRequestedSurfaceScale(final int[] result) {
+ System.arraycopy(reqPixelScale, 0, result, 0, 2);
return result;
}
@Override
- public final int[] getSurfaceScale(final int[] result) {
+ public final int[] getCurrentSurfaceScale(final int[] result) {
System.arraycopy(hasPixelScale, 0, result, 0, 2);
return result;
}
@@ -694,12 +696,12 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
if ( !Beans.isDesignTime() ) {
jawtWindow = (JAWTWindow) NativeWindowFactory.getNativeWindow(this, awtConfig);
jawtWindow.setShallUseOffscreenLayer(shallUseOffscreenLayer);
- jawtWindow.setSurfaceScale(null, reqPixelScale);
+ jawtWindow.setSurfaceScale(reqPixelScale);
jawtWindow.lockSurface();
try {
drawable = (GLDrawableImpl) GLDrawableFactory.getFactory(capsReqUser.getGLProfile()).createGLDrawable(jawtWindow);
createContextImpl(drawable);
- jawtWindow.getSurfaceScale(hasPixelScale);
+ jawtWindow.getCurrentSurfaceScale(hasPixelScale);
} finally {
jawtWindow.unlockSurface();
}
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
index 2f3cead4f..223badfb6 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
@@ -559,16 +559,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
private final void updateWrappedSurfaceScale(final GLDrawable d) {
final NativeSurface s = d.getNativeSurface();
if( s instanceof WrappedSurface ) {
- ((WrappedSurface)s).setSurfaceScale(null, hasPixelScale);
+ ((WrappedSurface)s).setSurfaceScale(hasPixelScale);
}
}
@Override
- public final int[] setSurfaceScale(final int[] result, final int[] pixelScale) { // HiDPI support
+ public final void setSurfaceScale(final int[] pixelScale) { // HiDPI support
SurfaceScaleUtils.validateReqPixelScale(reqPixelScale, pixelScale, DEBUG ? getClass().getSimpleName() : null);
- if( null != result ) {
- System.arraycopy(reqPixelScale, 0, result, 0, 2);
- }
final Backend b = backend;
if ( isInitialized && null != b ) {
final int[] pixelScaleInt;
@@ -585,11 +582,16 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
display();
}
}
+ }
+
+ @Override
+ public final int[] getRequestedSurfaceScale(final int[] result) {
+ System.arraycopy(reqPixelScale, 0, result, 0, 2);
return result;
}
@Override
- public final int[] getSurfaceScale(final int[] result) {
+ public final int[] getCurrentSurfaceScale(final int[] result) {
System.arraycopy(hasPixelScale, 0, result, 0, 2);
return result;
}