Commit 3e96cfe8 authored by Benjamin Otte's avatar Benjamin Otte

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
parent 52200eee
...@@ -47,15 +47,12 @@ Defines the x and y coordinates of a point. ...@@ -47,15 +47,12 @@ Defines the x and y coordinates of a point.
@x: the x coordinate of the point. @x: the x coordinate of the point.
@y: the y coordinate of the point. @y: the y coordinate of the point.
<!-- ##### STRUCT GdkRectangle ##### --> <!-- ##### TYPEDEF GdkRectangle ##### -->
<para> <para>
Defines the position and size of a rectangle. Defines the position and size of a rectangle. It is identical to
#cairo_rectangle_int_t.
</para> </para>
@x: the x coordinate of the left edge of the rectangle.
@y: the y coordinate of the top of the rectangle.
@width: the width of the rectangle.
@height: the height of the rectangle.
<!-- ##### FUNCTION gdk_rectangle_intersect ##### --> <!-- ##### FUNCTION gdk_rectangle_intersect ##### -->
<para> <para>
......
...@@ -258,7 +258,7 @@ gdk_directfb_clip_region (GdkDrawable *drawable, ...@@ -258,7 +258,7 @@ gdk_directfb_clip_region (GdkDrawable *drawable,
GDKDFB_RECTANGLE_VALS_FROM_BOX( &private->paint_region.extents ), GDKDFB_RECTANGLE_VALS_FROM_BOX( &private->paint_region.extents ),
private->paint_region.numRects ); private->paint_region.numRects );
gdk_region_intersect (ret_clip, &private->paint_region); cairo_region_intersect (ret_clip, &private->paint_region);
} }
if (gc) if (gc)
...@@ -273,13 +273,13 @@ gdk_directfb_clip_region (GdkDrawable *drawable, ...@@ -273,13 +273,13 @@ gdk_directfb_clip_region (GdkDrawable *drawable,
if (gc->clip_x_origin || gc->clip_y_origin) if (gc->clip_x_origin || gc->clip_y_origin)
{ {
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);
gdk_region_intersect (ret_clip, region); cairo_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);
} }
else else
{ {
gdk_region_intersect (ret_clip, region); cairo_region_intersect (ret_clip, region);
} }
} }
...@@ -327,7 +327,7 @@ gdk_directfb_clip_region (GdkDrawable *drawable, ...@@ -327,7 +327,7 @@ gdk_directfb_clip_region (GdkDrawable *drawable,
D_DEBUG_AT( GDKDFB_DrawClip, " -> clipping child [ %4d,%4d - %4dx%4d ] (%ld boxes)\n", D_DEBUG_AT( GDKDFB_DrawClip, " -> clipping child [ %4d,%4d - %4dx%4d ] (%ld boxes)\n",
GDKDFB_RECTANGLE_VALS_FROM_BOX( &temp.extents ), temp.numRects ); 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, ...@@ -739,7 +739,7 @@ gdk_directfb_draw_points (GdkDrawable *drawable,
while (npoints > 0) 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, impl->surface->FillRectangle (impl->surface,
points->x, points->y, 1, 1); points->x, points->y, 1, 1);
...@@ -940,7 +940,7 @@ gdk_directfb_draw_image (GdkDrawable *drawable, ...@@ -940,7 +940,7 @@ gdk_directfb_draw_image (GdkDrawable *drawable,
gdk_directfb_clip_region (drawable, gc, &dest_rect, &clip); 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 }; DFBRectangle src_rect = { xsrc, ysrc, width, height };
...@@ -1218,15 +1218,15 @@ gdk_directfb_draw_pixbuf (GdkDrawable *drawable, ...@@ -1218,15 +1218,15 @@ gdk_directfb_draw_pixbuf (GdkDrawable *drawable,
tmp_rect.width = width; tmp_rect.width = width;
tmp_rect.height = height; tmp_rect.height = height;
drect = gdk_region_rectangle (&tmp_rect); drect = cairo_region_create_rectangle (&tmp_rect);
clip = gdk_drawable_get_clip_region (drawable); 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); cairo_region_destroy (drect);
gdk_region_destroy (clip); cairo_region_destroy (clip);
if (tmp_rect.width == 0 || if (tmp_rect.width == 0 ||
tmp_rect.height == 0) tmp_rect.height == 0)
......
...@@ -91,24 +91,24 @@ _gdk_directfb_window_scroll (GdkWindow *window, ...@@ -91,24 +91,24 @@ _gdk_directfb_window_scroll (GdkWindow *window,
/* Move the current invalid region */ /* Move the current invalid region */
if (private->update_area) 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)) if (GDK_WINDOW_IS_MAPPED (window))
{ {
GdkRectangle clip_rect = { 0, 0, impl->width, impl->height }; GdkRectangle clip_rect = { 0, 0, impl->width, impl->height };
GdkRectangle rect = { dx, dy, 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) && if (gdk_rectangle_intersect (&rect, &clip_rect, &rect) &&
(!private->update_area || (!private->update_area ||
!gdk_region_rect_in (private->update_area, &rect))) !cairo_region_contains_rectangle (private->update_area, &rect)))
{ {
GdkRegion *region; GdkRegion *region;
region = gdk_region_rectangle (&rect); region = cairo_region_create_rectangle (&rect);
gdk_region_subtract (invalidate_region, region); cairo_region_subtract (invalidate_region, region);
gdk_region_destroy (region); cairo_region_destroy (region);
if (impl->surface) if (impl->surface)
{ {
...@@ -141,7 +141,7 @@ _gdk_directfb_window_scroll (GdkWindow *window, ...@@ -141,7 +141,7 @@ _gdk_directfb_window_scroll (GdkWindow *window,
if (invalidate_region) if (invalidate_region)
{ {
gdk_window_invalidate_region (window, invalidate_region, TRUE); 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, ...@@ -188,31 +188,31 @@ _gdk_directfb_window_move_region (GdkWindow *window,
return; return;
GdkRectangle clip_rect = { 0, 0, impl->width, impl->height }; 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 */ /* compute source regions */
src_region = gdk_region_copy (region); src_region = cairo_region_copy (region);
brought_in = gdk_region_copy (region); brought_in = cairo_region_copy (region);
gdk_region_intersect (src_region, window_clip); cairo_region_intersect (src_region, window_clip);
gdk_region_subtract (brought_in, src_region); cairo_region_subtract (brought_in, src_region);
gdk_region_offset (brought_in, dx, dy); cairo_region_translate (brought_in, dx, dy);
/* compute destination regions */ /* compute destination regions */
dest_region = gdk_region_copy (src_region); dest_region = cairo_region_copy (src_region);
gdk_region_offset (dest_region, dx, dy); cairo_region_translate (dest_region, dx, dy);
gdk_region_intersect (dest_region, window_clip); cairo_region_intersect (dest_region, window_clip);
gdk_region_get_clipbox (dest_region, &dest_extents); 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 */ /* calculating moving part of current invalid area */
moving_invalid_region = NULL; moving_invalid_region = NULL;
if (private->update_area) if (private->update_area)
{ {
moving_invalid_region = gdk_region_copy (private->update_area); moving_invalid_region = cairo_region_copy (private->update_area);
gdk_region_intersect (moving_invalid_region, src_region); cairo_region_intersect (moving_invalid_region, src_region);
gdk_region_offset (moving_invalid_region, dx, dy); cairo_region_translate (moving_invalid_region, dx, dy);
} }
/* invalidate all of the src region */ /* invalidate all of the src region */
...@@ -220,18 +220,18 @@ _gdk_directfb_window_move_region (GdkWindow *window, ...@@ -220,18 +220,18 @@ _gdk_directfb_window_move_region (GdkWindow *window,
/* un-invalidate destination region */ /* un-invalidate destination region */
if (private->update_area) 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 */ /* invalidate moving parts of existing update area */
if (moving_invalid_region) if (moving_invalid_region)
{ {
gdk_window_invalidate_region (window, moving_invalid_region, FALSE); 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 */ /* invalidate area brought in from off-screen */
gdk_window_invalidate_region (window, brought_in, FALSE); gdk_window_invalidate_region (window, brought_in, FALSE);
gdk_region_destroy (brought_in); cairo_region_destroy (brought_in);
/* Actually do the moving */ /* Actually do the moving */
if (impl->surface) if (impl->surface)
...@@ -250,8 +250,8 @@ _gdk_directfb_window_move_region (GdkWindow *window, ...@@ -250,8 +250,8 @@ _gdk_directfb_window_move_region (GdkWindow *window,
impl->surface->SetClip (impl->surface, NULL); impl->surface->SetClip (impl->surface, NULL);
impl->surface->Flip(impl->surface,&destination,0); impl->surface->Flip(impl->surface,&destination,0);
} }
gdk_region_destroy (src_region); cairo_region_destroy (src_region);
gdk_region_destroy (dest_region); cairo_region_destroy (dest_region);
} }
#define __GDK_GEOMETRY_X11_C__ #define __GDK_GEOMETRY_X11_C__
......
...@@ -227,7 +227,7 @@ gdk_window_impl_directfb_get_visible_region (GdkDrawable *drawable) ...@@ -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 ); 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 static void
...@@ -2648,7 +2648,7 @@ gdk_window_impl_directfb_begin_paint_region (GdkPaintable *paintable, ...@@ -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 ); DFB_RECTANGLE_VALS_FROM_REGION( &impl->paint_region.extents ), impl->paint_region.numRects );
/* Add the new region to the paint region... */ /* Add the new region to the paint region... */
gdk_region_union (&impl->paint_region, region); cairo_region_union (&impl->paint_region, region);
} }
else else
{ {
...@@ -2668,7 +2668,7 @@ gdk_window_impl_directfb_begin_paint_region (GdkPaintable *paintable, ...@@ -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 ); DFB_RECTANGLE_VALS_FROM_REGION( &impl->paint_region.extents ), impl->paint_region.numRects );
/* ...but clip the initial/compound result against the clip region. */ /* ...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", 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 ); DFB_RECTANGLE_VALS_FROM_REGION( &impl->paint_region.extents ), impl->paint_region.numRects );
......
...@@ -977,6 +977,7 @@ gdk_pixmap_lookup_for_display ...@@ -977,6 +977,7 @@ gdk_pixmap_lookup_for_display
#if IN_HEADER(__GDK_REGION_H__) #if IN_HEADER(__GDK_REGION_H__)
#if IN_FILE(__GDK_REGION_GENERIC_C__) #if IN_FILE(__GDK_REGION_GENERIC_C__)
#ifndef GDK_DISABLE_DEPRECATED
gdk_region_copy gdk_region_copy
gdk_region_destroy gdk_region_destroy
gdk_region_empty gdk_region_empty
...@@ -998,12 +999,15 @@ gdk_region_union_with_rect ...@@ -998,12 +999,15 @@ gdk_region_union_with_rect
gdk_region_xor gdk_region_xor
#endif #endif
#endif #endif
#endif
#if IN_HEADER(__GDK_REGION_H__) #if IN_HEADER(__GDK_REGION_H__)
#if IN_FILE(__GDK_POLYREG_GENERIC_C__) #if IN_FILE(__GDK_POLYREG_GENERIC_C__)
#ifndef GDK_DISABLE_DEPRECATED
gdk_region_polygon gdk_region_polygon
#endif #endif
#endif #endif
#endif
#if IN_HEADER(__GDK_RGB_H__) #if IN_HEADER(__GDK_RGB_H__)
#if IN_FILE(__GDK_RGB_C__) #if IN_FILE(__GDK_RGB_C__)
......
...@@ -1059,7 +1059,7 @@ gdk_drawable_real_get_composite_drawable (GdkDrawable *drawable, ...@@ -1059,7 +1059,7 @@ gdk_drawable_real_get_composite_drawable (GdkDrawable *drawable,
* but no area outside of this region will be affected by drawing * but no area outside of this region will be affected by drawing
* primitives. * primitives.
* *
* Returns: a #GdkRegion. This must be freed with gdk_region_destroy() * Returns: a #GdkRegion. This must be freed with cairo_region_destroy()
* when you are done. * when you are done.
**/ **/
GdkRegion * GdkRegion *
...@@ -1079,7 +1079,7 @@ gdk_drawable_get_clip_region (GdkDrawable *drawable) ...@@ -1079,7 +1079,7 @@ gdk_drawable_get_clip_region (GdkDrawable *drawable)
* obscured by other windows, but no area outside of this region * obscured by other windows, but no area outside of this region
* is visible. * is visible.
* *
* Returns: a #GdkRegion. This must be freed with gdk_region_destroy() * Returns: a #GdkRegion. This must be freed with cairo_region_destroy()
* when you are done. * when you are done.
**/ **/
GdkRegion * GdkRegion *
...@@ -1100,7 +1100,7 @@ gdk_drawable_real_get_visible_region (GdkDrawable *drawable) ...@@ -1100,7 +1100,7 @@ gdk_drawable_real_get_visible_region (GdkDrawable *drawable)
gdk_drawable_get_size (drawable, &rect.width, &rect.height); gdk_drawable_get_size (drawable, &rect.width, &rect.height);
return gdk_region_rectangle (&rect); return cairo_region_create_rectangle (&rect);
} }
/** /**
...@@ -1431,15 +1431,15 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable, ...@@ -1431,15 +1431,15 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable *drawable,
tmp_rect.width = width; tmp_rect.width = width;
tmp_rect.height = height; tmp_rect.height = height;
drect = gdk_region_rectangle (&tmp_rect); drect = cairo_region_create_rectangle (&tmp_rect);
clip = gdk_drawable_get_clip_region (drawable); 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); cairo_region_destroy (drect);
gdk_region_destroy (clip); cairo_region_destroy (clip);
if (tmp_rect.width == 0 || if (tmp_rect.width == 0 ||
tmp_rect.height == 0) tmp_rect.height == 0)
......
...@@ -473,7 +473,7 @@ gdk_event_copy (const GdkEvent *event) ...@@ -473,7 +473,7 @@ gdk_event_copy (const GdkEvent *event)
case GDK_EXPOSE: case GDK_EXPOSE:
case GDK_DAMAGE: case GDK_DAMAGE:
if (event->expose.region) if (event->expose.region)
new_event->expose.region = gdk_region_copy (event->expose.region); new_event->expose.region = cairo_region_copy (event->expose.region);
break; break;
case GDK_SETTING: case GDK_SETTING:
...@@ -551,7 +551,7 @@ gdk_event_free (GdkEvent *event) ...@@ -551,7 +551,7 @@ gdk_event_free (GdkEvent *event)
case GDK_EXPOSE: case GDK_EXPOSE:
case GDK_DAMAGE: case GDK_DAMAGE:
if (event->expose.region) if (event->expose.region)
gdk_region_destroy (event->expose.region); cairo_region_destroy (event->expose.region);
break; break;
case GDK_MOTION_NOTIFY: case GDK_MOTION_NOTIFY:
......
...@@ -205,9 +205,9 @@ gdk_gc_finalize (GObject *object) ...@@ -205,9 +205,9 @@ gdk_gc_finalize (GObject *object)
GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc); GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
if (priv->clip_region) if (priv->clip_region)
gdk_region_destroy (priv->clip_region); cairo_region_destroy (priv->clip_region);
if (priv->old_clip_region) if (priv->old_clip_region)
gdk_region_destroy (priv->old_clip_region); cairo_region_destroy (priv->old_clip_region);
if (priv->clip_mask) if (priv->clip_mask)
g_object_unref (priv->clip_mask); g_object_unref (priv->clip_mask);
if (priv->old_clip_mask) if (priv->old_clip_mask)
...@@ -293,7 +293,7 @@ gdk_gc_set_values (GdkGC *gc, ...@@ -293,7 +293,7 @@ gdk_gc_set_values (GdkGC *gc,
if (priv->clip_region) if (priv->clip_region)
{ {
gdk_region_destroy (priv->clip_region); cairo_region_destroy (priv->clip_region);
priv->clip_region = NULL; priv->clip_region = NULL;
} }
} }
...@@ -550,7 +550,7 @@ _gdk_gc_set_clip_region_real (GdkGC *gc, ...@@ -550,7 +550,7 @@ _gdk_gc_set_clip_region_real (GdkGC *gc,
} }
if (priv->clip_region) if (priv->clip_region)
gdk_region_destroy (priv->clip_region); cairo_region_destroy (priv->clip_region);
priv->clip_region = region; priv->clip_region = region;
...@@ -585,9 +585,9 @@ _gdk_gc_add_drawable_clip (GdkGC *gc, ...@@ -585,9 +585,9 @@ _gdk_gc_add_drawable_clip (GdkGC *gc,
if (priv->region_tag_applied) if (priv->region_tag_applied)
_gdk_gc_remove_drawable_clip (gc); _gdk_gc_remove_drawable_clip (gc);
region = gdk_region_copy (region); region = cairo_region_copy (region);
if (offset_x != 0 || offset_y != 0) if (offset_x != 0 || offset_y != 0)
gdk_region_offset (region, offset_x, offset_y); cairo_region_translate (region, offset_x, offset_y);
if (priv->clip_mask) if (priv->clip_mask)
{ {
...@@ -596,7 +596,7 @@ _gdk_gc_add_drawable_clip (GdkGC *gc, ...@@ -596,7 +596,7 @@ _gdk_gc_add_drawable_clip (GdkGC *gc,
GdkGC *tmp_gc; GdkGC *tmp_gc;
GdkColor black = {0, 0, 0, 0}; GdkColor black = {0, 0, 0, 0};
GdkRectangle r; GdkRectangle r;
GdkOverlapType overlap; cairo_region_overlap_t overlap;
gdk_drawable_get_size (priv->clip_mask, &w, &h); gdk_drawable_get_size (priv->clip_mask, &w, &h);
...@@ -609,8 +609,8 @@ _gdk_gc_add_drawable_clip (GdkGC *gc, ...@@ -609,8 +609,8 @@ _gdk_gc_add_drawable_clip (GdkGC *gc,
* the region, so we try to avoid allocating bitmaps that are just fully * the region, so we try to avoid allocating bitmaps that are just fully
* set or completely unset. * set or completely unset.
*/ */
overlap = gdk_region_rect_in (region, &r); overlap = cairo_region_contains_rectangle (region, &r);
if (overlap == GDK_OVERLAP_RECTANGLE_PART) if (overlap == CAIRO_REGION_OVERLAP_PART)
{ {
/* The region and the mask intersect, create a new clip mask that /* The region and the mask intersect, create a new clip mask that
includes both areas */ includes both areas */
...@@ -631,12 +631,12 @@ _gdk_gc_add_drawable_clip (GdkGC *gc, ...@@ -631,12 +631,12 @@ _gdk_gc_add_drawable_clip (GdkGC *gc,
gdk_gc_set_clip_mask (gc, new_mask); gdk_gc_set_clip_mask (gc, new_mask);
g_object_unref (new_mask); g_object_unref (new_mask);
} }
else if (overlap == GDK_OVERLAP_RECTANGLE_OUT) else if (overlap == CAIRO_REGION_OVERLAP_OUT)
{ {
/* No intersection, set empty clip region */ /* No intersection, set empty clip region */
GdkRegion *empty = gdk_region_new (); GdkRegion *empty = cairo_region_create ();
gdk_region_destroy (region); cairo_region_destroy (region);
priv->old_clip_mask = g_object_ref (priv->clip_mask); priv->old_clip_mask = g_object_ref (priv->clip_mask);
priv->clip_region = empty; priv->clip_region = empty;
_gdk_windowing_gc_set_clip_region (gc, empty, FALSE); _gdk_windowing_gc_set_clip_region (gc, empty, FALSE);
...@@ -644,7 +644,7 @@ _gdk_gc_add_drawable_clip (GdkGC *gc, ...@@ -644,7 +644,7 @@ _gdk_gc_add_drawable_clip (GdkGC *gc,
else else
{ {
/* Completely inside region, don't set unnecessary clip */ /* Completely inside region, don't set unnecessary clip */
gdk_region_destroy (region); cairo_region_destroy (region);
return; return;
} }
} }
...@@ -653,7 +653,7 @@ _gdk_gc_add_drawable_clip (GdkGC *gc, ...@@ -653,7 +653,7 @@ _gdk_gc_add_drawable_clip (GdkGC *gc,
priv->old_clip_region = priv->clip_region; priv->old_clip_region = priv->clip_region;
priv->clip_region = region; priv->clip_region = region;
if (priv->old_clip_region) if (priv->old_clip_region)
gdk_region_intersect (region, priv->old_clip_region); cairo_region_intersect (region, priv->old_clip_region);
_gdk_windowing_gc_set_clip_region (gc, priv->clip_region, FALSE); _gdk_windowing_gc_set_clip_region (gc, priv->clip_region, FALSE);
} }
...@@ -711,7 +711,7 @@ gdk_gc_set_clip_rectangle (GdkGC *gc, ...@@ -711,7 +711,7 @@ gdk_gc_set_clip_rectangle (GdkGC *gc,
_gdk_gc_remove_drawable_clip (gc); _gdk_gc_remove_drawable_clip (gc);
if (rectangle) if (rectangle)
region = gdk_region_rectangle (rectangle); region = cairo_region_create_rectangle (rectangle);
else else
region = NULL; region = NULL;
...@@ -738,7 +738,7 @@ gdk_gc_set_clip_region (GdkGC *gc, ...@@ -738,7 +738,7 @@ gdk_gc_set_clip_region (GdkGC *gc,
_gdk_gc_remove_drawable_clip (gc); _gdk_gc_remove_drawable_clip (gc);
if (region) if (region)
copy = gdk_region_copy (region); copy = cairo_region_copy (region);
else else
copy = NULL; copy = NULL;
...@@ -1063,20 +1063,20 @@ gdk_gc_copy (GdkGC *dst_gc, ...@@ -1063,20 +1063,20 @@ gdk_gc_copy (GdkGC *dst_gc,
dst_gc->colormap = src_gc->colormap; dst_gc->colormap = src_gc->colormap;
if (dst_priv->clip_region) if (dst_priv->clip_region)
gdk_region_destroy (dst_priv->clip_region); cairo_region_destroy (dst_priv->clip_region);
if (src_priv->clip_region) if (src_priv->clip_region)
dst_priv->clip_region = gdk_region_copy (src_priv->clip_region); dst_priv->clip_region = cairo_region_copy (src_priv->clip_region);
else else
dst_priv->clip_region = NULL; dst_priv->clip_region = NULL;
dst_priv->region_tag_applied = src_priv->region_tag_applied; dst_priv->region_tag_applied = src_priv->region_tag_applied;
if (dst_priv->old_clip_region) if (dst_priv->old_clip_region)
gdk_region_destroy (dst_priv->old_clip_region); cairo_region_destroy (dst_priv->old_clip_region);
if (src_priv->old_clip_region) if (src_priv->old_clip_region)
dst_priv->old_clip_region = gdk_region_copy (src_priv->old_clip_region); dst_priv->old_clip_region = cairo_region_copy (src_priv->old_clip_region);
else else
dst_priv->old_clip_region = NULL; dst_priv->old_clip_region = NULL;
......
...@@ -288,9 +288,9 @@ add_damage (GdkOffscreenWindow *offscreen, ...@@ -288,9 +288,9 @@ add_damage (GdkOffscreenWindow *offscreen,
rect.height += 7; rect.height += 7;
} }
damage = gdk_region_rectangle (&rect); damage = cairo_region_create_rectangle (&rect);
_gdk_window_add_damage (offscreen->wrapper, damage); _gdk_window_add_damage (offscreen->wrapper, damage);
gdk_region_destroy (damage); cairo_region_destroy (damage);
} }
static GdkDrawable * static GdkDrawable *
......
...@@ -1255,7 +1255,7 @@ layout_iter_get_line_clip_region (PangoLayoutIter *iter, ...@@ -1255,7 +1255,7 @@ layout_iter_get_line_clip_region (PangoLayoutIter *iter,
line = pango_layout_iter_get_line_readonly (iter); line = pango_layout_iter_get_line_readonly (iter);
clip_region = gdk_region_new (); clip_region = cairo_region_create ();
pango_layout_iter_get_line_extents (iter, NULL, &logical_rect); pango_layout_iter_get_line_extents (iter, NULL, &logical_rect);
baseline = pango_layout_iter_get_baseline (iter); baseline = pango_layout_iter_get_baseline (iter);
...@@ -1289,7 +1289,7 @@ layout_iter_get_line_clip_region (PangoLayoutIter *iter, ...@@ -1289,7 +1289,7 @@ layout_iter_get_line_clip_region (PangoLayoutIter *iter,
rect.width = PANGO_PIXELS (pixel_ranges[2*j + 1] - logical_rect.x) - x_off; rect.width = PANGO_PIXELS (pixel_ranges[2*j + 1] - logical_rect.x) - x_off;
rect.height = PANGO_PIXELS (baseline - logical_rect.y + logical_rect.height) - y_off; rect.height = PANGO_PIXELS (baseline - logical_rect.y + logical_rect.height) - y_off;
gdk_region_union_with_rect (clip_region, &rect); cairo_region_union_rectangle (clip_region, &rect);
} }
g_free (pixel_ranges); g_free (pixel_ranges);
...@@ -1380,7 +1380,7 @@ gdk_pango_layout_get_clip_region (PangoLayout *layout, ...@@ -1380,7 +1380,7 @@ gdk_pango_layout_get_clip_region (PangoLayout *layout,
g_return_val_if_fail (PANGO_IS_LAYOUT (layout), NULL); g_return_val_if_fail (PANGO_IS_LAYOUT (layout), NULL);
g_return_val_if_fail (index_ranges != NULL, NULL); g_return_val_if_fail (index_ranges != NULL, NULL);
clip_region = gdk_region_new (); clip_region = cairo_region_create ();
iter = pango_layout_get_iter (layout); iter = pango_layout_get_iter (layout);
...@@ -1399,8 +1399,8 @@ gdk_pango_layout_get_clip_region (PangoLayout *layout, ...@@ -1399,8 +1399,8 @@ gdk_pango_layout_get_clip_region (PangoLayout *layout,
index_ranges, index_ranges,
n_ranges); n_ranges);
gdk_region_union (clip_region, line_region); cairo_region_union (clip_region, line_region);
gdk_region_destroy (line_region); cairo_region_destroy (line_region);