From 35ae97f712ab5e1e68a5f0ec315da90cd86d6f57 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Sun, 26 Jan 2014 09:27:12 -0500 Subject: [PATCH] fix #1844 --- core/src/processing/opengl/PGraphicsOpenGL.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index cb1f5fb0a..f3a3d8d8d 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -6381,14 +6381,13 @@ public class PGraphicsOpenGL extends PGraphics { protected void endOffscreenDraw() { - // Set alpha channel to opaque in order to match behavior of JAVA2D: - // https://github.com/processing/processing/issues/1844 - // but still not working as expected. Some strange artifacts with multismapled - // surfaces (see second code example in the issue above). -// pgl.colorMask(false, false, false, true); -// pgl.clearColor(0, 0, 0, backgroundColor); -// pgl.clear(PGL.COLOR_BUFFER_BIT); -// pgl.colorMask(true, true, true, true); + if (backgroundA == 1) { + // Set alpha channel to opaque in order to match behavior of JAVA2D: + pgl.colorMask(false, false, false, true); + pgl.clearColor(0, 0, 0, backgroundA); + pgl.clear(PGL.COLOR_BUFFER_BIT); + pgl.colorMask(true, true, true, true); + } if (offscreenMultisample) { multisampleFramebuffer.copyColor(offscreenFramebuffer);