set alpha channel to opaque after blitting the multisampled FBO, which

fixes #2679
This commit is contained in:
codeanticode
2014-07-31 10:46:57 -04:00
parent 37ff06741e
commit 2acea6287c

View File

@@ -6440,19 +6440,22 @@ public class PGraphicsOpenGL extends PGraphics {
protected void endOffscreenDraw() {
if (offscreenMultisample) {
multisampleFramebuffer.copyColor(offscreenFramebuffer);
}
popFramebuffer();
if (backgroundA == 1) {
// Set alpha channel to opaque in order to match behavior of JAVA2D:
// Set alpha channel to opaque in order to match behavior of JAVA2D, not
// on the multisampled FBO because it leads to wrong background color
// on some Macbooks with AMD graphics.
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);
}
popFramebuffer();
texture.updateTexels(); // Mark all texels in screen texture as modified.
getPrimaryPG().restoreGL();