gdk: Remove GdkWindowImpl->clear_region

It was only used on the X11 backend and is easier to implement locally,
in particular when we want to allow backgrounds that X can't handle.
This commit is contained in:
Benjamin Otte 2010-08-15 03:16:20 +02:00
parent 3d98537c2e
commit 547e2cc837
3 changed files with 3 additions and 48 deletions

View File

@ -3840,7 +3840,6 @@ gdk_window_clear_region_internal (GdkWindow *window,
gboolean send_expose)
{
GdkWindowObject *private = (GdkWindowObject *)window;
GdkWindowImplIface *impl_iface;
if (private->paint_stack)
gdk_window_clear_backing_region (window, region);
@ -3849,30 +3848,10 @@ gdk_window_clear_region_internal (GdkWindow *window,
if (private->redirect)
gdk_window_clear_backing_region_redirect (window, region);
impl_iface = GDK_WINDOW_IMPL_GET_IFACE (private->impl);
if (impl_iface->clear_region && clears_as_native (private))
{
cairo_region_t *copy;
copy = cairo_region_copy (region);
cairo_region_intersect (copy,
private->clip_region_with_children);
/* Drawing directly to the window, flush anything outstanding to
guarantee ordering. */
gdk_window_flush (window);
impl_iface->clear_region (window, copy, send_expose);
cairo_region_destroy (copy);
}
else
{
gdk_window_clear_backing_region_direct (window, region);
if (send_expose)
gdk_window_invalidate_region (window, region, FALSE);
}
}
}
/**

View File

@ -74,9 +74,6 @@ struct _GdkWindowImplIface
GdkWindow *new_parent,
gint x,
gint y);
void (* clear_region) (GdkWindow *window,
cairo_region_t *region,
gboolean send_expose);
void (* set_device_cursor) (GdkWindow *window,
GdkDevice *device,

View File

@ -1660,26 +1660,6 @@ gdk_window_x11_reparent (GdkWindow *window,
return FALSE;
}
static void
gdk_window_x11_clear_region (GdkWindow *window,
cairo_region_t *region,
gboolean send_expose)
{
cairo_rectangle_int_t rect;
int n_rects, i;
n_rects = cairo_region_num_rectangles (region);
for (i = 0; i < n_rects; i++)
{
cairo_region_get_rectangle (region, i, &rect);
XClearArea (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window),
rect.x, rect.y,
rect.width, rect.height,
send_expose);
}
}
static void
gdk_window_x11_raise (GdkWindow *window)
{
@ -5474,7 +5454,6 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface)
iface->set_background = gdk_window_x11_set_background;
iface->set_back_pixmap = gdk_window_x11_set_back_pixmap;
iface->reparent = gdk_window_x11_reparent;
iface->clear_region = gdk_window_x11_clear_region;
iface->set_device_cursor = gdk_window_x11_set_device_cursor;
iface->get_geometry = gdk_window_x11_get_geometry;
iface->get_root_coords = gdk_window_x11_get_root_coords;