From 505309f659d349c95c16297d5e6785f83764c740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sat, 1 Dec 2018 20:15:23 +0100 Subject: WM: Optimization: Don't clear the window color buffer This is not needed and is rather costly. Can be reverted if that causes problem. --- source/blender/windowmanager/intern/wm_draw.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/windowmanager/intern/wm_draw.c') diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 00364489af7..d6058ac0d28 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -622,8 +622,14 @@ static void wm_draw_window_onscreen(bContext *C, wmWindow *win, int view) /* Draw into the window framebuffer, in full window coordinates. */ wmWindowViewport(win); + + /* We draw on all pixels of the windows so we don't need to clear them before. + * Actually this is only a problem when resizing the window. + * If it becomes a problem we should clear only when window size changes. */ +#if 0 glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT); +#endif /* Blit non-overlapping area regions. */ ED_screen_areas_iter(win, screen, sa) { -- cgit v1.2.3