From 46e38ff61a7357d87f17c063eae51d84c4b322a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Wed, 26 Feb 2020 17:44:18 +0100 Subject: [PATCH] cogl/clip-stack: Set color and depth mask when drawing rectangle clips Just like with the other functions drawing to the stencil buffer, we should make sure the depth and color masks are set to FALSE during drawing. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1096 --- cogl/cogl/driver/gl/cogl-clip-stack-gl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cogl/cogl/driver/gl/cogl-clip-stack-gl.c b/cogl/cogl/driver/gl/cogl-clip-stack-gl.c index 4946f8690..24a714f6c 100644 --- a/cogl/cogl/driver/gl/cogl-clip-stack-gl.c +++ b/cogl/cogl/driver/gl/cogl-clip-stack-gl.c @@ -73,6 +73,9 @@ add_stencil_clip_rectangle (CoglFramebuffer *framebuffer, ctx->current_projection_entry = projection_stack->last_entry; ctx->current_modelview_entry = modelview_entry; + GE( ctx, glColorMask (FALSE, FALSE, FALSE, FALSE) ); + GE( ctx, glDepthMask (FALSE) ); + if (merge) { /* Add one to every pixel of the stencil buffer in the @@ -116,6 +119,8 @@ add_stencil_clip_rectangle (CoglFramebuffer *framebuffer, ctx->current_modelview_entry = old_modelview_entry; /* Restore the stencil mode */ + GE( ctx, glDepthMask (TRUE) ); + GE( ctx, glColorMask (TRUE, TRUE, TRUE, TRUE) ); GE( ctx, glStencilFunc (GL_EQUAL, 0x1, 0x1) ); GE( ctx, glStencilOp (GL_KEEP, GL_KEEP, GL_KEEP) ); }