From 096c1df0f466585af8793aed03770663aa22f730 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Mon, 22 Jun 2009 00:58:32 +0100 Subject: [PATCH] [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. --- common/cogl-clip-stack.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/cogl-clip-stack.c b/common/cogl-clip-stack.c index 896fe9bae..3ef1b2b16 100644 --- a/common/cogl-clip-stack.c +++ b/common/cogl-clip-stack.c @@ -317,10 +317,10 @@ _cogl_clip_stack_rebuild (void) gboolean using_stencil_buffer = FALSE; GList *node; CoglClipStack *stack; - guint scissor_x0 = 0; - guint scissor_y0 = 0; - guint scissor_x1 = G_MAXUINT; - guint scissor_y1 = G_MAXUINT; + gint scissor_x0 = 0; + gint scissor_y0 = 0; + gint scissor_x1 = G_MAXINT; + gint scissor_y1 = G_MAXINT; _COGL_GET_CONTEXT (ctx, NO_RETVAL); @@ -418,7 +418,7 @@ _cogl_clip_stack_rebuild (void) scissor_x0 = scissor_y0 = scissor_x1 = scissor_y1 = 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 (glScissor (scissor_x0, scissor_y0,