aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-09-29 10:25:32 +0200
committerSven Gothel <[email protected]>2013-09-29 10:25:32 +0200
commitac1901608c62ae1c5b82bccc3b2a70193031d5f0 (patch)
treeca852f965c27d90d87d24b71c70d19e1c5c3fb17 /src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
parentafe6260776fcb61a2dba5c69f819ba9a7987afab (diff)
GLJPanel/Printing: Perform backend.reshape immediatly after printing if resized; Add unit test for resize while printing.
Perform immediatly reshape at releasePrint on AWT-EDT: - sendReshape = handleReshape(); // reshapeSize -> panelSize, backend reshape w/ GL reshape
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/awt/GLJPanel.java')
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLJPanel.java24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
index 589cffeb5..84d085f76 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
@@ -489,12 +489,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
public void reshape(int x, int y, int width, int height) {
super.reshape(x, y, width, height);
- if (DEBUG) {
- System.err.println(getThreadName()+": GLJPanel.reshape: " +reshapeWidth+"x"+reshapeHeight + " -> " + width+"x"+height);
+ if( DEBUG ) {
+ System.err.println(getThreadName()+": GLJPanel.reshape resize"+(printActive?"WithinPrint":"")+" [ panel "+
+ panelWidth+"x"+panelHeight +
+ ", reshape: " +reshapeWidth+"x"+reshapeHeight +
+ "] -> "+(printActive?"skipped":"") + width+"x"+height);
}
if( !printActive ) {
- // reshapeX = x;
- // reshapeY = y;
reshapeWidth = width;
reshapeHeight = height;
handleReshape = true;
@@ -586,7 +587,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
@Override
public void run() {
if( DEBUG ) {
- System.err.println("AWT print.release "+printAWTTiles);
+ System.err.println(getThreadName()+": GLJPanel.releasePrintOnEDT.0 "+printAWTTiles);
}
printAWTTiles.dispose();
printAWTTiles= null;
@@ -603,13 +604,18 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
// trigger reshape, i.e. gl-viewport and -listener - this component might got resized!
final int awtWidth = GLJPanel.this.getWidth();
final int awtHeight= GLJPanel.this.getHeight();
- if( panelWidth != awtWidth || panelHeight != awtHeight ) {
+ final GLDrawable drawable = GLJPanel.this.getDelegatedDrawable();
+ if( awtWidth != panelWidth || awtHeight != panelHeight ||
+ drawable.getWidth() != panelWidth || drawable.getHeight() != panelHeight ) {
+ // -> !( awtSize == panelSize == drawableSize )
if ( DEBUG ) {
- System.err.println(getThreadName()+": GLJPanel.releasePrintOnEDT.0: reshape " +panelWidth+"x"+panelHeight + " -> " + awtWidth+"x"+awtHeight);
- }
+ System.err.println(getThreadName()+": GLJPanel.releasePrintOnEDT.0: resizeWithinPrint panel " +panelWidth+"x"+panelHeight +
+ ", draw "+drawable.getWidth()+"x"+drawable.getHeight()+
+ " -> " + awtWidth+"x"+awtHeight);
+ }
reshapeWidth = awtWidth;
reshapeHeight = awtHeight;
- handleReshape = true; // complete resize, sendReshape will be set later
+ sendReshape = handleReshape(); // reshapeSize -> panelSize, backend reshape w/ GL reshape
} else {
sendReshape = true; // only GL reshape
}