diff options
author | Sven Gothel <[email protected]> | 2013-10-18 01:21:46 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-10-18 01:21:46 +0200 |
commit | 77b0adbdb6e361e4d5d6ca31432e8fc625d02b24 (patch) | |
tree | f677a62b57508c2ce741f4c1150d812b404f26a5 /src/newt/classes/com | |
parent | 3c56d9346b9077b5eb65ec9e111917cfe17e9173 (diff) |
AWTPrintLifecycle.setupPrint(..): Fix regression of commit a05b87a369441d9ef38f97929f866b3d4ced0e57: NULL printGLAD of GLCanvas and NewtCanvasAWT
We have to pre-init printGLAD w/ current GLAD (similiar w/ GLJPanel).
Also properly define reqNewGLAD:
reqNewGLAD = !caps.getSampleBuffers() && ( reqNewGLADOnscrn || reqNewGLADSamples || reqNewGLADSize );
where '!caps.getSampleBuffers() && ( .. )' is due to Bug 830,
swapGLContextAndAllGLEventListener and onscreen MSAA w/ NV/GLX does not work.
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java index 767533d40..13affdf49 100644 --- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java +++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java @@ -519,24 +519,26 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto if( null != printAnimator ) { printAnimator.remove(glad); } + printGLAD = glad; // _not_ default, shall be replaced by offscreen GLAD final GLCapabilities caps = (GLCapabilities)glad.getChosenGLCapabilities().cloneMutable(); final int printNumSamples = printAWTTiles.getNumSamples(caps); GLDrawable printDrawable = printGLAD.getDelegatedDrawable(); final boolean reqNewGLADSamples = printNumSamples != caps.getNumSamples(); final boolean reqNewGLADSize = printAWTTiles.customTileWidth != -1 && printAWTTiles.customTileWidth != printDrawable.getWidth() || printAWTTiles.customTileHeight != -1 && printAWTTiles.customTileHeight != printDrawable.getHeight(); - final boolean reqNewGLAD = !caps.getSampleBuffers(); // reqNewGLADSamples || reqNewGLADSize ; + final boolean reqNewGLADOnscrn = caps.isOnscreen(); + + // It is desired to use a new offscreen GLAD, however Bug 830 forbids this for AA onscreen context. + // Bug 830: swapGLContextAndAllGLEventListener and onscreen MSAA w/ NV/GLX + final boolean reqNewGLAD = !caps.getSampleBuffers() && ( reqNewGLADOnscrn || reqNewGLADSamples || reqNewGLADSize ); if( DEBUG ) { - System.err.println("AWT print.setup: reqNewGLAD "+reqNewGLAD+"[ samples "+reqNewGLADSamples+", size "+reqNewGLADSize+"], "+ + System.err.println("AWT print.setup: reqNewGLAD "+reqNewGLAD+"[ onscreen "+reqNewGLADOnscrn+", samples "+reqNewGLADSamples+", size "+reqNewGLADSize+"], "+ ", drawableSize "+printDrawable.getWidth()+"x"+printDrawable.getHeight()+ ", customTileSize "+printAWTTiles.customTileWidth+"x"+printAWTTiles.customTileHeight+ ", scaleMat "+printAWTTiles.scaleMatX+" x "+printAWTTiles.scaleMatY+ ", numSamples "+printAWTTiles.customNumSamples+" -> "+printNumSamples+", printAnimator "+printAnimator); } - if( caps.getSampleBuffers() ) { - // Bug 830: swapGLContextAndAllGLEventListener and onscreen MSAA w/ NV/GLX - printGLAD = glad; - } else { + if( reqNewGLAD ) { caps.setDoubleBuffered(false); caps.setOnscreen(false); if( printNumSamples != caps.getNumSamples() ) { |