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
This commit is contained in:
Jonas Dreßler 2020-02-26 17:44:18 +01:00 committed by Carlos Garnacho
parent 1e0b015ce8
commit 46e38ff61a

View File

@ -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) );
}