From c4834adf1d9d040d061d152e37432eeb0f7db9c0 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Tue, 11 Nov 2014 12:06:45 -0500 Subject: [PATCH 1/3] use executable task to copy keytool on Mac so file permissions are preserved --- build/build.xml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/build/build.xml b/build/build.xml index 9ee6b9ec8..f52d1f639 100755 --- a/build/build.xml +++ b/build/build.xml @@ -470,10 +470,13 @@ - + 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 instead --> + + + From e2dda69876423a7cb7867ac7118b576a3aed16a4 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Tue, 11 Nov 2014 13:23:36 -0500 Subject: [PATCH 2/3] properly catches and re-throws exceptions that ocurred during drawing --- core/src/processing/opengl/PJOGL.java | 52 +++++++++++++++------------ 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/core/src/processing/opengl/PJOGL.java b/core/src/processing/opengl/PJOGL.java index da19a93e0..324431a43 100644 --- a/core/src/processing/opengl/PJOGL.java +++ b/core/src/processing/opengl/PJOGL.java @@ -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); } } } @@ -865,7 +869,11 @@ public class PJOGL extends PGL { } } - pg.parent.handleDraw(); + try { + pg.parent.handleDraw(); + } catch (Exception ex) { + drawException = ex; + } drawLatch.countDown(); } From e8ca4943ab881af5c3eeeeaff91c3e6b7dfaddf4 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Tue, 11 Nov 2014 15:24:50 -0500 Subject: [PATCH 3/3] Use non-deprecated version of FBObject.reset() --- core/src/processing/opengl/PJOGL.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/processing/opengl/PJOGL.java b/core/src/processing/opengl/PJOGL.java index 324431a43..7e2c4e730 100644 --- a/core/src/processing/opengl/PJOGL.java +++ b/core/src/processing/opengl/PJOGL.java @@ -834,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;