Fixes background color being wrong in OpenGL canvas when AA is disabled
From a741215326bd1ff4ca5b1fca830970ad72c3028c Mon Sep 17 00:00:00 2001 From: Jon Evans <[email protected]> Date: Thu, 4 Jan 2018 23:46:50 -0500 Subject: [PATCH] OpenGL: use source alpha only for direct (no AA) rendering
Without this change, the background color was getting drawn twice and multiplied together if AA is disabled. Fixes: lp:1741363 * https://bugs.launchpad.net/kicad/+bug/1741363 --- common/gal/opengl/opengl_compositor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/gal/opengl/opengl_compositor.cpp b/common/gal/opengl/opengl_compositor.cpp index 8b7e3d1a7..173cd6421 100644 --- a/common/gal/opengl/opengl_compositor.cpp +++ b/common/gal/opengl/opengl_compositor.cpp @@ -330,7 +330,10 @@ void OPENGL_COMPOSITOR::DrawBuffer( unsigned int aSourceHandle, unsigned int aDe // Depth test has to be disabled to make transparency working glDisable( GL_DEPTH_TEST ); - glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA ); + + // Use source alpha only for direct (no AA) rendering + GLenum sfactor = ( aDestHandle == DIRECT_RENDERING ) ? GL_SRC_ALPHA : GL_ONE; + glBlendFunc( sfactor, GL_ONE_MINUS_SRC_ALPHA ); // Enable texturing and bind the main texture glEnable( GL_TEXTURE_2D ); -- 2.14.1
_______________________________________________ Mailing list: https://launchpad.net/~kicad-developers Post to : [email protected] Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp

