← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] OpenGL: use source alpha only for direct (no AA) rendering

 

Hi JP,

I think the attached is a better fix.

-Jon

On Fri, Jan 5, 2018 at 8:05 AM, Jon Evans <jon@xxxxxxxxxxxxx> wrote:

> Hi JP, you are right, I missed this in my back-and-forth testing.  I will
> look for another workaround for this.
>
> On Fri, Jan 5, 2018 at 5:39 AM, jp charras <jp.charras@xxxxxxxxxx> wrote:
>
>> Le 05/01/2018 à 05:47, Jon Evans a écrit :
>> > Fixes background color being wrong in OpenGL canvas when AA is disabled
>> >
>>
>> Hi Jon,
>>
>> I tested your patch (on W7 32 bits)
>>
>> It fixes the background color issue, but creates a new one:
>> the F.Cu layer (top layer) is drawn with a incorrect color (looks like
>> roughly half of RGB values)
>>
>>
>> --
>> Jean-Pierre CHARRAS
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
>>
>
>
From 54fbe24321a9720e8ddff58adfa5b179026d573f Mon Sep 17 00:00:00 2001
From: Jon Evans <jon@xxxxxxxxxxxxx>
Date: Sat, 6 Jan 2018 09:47:17 -0500
Subject: [PATCH] OpenGL: Fix background color being drawn twice in no-AA mode

Fixes: lp:1741363
* https://bugs.launchpad.net/kicad/+bug/1741363
---
 common/gal/opengl/opengl_gal.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp
index 729c103c8..ec98fe771 100644
--- a/common/gal/opengl/opengl_gal.cpp
+++ b/common/gal/opengl/opengl_gal.cpp
@@ -1189,7 +1189,8 @@ void OPENGL_GAL::ClearScreen( )
 {
     // Clear screen
     compositor->SetBuffer( OPENGL_COMPOSITOR::DIRECT_RENDERING );
-    glClearColor( m_clearColor.r, m_clearColor.g, m_clearColor.b, m_clearColor.a );
+    // NOTE: Black used here instead of m_clearColor; it will be composited later
+    glClearColor( 0, 0, 0, 1 );
     glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT );
 }
 
-- 
2.14.1


Follow ups

References