[Bf-codereview] Fwd: Clear screen before displaying window (issue 5505071)

Nicholas Bishop nicholasbishop at gmail.com
Sat Dec 24 21:24:57 CET 2011


Forgot to add bf-code-review at blender.org to reviewers.


---------- Forwarded message ----------
From:  <NicholasBishop at gmail.com>
Date: Sat, Dec 24, 2011 at 3:19 PM
Subject: Clear screen before displaying window (issue 5505071)
To: NicholasBishop at gmail.com
Cc: reply at codereview-hr.appspotmail.com


Reviewers: ,

Description:
On my system (Ubuntu 11.10, ATI Mobility Radeon HD 5650, Gallium
drivers) the default GL display seems to be using uninitialized memory.
During Blender startup, when the window is first displayed there is a
brief flash of random data. This patch fixes by adding a glClear()
inbetween creating the GLX context and displaying the window.

I also call glClearColor with a hardcoded grey from the default theme.

Please review this at http://codereview.appspot.com/5505071/

Affected files:
 intern/ghost/intern/GHOST_WindowX11.cpp


Index: intern/ghost/intern/GHOST_WindowX11.cpp
===================================================================
--- intern/ghost/intern/GHOST_WindowX11.cpp     (revision 42866)
+++ intern/ghost/intern/GHOST_WindowX11.cpp     (working copy)
@@ -1344,7 +1344,9 @@
                       if (!s_firstContext) {
                               s_firstContext = m_context;
                       }
-                       glXMakeCurrent(m_display, m_window,m_context);
+                       glXMakeCurrent(m_display, m_window,m_context);
+                       glClearColor(0.447, 0.447, 0.447, 0);
+                       glClear(GL_COLOR_BUFFER_BIT);
                       success = GHOST_kSuccess;
               } else {
                       success = GHOST_kFailure;


More information about the Bf-codereview mailing list