From abae6013e10e08cc67be53d5d067ca5ed4ad7ee3 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Thu, 5 Nov 2009 16:50:24 +0000 Subject: [PATCH] Remove all internal use of deprecated cogl_clip_* API 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 | 10 +++++----- clutter/clutter-main.c | 2 +- clutter/clutter-text.c | 6 +++--- tests/conform/test-cogl-viewport.c | 10 ++++++---- tests/interactive/test-clip.c | 8 ++++---- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index dcc14c5ee..0b38fe4c8 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -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; } diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index b6bb287e0..d0b6b0420 100644 --- a/clutter/clutter-main.c +++ b/clutter/clutter-main.c @@ -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 (); diff --git a/clutter/clutter-text.c b/clutter/clutter-text.c index f2be3ea27..f8432d4e8 100644 --- a/clutter/clutter-text.c +++ b/clutter/clutter-text.c @@ -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) diff --git a/tests/conform/test-cogl-viewport.c b/tests/conform/test-cogl-viewport.c index 1188b3bd2..693b18278 100644 --- a/tests/conform/test-cogl-viewport.c +++ b/tests/conform/test-cogl-viewport.c @@ -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); diff --git a/tests/interactive/test-clip.c b/tests/interactive/test-clip.c index 3414bd3c4..dbfcea146 100644 --- a/tests/interactive/test-clip.c +++ b/tests/interactive/test-clip.c @@ -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);