Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Ben Fry
2014-11-13 20:52:04 -07:00
2 changed files with 38 additions and 27 deletions

View File

@@ -470,10 +470,13 @@
</bundleapp>
<!-- The 'keytool' file is deleted by our appbundler. Add it back so that
Android signing works properly. (Not modifying our appbundler since
most of the time that appbundler is used, keytool isn't needed. -->
<copy file="${jdk.path.macosx}/Contents/Home/bin/keytool"
todir="macosx/work/Processing.app/Contents/PlugIns/jdk1.7.0_${jdk.update.macosx}.jdk/Contents/Home/jre/bin" />
Android signing works properly. (Not modifying our appbundler since
most of the time that appbundler is used, keytool isn't needed).
Also, because Ant's copy task does not retain file permissions on Unix systems,
we need to use <exec executable="cp" ... > instead -->
<exec executable="cp">
<arg line="${jdk.path.macosx}/Contents/Home/bin/keytool macosx/work/Processing.app/Contents/PlugIns/jdk1.7.0_${jdk.update.macosx}.jdk/Contents/Home/jre/bin"/>
</exec>
<copy todir="macosx/work/Processing.app/Contents/Java">
<fileset dir=".." includes="core/library/**" /> <!-- why this? -->

View File

@@ -172,6 +172,9 @@ public class PJOGL extends PGL {
*/
protected boolean prevCanDraw = false;
/** Stores exceptions that ocurred during drawing */
protected Exception drawException;
// ........................................................
// JOGL's FBO-layer
@@ -687,31 +690,32 @@ public class PJOGL extends PGL {
@Override
protected void requestDraw() {
drawException = null;
boolean canDraw = pg.parent.canDraw();
if (pg.initialized && (canDraw || prevCanDraw)) {
drawLatch = new CountDownLatch(1);
if (WINDOW_TOOLKIT == AWT) {
canvasAWT.display();
} else if (WINDOW_TOOLKIT == NEWT) {
windowNEWT.display();
}
try {
drawLatch = new CountDownLatch(1);
if (WINDOW_TOOLKIT == AWT) {
canvasAWT.display();
} else if (WINDOW_TOOLKIT == NEWT) {
windowNEWT.display();
}
try {
drawLatch.await(DRAW_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
e.printStackTrace();
}
drawLatch.await(DRAW_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (canDraw) prevCanDraw = true;
else prevCanDraw = false;
} catch (GLException e) {
// Unwrap GLException so that only the causing exception is shown.
Throwable tr = e.getCause();
if (tr instanceof RuntimeException) {
throw (RuntimeException)tr;
} else {
throw new RuntimeException(tr);
}
if (canDraw) prevCanDraw = true;
else prevCanDraw = false;
}
// Throw wherever exception happened during drawing outside the GL thread
// to it is properly picked up by the PDE.
if (drawException != null) {
if (drawException instanceof RuntimeException) {
throw (RuntimeException)drawException;
} else {
throw new RuntimeException(drawException);
}
}
}
@@ -830,7 +834,7 @@ public class PJOGL extends PGL {
if (frontFBO == null) {
// init
frontFBO = new FBObject();
frontFBO.reset(gl, pg.width, pg.height);
frontFBO.reset(gl, pg.width, pg.height, numSamples);
frontFBO.attachTexture2D(gl, 0, true);
sinkFBO = backFBO.getSamplingSinkFBO();
changedFrontTex = changedBackTex = true;
@@ -865,7 +869,11 @@ public class PJOGL extends PGL {
}
}
pg.parent.handleDraw();
try {
pg.parent.handleDraw();
} catch (Exception ex) {
drawException = ex;
}
drawLatch.countDown();
}