Remove all internal use of deprecated cogl_clip_* API
authorRobert Bragg <robert@linux.intel.com>
Thu, 5 Nov 2009 16:50:24 +0000 (16:50 +0000)
committerRobert Bragg <robert@linux.intel.com>
Thu, 5 Nov 2009 21:10:18 +0000 (21:10 +0000)
cogl_clip_push, and cogl_clip_push_window_rect which are now deprecated were
used in various places internally so this just switches to using the
replacement functions.

clutter/clutter-actor.c
clutter/clutter-main.c
clutter/clutter-text.c
tests/conform/test-cogl-viewport.c
tests/interactive/test-clip.c

index dcc14c5..0b38fe4 100644 (file)
@@ -2359,10 +2359,10 @@ clutter_actor_paint (ClutterActor *self)
 
   if (priv->has_clip)
     {
-      cogl_clip_push (priv->clip[0],
-                     priv->clip[1],
-                     priv->clip[2],
-                     priv->clip[3]);
+      cogl_clip_push_rectangle (priv->clip[0],
+                                priv->clip[1],
+                                priv->clip[0] + priv->clip[2],
+                                priv->clip[1] + priv->clip[3]);
       clip_set = TRUE;
     }
   else if (priv->clip_to_allocation)
@@ -2372,7 +2372,7 @@ clutter_actor_paint (ClutterActor *self)
       width  = priv->allocation.x2 - priv->allocation.x1;
       height = priv->allocation.y2 - priv->allocation.y1;
 
-      cogl_clip_push (0, 0, width, height);
+      cogl_clip_push_rectangle (0, 0, width, height);
       clip_set = TRUE;
     }
 
index b6bb287..d0b6b04 100644 (file)
@@ -489,7 +489,7 @@ _clutter_do_pick (ClutterStage   *stage,
   _clutter_stage_maybe_setup_viewport (stage);
 
   if (G_LIKELY (!(clutter_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS)))
-    cogl_clip_push_window_rect (x, y, 1, 1);
+    cogl_clip_push_window_rectangle (x, y, 1, 1);
 
   cogl_color_set_from_4ub (&white, 255, 255, 255, 255);
   cogl_disable_fog ();
index f2be3ea..f8432d4 100644 (file)
@@ -1610,9 +1610,9 @@ clutter_text_paint (ClutterActor *self)
 
       pango_layout_get_extents (layout, NULL, &logical_rect);
 
-      cogl_clip_push (0, 0,
-                      (alloc.x2 - alloc.x1),
-                      (alloc.y2 - alloc.y1));
+      cogl_clip_push_rectangle (0, 0,
+                                (alloc.x2 - alloc.x1),
+                                (alloc.y2 - alloc.y1));
       clip_set = TRUE;
 
       actor_width = (alloc.x2 - alloc.x1)
index 1188b3b..693b182 100644 (file)
@@ -154,7 +154,7 @@ on_paint (ClutterActor *actor, void *state)
                      400); /* height */
   /* clear everything... */
   cogl_clear (&black, COGL_BUFFER_BIT_COLOR);
-  cogl_clip_push_window_rect (20, 10, 100, 200);
+  cogl_clip_push_window_rectangle (20, 10, 100, 200);
   /* fill the viewport with blue.. */
   cogl_set_source_color4ub (0x00, 0x00, 0xff, 0xff);
   cogl_rectangle (-1, 1, 1, -1);
@@ -191,7 +191,8 @@ on_paint (ClutterActor *actor, void *state)
   /* XXX: Rotate just enough to stop Cogl from converting our model space
    * rectangle into a window space rectangle.. */
   cogl_rotate (0.1, 0, 0, 1);
-  cogl_clip_push (-(width/2.0), -(height/2.0), width, height);
+  cogl_clip_push_rectangle (-(width/2.0), -(height/2.0),
+                            width/2.0, height/2.0);
   cogl_pop_matrix ();
   /* fill the viewport with green.. */
   cogl_set_source_color4ub (0x00, 0xff, 0x00, 0xff);
@@ -283,7 +284,7 @@ on_paint (ClutterActor *actor, void *state)
                      400); /* height */
   /* clear everything... */
   cogl_clear (&black, COGL_BUFFER_BIT_COLOR);
-  cogl_clip_push_window_rect (20, 10, 100, 200);
+  cogl_clip_push_window_rectangle (20, 10, 100, 200);
   /* fill the viewport with blue.. */
   cogl_set_source_color4ub (0x00, 0x00, 0xff, 0xff);
   cogl_rectangle (-1, 1, 1, -1);
@@ -320,7 +321,8 @@ on_paint (ClutterActor *actor, void *state)
   /* XXX: Rotate just enough to stop Cogl from converting our model space
    * rectangle into a window space rectangle.. */
   cogl_rotate (0.1, 0, 0, 1);
-  cogl_clip_push (-(width/2.0), -(height/2.0), width, height);
+  cogl_clip_push_rectangle (-(width/2.0), -(height/2.0),
+                            width/2, height/2);
   cogl_pop_matrix ();
   /* fill the viewport with green.. */
   cogl_set_source_color4ub (0x00, 0xff, 0x00, 0xff);
index 3414bd3..dbfcea1 100644 (file)
@@ -134,10 +134,10 @@ on_paint (ClutterActor *actor, CallbackData *data)
       Clip *clip = (Clip *) node->data;
 
       if (clip->type == CLIP_RECTANGLE)
-        cogl_clip_push (clip->x1,
-                        clip->y1,
-                        clip->x2 - clip->x1,
-                        clip->y2 - clip->y1);
+        cogl_clip_push_rectangle (clip->x1,
+                                  clip->y1,
+                                  clip->x2,
+                                  clip->y2);
       else
         {
           make_clip_path (clip);