[clip-stack] Use signed integers while combining window space clip rectangles

Use signed integers while combining window space clip rectangles, so we avoid
arithmatic errors later resulting in glScissor getting negative width and
height arguments.
This commit is contained in:
Robert Bragg 2009-06-22 00:58:32 +01:00
parent 21d02307eb
commit 096c1df0f4

View File

@ -317,10 +317,10 @@ _cogl_clip_stack_rebuild (void)
gboolean using_stencil_buffer = FALSE; gboolean using_stencil_buffer = FALSE;
GList *node; GList *node;
CoglClipStack *stack; CoglClipStack *stack;
guint scissor_x0 = 0; gint scissor_x0 = 0;
guint scissor_y0 = 0; gint scissor_y0 = 0;
guint scissor_x1 = G_MAXUINT; gint scissor_x1 = G_MAXINT;
guint scissor_y1 = G_MAXUINT; gint scissor_y1 = G_MAXINT;
_COGL_GET_CONTEXT (ctx, NO_RETVAL); _COGL_GET_CONTEXT (ctx, NO_RETVAL);
@ -418,7 +418,7 @@ _cogl_clip_stack_rebuild (void)
scissor_x0 = scissor_y0 = scissor_x1 = scissor_y1 = 0; scissor_x0 = scissor_y0 = scissor_x1 = scissor_y1 = 0;
if (!(scissor_x0 == 0 && scissor_y0 == 0 && if (!(scissor_x0 == 0 && scissor_y0 == 0 &&
scissor_x1 == G_MAXUINT && scissor_y1 == G_MAXUINT)) scissor_x1 == G_MAXINT && scissor_y1 == G_MAXINT))
{ {
GE (glEnable (GL_SCISSOR_TEST)); GE (glEnable (GL_SCISSOR_TEST));
GE (glScissor (scissor_x0, scissor_y0, GE (glScissor (scissor_x0, scissor_y0,