x11: don't resend the clip and tile origin on every flush
This commit is contained in:
parent
bb97d1cfd6
commit
aa55defff0
2 changed files with 37 additions and 3 deletions
|
|
@ -158,8 +158,18 @@ _gdk_x11_gc_flush (GdkGC *gc)
|
|||
GdkRegion *clip_region = _gdk_gc_get_clip_region (gc);
|
||||
|
||||
if (!clip_region)
|
||||
XSetClipOrigin (xdisplay, xgc,
|
||||
gc->clip_x_origin, gc->clip_y_origin);
|
||||
{
|
||||
XSetClipOrigin (xdisplay, xgc,
|
||||
gc->clip_x_origin, gc->clip_y_origin);
|
||||
private->clip_sent = FALSE;
|
||||
}
|
||||
/* drawing to a window inside the paint of a parent moves the
|
||||
* clip origin there and back for every drawing; the server has
|
||||
* the rectangles at that origin from the last one already */
|
||||
else if (private->clip_sent &&
|
||||
private->sent_clip_x == gc->clip_x_origin &&
|
||||
private->sent_clip_y == gc->clip_y_origin)
|
||||
;
|
||||
else
|
||||
{
|
||||
XRectangle *rectangles;
|
||||
|
|
@ -176,13 +186,23 @@ _gdk_x11_gc_flush (GdkGC *gc)
|
|||
n_rects, YXBanded);
|
||||
|
||||
g_free (rectangles);
|
||||
|
||||
private->clip_sent = TRUE;
|
||||
private->sent_clip_x = gc->clip_x_origin;
|
||||
private->sent_clip_y = gc->clip_y_origin;
|
||||
}
|
||||
}
|
||||
|
||||
if (private->dirty_mask & GDK_GC_DIRTY_TS)
|
||||
if ((private->dirty_mask & GDK_GC_DIRTY_TS) &&
|
||||
!(private->ts_sent &&
|
||||
private->sent_ts_x == gc->ts_x_origin &&
|
||||
private->sent_ts_y == gc->ts_y_origin))
|
||||
{
|
||||
XSetTSOrigin (xdisplay, xgc,
|
||||
gc->ts_x_origin, gc->ts_y_origin);
|
||||
private->ts_sent = TRUE;
|
||||
private->sent_ts_x = gc->ts_x_origin;
|
||||
private->sent_ts_y = gc->ts_y_origin;
|
||||
}
|
||||
|
||||
private->dirty_mask = 0;
|
||||
|
|
@ -365,6 +385,7 @@ gdk_x11_gc_set_values (GdkGC *gc,
|
|||
{
|
||||
x11_gc->have_clip_region = FALSE;
|
||||
x11_gc->have_clip_mask = values->clip_mask != NULL;
|
||||
x11_gc->clip_sent = FALSE;
|
||||
}
|
||||
|
||||
gdk_x11_gc_values_to_xvalues (values, values_mask, &xvalues, &xvalues_mask);
|
||||
|
|
@ -625,6 +646,7 @@ _gdk_windowing_gc_set_clip_region (GdkGC *gc,
|
|||
}
|
||||
|
||||
x11_gc->have_clip_region = region != NULL;
|
||||
x11_gc->clip_sent = FALSE;
|
||||
|
||||
if (reset_origin)
|
||||
{
|
||||
|
|
@ -648,6 +670,12 @@ _gdk_windowing_gc_copy (GdkGC *dst_gc,
|
|||
x11_dst_gc->dirty_mask = x11_src_gc->dirty_mask;
|
||||
x11_dst_gc->have_clip_region = x11_src_gc->have_clip_region;
|
||||
x11_dst_gc->have_clip_mask = x11_src_gc->have_clip_mask;
|
||||
x11_dst_gc->clip_sent = x11_src_gc->clip_sent;
|
||||
x11_dst_gc->sent_clip_x = x11_src_gc->sent_clip_x;
|
||||
x11_dst_gc->sent_clip_y = x11_src_gc->sent_clip_y;
|
||||
x11_dst_gc->ts_sent = x11_src_gc->ts_sent;
|
||||
x11_dst_gc->sent_ts_x = x11_src_gc->sent_ts_x;
|
||||
x11_dst_gc->sent_ts_y = x11_src_gc->sent_ts_y;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -60,6 +60,12 @@ struct _GdkGCX11
|
|||
guint have_clip_region : 1;
|
||||
guint have_clip_mask : 1;
|
||||
guint depth : 8;
|
||||
/* the clip rectangles and the tile origin last sent to the server,
|
||||
* for flushes that would send the same again */
|
||||
guint clip_sent : 1;
|
||||
guint ts_sent : 1;
|
||||
gint sent_clip_x, sent_clip_y;
|
||||
gint sent_ts_x, sent_ts_y;
|
||||
};
|
||||
|
||||
struct _GdkGCX11Class
|
||||
|
|
|
|||
Loading…
Reference in a new issue