aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-10-02 20:34:38 +0200
committerSven Gothel <[email protected]>2014-10-02 20:42:44 +0200
commit0afcbef35ca262a826db025c053dc09a60a0596b (patch)
tree463117a3164280a84b867343b9f5d808ed95a1b6
parentc85e0566c55cdc99668dd373e6b6b8b66a557c8e (diff)
Bug 1085: Increase and fix DEBUG verbosity in GLJPanel to catch reshape regression during print
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLJPanel.java22
1 files changed, 13 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 0cf9f30ef..9ea5459ae 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
@@ -681,10 +681,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
handleReshape = true;
}
if( DEBUG ) {
- System.err.println(getThreadName()+": GLJPanel.reshape.0 "+this.getName()+" resize"+(printActive?"WithinPrint":"")+
- " [ this "+getWidth()+"x"+getHeight()+", pixelScale "+getPixelScaleStr()+
+ System.err.println(getThreadName()+": GLJPanel.reshape.0 "+this.getName()+" resize ["+(printActive?"printing":"paint")+
+ "] [ this "+getWidth()+"x"+getHeight()+", pixelScale "+getPixelScaleStr()+
", panel "+panelWidth+"x"+panelHeight +
- "] -> "+(handleReshape?"":"[skipped] ") + width+"x"+height+" * "+getPixelScaleStr()+" -> "+scaledWidth+"x"+scaledHeight);
+ "] -> "+(handleReshape?"":"[skipped] ") + width+"x"+height+" * "+getPixelScaleStr()+
+ " -> "+scaledWidth+"x"+scaledHeight+", reshapeSize "+reshapeWidth+"x"+reshapeHeight);
}
}
@@ -696,6 +697,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
@Override
public void setupPrint(final double scaleMatX, final double scaleMatY, final int numSamples, final int tileWidth, final int tileHeight) {
printActive = true;
+ if( DEBUG ) {
+ System.err.printf(getThreadName()+": GLJPanel.setupPrint: scale %f / %f, samples %d, tileSz %d x %d%n", scaleMatX, scaleMatY, numSamples, tileWidth, tileHeight);
+ }
final int componentCount = isOpaque() ? 3 : 4;
final TileRenderer printRenderer = new TileRenderer();
printAWTTiles = new AWTTilePainter(printRenderer, componentCount, scaleMatX, scaleMatY, numSamples, tileWidth, tileHeight, DEBUG);
@@ -832,7 +836,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
drawable.getSurfaceWidth() != panelWidth || drawable.getSurfaceHeight() != panelHeight ) {
// -> !( awtSize == panelSize == drawableSize )
if ( DEBUG ) {
- System.err.println(getThreadName()+": GLJPanel.releasePrintOnEDT.0: resizeWithinPrint panel " +panelWidth+"x"+panelHeight + " @ scale "+getPixelScaleStr()+
+ System.err.println(getThreadName()+": GLJPanel.releasePrintOnEDT.0: resize [printing] panel " +panelWidth+"x"+panelHeight + " @ scale "+getPixelScaleStr()+
", draw "+drawable.getSurfaceWidth()+"x"+drawable.getSurfaceHeight()+
" -> " + awtWidth+"x"+awtHeight+" * "+getPixelScaleStr()+" -> "+scaledAWTWidth+"x"+scaledAWTHeight);
}
@@ -1302,17 +1306,17 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
synchronized(initSync) {
if( !isInitialized ) {
if( handleReshape ) {
- panelWidth = reshapeWidth;
- panelHeight = reshapeHeight;
- handleReshape = false;
if (DEBUG) {
- System.err.println(getThreadName()+": GLJPanel.createAndInitializeBackend.1: " +
+ System.err.println(getThreadName()+": GLJPanel.createAndInitializeBackend.1: ["+(printActive?"printing":"paint")+"] "+
panelWidth+"x"+panelHeight+" @ scale "+getPixelScaleStr() + " -> " +
reshapeWidth+"x"+reshapeHeight+" @ scale "+getPixelScaleStr());
}
+ panelWidth = reshapeWidth;
+ panelHeight = reshapeHeight;
+ handleReshape = false;
} else {
if (DEBUG) {
- System.err.println(getThreadName()+": GLJPanel.createAndInitializeBackend.0: " +
+ System.err.println(getThreadName()+": GLJPanel.createAndInitializeBackend.0: ["+(printActive?"printing":"paint")+"] "+
panelWidth+"x"+panelHeight+" @ scale "+getPixelScaleStr());
}
}