diff --git a/cogl/cogl/driver/gl/cogl-clip-stack-gl.c b/cogl/cogl/driver/gl/cogl-clip-stack-gl.c index bec4d9b45..c2cccf0ee 100644 --- a/cogl/cogl/driver/gl/cogl-clip-stack-gl.c +++ b/cogl/cogl/driver/gl/cogl-clip-stack-gl.c @@ -67,6 +67,7 @@ add_stencil_clip_rectangle (CoglFramebuffer *framebuffer, GE( ctx, glColorMask (FALSE, FALSE, FALSE, FALSE) ); GE( ctx, glDepthMask (FALSE) ); + GE( ctx, glStencilMask (0x3) ); if (merge) { @@ -93,7 +94,6 @@ add_stencil_clip_rectangle (CoglFramebuffer *framebuffer, else { GE( ctx, glEnable (GL_STENCIL_TEST) ); - GE( ctx, glStencilMask (0x1) ); /* Initially disallow everything */ GE( ctx, glClearStencil (0) ); @@ -113,6 +113,7 @@ add_stencil_clip_rectangle (CoglFramebuffer *framebuffer, /* Restore the stencil mode */ GE( ctx, glDepthMask (TRUE) ); GE( ctx, glColorMask (TRUE, TRUE, TRUE, TRUE) ); + GE( ctx, glStencilMask (0x0) ); GE( ctx, glStencilFunc (GL_EQUAL, 0x1, 0x1) ); GE( ctx, glStencilOp (GL_KEEP, GL_KEEP, GL_KEEP) ); }