[clutter/tomeu/cogl2: 2/2] Remove use of the deprecated function cogl_clip_push_window_rectangle



commit 5c26ab00b4467908002e736596b81cada1ec9863
Author: Tomeu Vizoso <tomeu vizoso collabora com>
Date:   Mon Jun 11 17:07:27 2012 +0200

    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 f5bf319..f7e4374 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 20ef0b1..78fbcfa 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 cab4474..abcc91f 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 b3226cd..a64c259 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]