diff options
author | Benjamin Otte <otte@redhat.com> | 2010-06-28 14:44:12 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-06-29 16:06:38 +0200 |
commit | 3e96cfe8fcfeedabc09b2a8b3aa87007a3b5a2a0 (patch) | |
tree | a5b8a39ad674b77e2d1beeb234c0cdd48d218b20 /gdk/directfb | |
parent | 52200eee01cc055adaefb678d6c6f04455d1a593 (diff) | |
download | gtk+-3e96cfe8fcfeedabc09b2a8b3aa87007a3b5a2a0.tar.gz |
Deprecate the GdkRegion API
Includes fixing all callers to use the cairo region API instead. This is
usually just replacing the function names, the only difference is
gdk_region_get_rectangles() being replaced by
cairo_region_num_rectangles() and cairo_region_get_rectangle() which
required a bit more work.
https://bugzilla.gnome.org/show_bug.cgi?id=613284
Diffstat (limited to 'gdk/directfb')
-rw-r--r-- | gdk/directfb/gdkdrawable-directfb.c | 26 | ||||
-rw-r--r-- | gdk/directfb/gdkgeometry-directfb.c | 52 | ||||
-rw-r--r-- | gdk/directfb/gdkwindow-directfb.c | 6 |
3 files changed, 42 insertions, 42 deletions
diff --git a/gdk/directfb/gdkdrawable-directfb.c b/gdk/directfb/gdkdrawable-directfb.c index c142ba596b..da314e54a2 100644 --- a/gdk/directfb/gdkdrawable-directfb.c +++ b/gdk/directfb/gdkdrawable-directfb.c @@ -258,7 +258,7 @@ gdk_directfb_clip_region (GdkDrawable *drawable, GDKDFB_RECTANGLE_VALS_FROM_BOX( &private->paint_region.extents ), private->paint_region.numRects ); - gdk_region_intersect (ret_clip, &private->paint_region); + cairo_region_intersect (ret_clip, &private->paint_region); } if (gc) @@ -273,13 +273,13 @@ gdk_directfb_clip_region (GdkDrawable *drawable, if (gc->clip_x_origin || gc->clip_y_origin) { - gdk_region_offset (ret_clip, -gc->clip_x_origin, -gc->clip_y_origin); - gdk_region_intersect (ret_clip, region); - gdk_region_offset (ret_clip, gc->clip_x_origin, gc->clip_y_origin); + cairo_region_translate (ret_clip, -gc->clip_x_origin, -gc->clip_y_origin); + cairo_region_intersect (ret_clip, region); + cairo_region_translate (ret_clip, gc->clip_x_origin, gc->clip_y_origin); } else { - gdk_region_intersect (ret_clip, region); + cairo_region_intersect (ret_clip, region); } } @@ -327,7 +327,7 @@ gdk_directfb_clip_region (GdkDrawable *drawable, D_DEBUG_AT( GDKDFB_DrawClip, " -> clipping child [ %4d,%4d - %4dx%4d ] (%ld boxes)\n", GDKDFB_RECTANGLE_VALS_FROM_BOX( &temp.extents ), temp.numRects ); - gdk_region_subtract (ret_clip, &temp); + cairo_region_subtract (ret_clip, &temp); } } @@ -739,7 +739,7 @@ gdk_directfb_draw_points (GdkDrawable *drawable, while (npoints > 0) { - if (gdk_region_point_in (&clip, points->x, points->y)) + if (cairo_region_contains_point (&clip, points->x, points->y)) { impl->surface->FillRectangle (impl->surface, points->x, points->y, 1, 1); @@ -940,7 +940,7 @@ gdk_directfb_draw_image (GdkDrawable *drawable, gdk_directfb_clip_region (drawable, gc, &dest_rect, &clip); - if (!gdk_region_empty (&clip)) + if (!cairo_region_is_empty (&clip)) { DFBRectangle src_rect = { xsrc, ysrc, width, height }; @@ -1218,15 +1218,15 @@ gdk_directfb_draw_pixbuf (GdkDrawable *drawable, tmp_rect.width = width; tmp_rect.height = height; - drect = gdk_region_rectangle (&tmp_rect); + drect = cairo_region_create_rectangle (&tmp_rect); clip = gdk_drawable_get_clip_region (drawable); - gdk_region_intersect (drect, clip); + cairo_region_intersect (drect, clip); - gdk_region_get_clipbox (drect, &tmp_rect); + cairo_region_get_extents (drect, &tmp_rect); - gdk_region_destroy (drect); - gdk_region_destroy (clip); + cairo_region_destroy (drect); + cairo_region_destroy (clip); if (tmp_rect.width == 0 || tmp_rect.height == 0) diff --git a/gdk/directfb/gdkgeometry-directfb.c b/gdk/directfb/gdkgeometry-directfb.c index f848956afa..bddc2dd76a 100644 --- a/gdk/directfb/gdkgeometry-directfb.c +++ b/gdk/directfb/gdkgeometry-directfb.c @@ -91,24 +91,24 @@ _gdk_directfb_window_scroll (GdkWindow *window, /* Move the current invalid region */ if (private->update_area) - gdk_region_offset (private->update_area, dx, dy); + cairo_region_translate (private->update_area, dx, dy); if (GDK_WINDOW_IS_MAPPED (window)) { GdkRectangle clip_rect = { 0, 0, impl->width, impl->height }; GdkRectangle rect = { dx, dy, impl->width, impl->height }; - invalidate_region = gdk_region_rectangle (&clip_rect); + invalidate_region = cairo_region_create_rectangle (&clip_rect); if (gdk_rectangle_intersect (&rect, &clip_rect, &rect) && (!private->update_area || - !gdk_region_rect_in (private->update_area, &rect))) + !cairo_region_contains_rectangle (private->update_area, &rect))) { GdkRegion *region; - region = gdk_region_rectangle (&rect); - gdk_region_subtract (invalidate_region, region); - gdk_region_destroy (region); + region = cairo_region_create_rectangle (&rect); + cairo_region_subtract (invalidate_region, region); + cairo_region_destroy (region); if (impl->surface) { @@ -141,7 +141,7 @@ _gdk_directfb_window_scroll (GdkWindow *window, if (invalidate_region) { gdk_window_invalidate_region (window, invalidate_region, TRUE); - gdk_region_destroy (invalidate_region); + cairo_region_destroy (invalidate_region); } } @@ -188,31 +188,31 @@ _gdk_directfb_window_move_region (GdkWindow *window, return; GdkRectangle clip_rect = { 0, 0, impl->width, impl->height }; - window_clip = gdk_region_rectangle (&clip_rect); + window_clip = cairo_region_create_rectangle (&clip_rect); /* compute source regions */ - src_region = gdk_region_copy (region); - brought_in = gdk_region_copy (region); - gdk_region_intersect (src_region, window_clip); + src_region = cairo_region_copy (region); + brought_in = cairo_region_copy (region); + cairo_region_intersect (src_region, window_clip); - gdk_region_subtract (brought_in, src_region); - gdk_region_offset (brought_in, dx, dy); + cairo_region_subtract (brought_in, src_region); + cairo_region_translate (brought_in, dx, dy); /* compute destination regions */ - dest_region = gdk_region_copy (src_region); - gdk_region_offset (dest_region, dx, dy); - gdk_region_intersect (dest_region, window_clip); - gdk_region_get_clipbox (dest_region, &dest_extents); + dest_region = cairo_region_copy (src_region); + cairo_region_translate (dest_region, dx, dy); + cairo_region_intersect (dest_region, window_clip); + cairo_region_get_extents (dest_region, &dest_extents); - gdk_region_destroy (window_clip); + cairo_region_destroy (window_clip); /* calculating moving part of current invalid area */ moving_invalid_region = NULL; if (private->update_area) { - moving_invalid_region = gdk_region_copy (private->update_area); - gdk_region_intersect (moving_invalid_region, src_region); - gdk_region_offset (moving_invalid_region, dx, dy); + moving_invalid_region = cairo_region_copy (private->update_area); + cairo_region_intersect (moving_invalid_region, src_region); + cairo_region_translate (moving_invalid_region, dx, dy); } /* invalidate all of the src region */ @@ -220,18 +220,18 @@ _gdk_directfb_window_move_region (GdkWindow *window, /* un-invalidate destination region */ if (private->update_area) - gdk_region_subtract (private->update_area, dest_region); + cairo_region_subtract (private->update_area, dest_region); /* invalidate moving parts of existing update area */ if (moving_invalid_region) { gdk_window_invalidate_region (window, moving_invalid_region, FALSE); - gdk_region_destroy (moving_invalid_region); + cairo_region_destroy (moving_invalid_region); } /* invalidate area brought in from off-screen */ gdk_window_invalidate_region (window, brought_in, FALSE); - gdk_region_destroy (brought_in); + cairo_region_destroy (brought_in); /* Actually do the moving */ if (impl->surface) @@ -250,8 +250,8 @@ _gdk_directfb_window_move_region (GdkWindow *window, impl->surface->SetClip (impl->surface, NULL); impl->surface->Flip(impl->surface,&destination,0); } - gdk_region_destroy (src_region); - gdk_region_destroy (dest_region); + cairo_region_destroy (src_region); + cairo_region_destroy (dest_region); } #define __GDK_GEOMETRY_X11_C__ diff --git a/gdk/directfb/gdkwindow-directfb.c b/gdk/directfb/gdkwindow-directfb.c index 83da5b8a84..ed086c6f09 100644 --- a/gdk/directfb/gdkwindow-directfb.c +++ b/gdk/directfb/gdkwindow-directfb.c @@ -227,7 +227,7 @@ gdk_window_impl_directfb_get_visible_region (GdkDrawable *drawable) D_DEBUG_AT( GDKDFB_Window, " -> returning %4d,%4d-%4dx%4d\n", drect.x, drect.y, drect.w, drect.h ); - return gdk_region_rectangle (&rect); + return cairo_region_create_rectangle (&rect); } static void @@ -2648,7 +2648,7 @@ gdk_window_impl_directfb_begin_paint_region (GdkPaintable *paintable, DFB_RECTANGLE_VALS_FROM_REGION( &impl->paint_region.extents ), impl->paint_region.numRects ); /* Add the new region to the paint region... */ - gdk_region_union (&impl->paint_region, region); + cairo_region_union (&impl->paint_region, region); } else { @@ -2668,7 +2668,7 @@ gdk_window_impl_directfb_begin_paint_region (GdkPaintable *paintable, DFB_RECTANGLE_VALS_FROM_REGION( &impl->paint_region.extents ), impl->paint_region.numRects ); /* ...but clip the initial/compound result against the clip region. */ - gdk_region_intersect (&impl->paint_region, &impl->clip_region); + cairo_region_intersect (&impl->paint_region, &impl->clip_region); D_DEBUG_AT( GDKDFB_Window, " -> clipped %4d,%4d-%4dx%4d (%ld boxes)\n", DFB_RECTANGLE_VALS_FROM_REGION( &impl->paint_region.extents ), impl->paint_region.numRects ); |