From ebf549db2d9341d99e0d0847b948dd798d98f7dc Mon Sep 17 00:00:00 2001 From: Dor Askayo Date: Fri, 22 Nov 2019 17:12:03 +0100 Subject: [PATCH] glamor: make sure the correct FBO is cleared MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This also removes an unnecesary call to glDrawBuffer. Signed-off-by: Dor Askayo Fixes: 0e9a0c20 - "xwayland: clear pixmaps after creation in rootless mode" Closes: https://gitlab.freedesktop.org/xorg/xserver/issues/933 Reviewed-by: Michel Dänzer --- glamor/glamor_fbo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c index 4b3338b43..e045d247e 100644 --- a/glamor/glamor_fbo.c +++ b/glamor/glamor_fbo.c @@ -253,7 +253,8 @@ glamor_pixmap_clear_fbo(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *f glClearTexImage(fbo->tex, 0, pixmap_format->format, pixmap_format->type, NULL); } else { - glDrawBuffer(GL_COLOR_ATTACHMENT0); /* assumes fbo->fb was attached as GL_COLOR_ATTACHMENT0 */ + glamor_set_destination_pixmap_fbo(glamor_priv, fbo, 0, 0, fbo->width, fbo->height); + glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); }