From 5c26ab00b4467908002e736596b81cada1ec9863 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Mon, 11 Jun 2012 17:07:27 +0200 Subject: Remove use of the deprecated function cogl_clip_push_window_rectangle Use cogl_framebuffer_push_scissor_clip instead. --- clutter/clutter-main.c | 4 +++- clutter/clutter-stage.c | 3 ++- clutter/cogl/clutter-stage-cogl.c | 10 ++++++---- tests/conform/test-cogl-viewport.c | 6 ++++-- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index f5bf3190c..f7e437405 100644 --- a/clutter/clutter-main.c +++ b/clutter/clutter-main.c @@ -718,6 +718,7 @@ static CoglPangoFontMap * clutter_context_get_pango_fontmap (void) { ClutterMainContext *self; + CoglContext *context; CoglPangoFontMap *font_map; gdouble resolution; gboolean use_mipmapping; @@ -726,7 +727,8 @@ clutter_context_get_pango_fontmap (void) if (G_LIKELY (self->font_map != NULL)) return self->font_map; - font_map = COGL_PANGO_FONT_MAP (cogl_pango_font_map_new ()); + context = clutter_backend_get_cogl_context (self->backend); + font_map = COGL_PANGO_FONT_MAP (cogl_pango_font_map_new (context)); resolution = clutter_backend_get_resolution (self->backend); cogl_pango_font_map_set_resolution (font_map, resolution); diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index 20ef0b1be..78fbcfa95 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -1489,7 +1489,8 @@ _clutter_stage_do_pick (ClutterStage *stage, { if (G_LIKELY (!(clutter_pick_debug_flags & CLUTTER_DEBUG_DUMP_PICK_BUFFERS))) - cogl_clip_push_window_rectangle (x, y, 1, 1); + cogl_framebuffer_push_scissor_clip (cogl_get_draw_framebuffer (), + x, y, 1, 1); is_clipped = TRUE; } else diff --git a/clutter/cogl/clutter-stage-cogl.c b/clutter/cogl/clutter-stage-cogl.c index cab4474f3..abcc91f4a 100644 --- a/clutter/cogl/clutter-stage-cogl.c +++ b/clutter/cogl/clutter-stage-cogl.c @@ -378,10 +378,12 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window) stage_cogl->using_clipped_redraw = TRUE; - cogl_clip_push_window_rectangle (stage_cogl->bounding_redraw_clip.x, - stage_cogl->bounding_redraw_clip.y, - stage_cogl->bounding_redraw_clip.width, - stage_cogl->bounding_redraw_clip.height); + cogl_framebuffer_push_scissor_clip (cogl_get_draw_framebuffer (), + stage_cogl->bounding_redraw_clip.x, + stage_cogl->bounding_redraw_clip.y, + stage_cogl->bounding_redraw_clip.width, + stage_cogl->bounding_redraw_clip.height); + _clutter_stage_do_paint (CLUTTER_STAGE (wrapper), &stage_cogl->bounding_redraw_clip); cogl_clip_pop (); diff --git a/tests/conform/test-cogl-viewport.c b/tests/conform/test-cogl-viewport.c index b3226cd25..a64c25949 100644 --- a/tests/conform/test-cogl-viewport.c +++ b/tests/conform/test-cogl-viewport.c @@ -154,7 +154,8 @@ on_paint (ClutterActor *actor, void *state) 400); /* height */ /* clear everything... */ cogl_clear (&black, COGL_BUFFER_BIT_COLOR); - cogl_clip_push_window_rectangle (20, 10, 100, 200); + cogl_framebuffer_push_scissor_clip (cogl_get_draw_framebuffer (), + 20, 10, 100, 200); /* fill the viewport with blue.. */ cogl_set_source_color4ub (0x00, 0x00, 0xff, 0xff); cogl_rectangle (-1, 1, 1, -1); @@ -282,7 +283,8 @@ on_paint (ClutterActor *actor, void *state) 400); /* height */ /* clear everything... */ cogl_clear (&black, COGL_BUFFER_BIT_COLOR); - cogl_clip_push_window_rectangle (20, 10, 100, 200); + cogl_framebuffer_push_scissor_clip (cogl_get_draw_framebuffer (), + 20, 10, 100, 200); /* fill the viewport with blue.. */ cogl_set_source_color4ub (0x00, 0x00, 0xff, 0xff); cogl_rectangle (-1, 1, 1, -1); -- cgit v1.2.1