broadway: Remove window translation code
This is no longer used as we neutered gdk_window_scroll & co.
This commit is contained in:
@ -1380,97 +1380,6 @@ broadway_server_has_client (BroadwayServer *server)
|
||||
return server->output != NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_cairo_region (cairo_t *cr,
|
||||
const cairo_region_t *region)
|
||||
{
|
||||
cairo_rectangle_int_t box;
|
||||
gint n_boxes, i;
|
||||
|
||||
g_return_if_fail (cr != NULL);
|
||||
g_return_if_fail (region != NULL);
|
||||
|
||||
n_boxes = cairo_region_num_rectangles (region);
|
||||
|
||||
for (i = 0; i < n_boxes; i++)
|
||||
{
|
||||
cairo_region_get_rectangle (region, i, &box);
|
||||
cairo_rectangle (cr, box.x, box.y, box.width, box.height);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
copy_region (cairo_surface_t *surface,
|
||||
cairo_region_t *area,
|
||||
gint dx,
|
||||
gint dy)
|
||||
{
|
||||
cairo_t *cr;
|
||||
|
||||
cr = cairo_create (surface);
|
||||
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
|
||||
|
||||
_cairo_region (cr, area);
|
||||
cairo_clip (cr);
|
||||
|
||||
/* NB: This is a self-copy and Cairo doesn't support that yet.
|
||||
* So we do a litle trick.
|
||||
*/
|
||||
cairo_push_group (cr);
|
||||
|
||||
cairo_set_source_surface (cr, surface, dx, dy);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_pop_group_to_source (cr);
|
||||
cairo_paint (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
|
||||
gboolean
|
||||
broadway_server_window_translate (BroadwayServer *server,
|
||||
gint id,
|
||||
cairo_region_t *area,
|
||||
gint dx,
|
||||
gint dy)
|
||||
{
|
||||
BroadwayWindow *window;
|
||||
gboolean sent = FALSE;
|
||||
|
||||
window = g_hash_table_lookup (server->id_ht,
|
||||
GINT_TO_POINTER (id));
|
||||
if (window == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (window->last_synced &&
|
||||
server->output)
|
||||
{
|
||||
BroadwayRect *rects;
|
||||
cairo_rectangle_int_t rect;
|
||||
int i, n_rects;
|
||||
|
||||
copy_region (window->last_surface, area, dx, dy);
|
||||
n_rects = cairo_region_num_rectangles (area);
|
||||
rects = g_new (BroadwayRect, n_rects);
|
||||
for (i = 0; i < n_rects; i++)
|
||||
{
|
||||
cairo_region_get_rectangle (area, i, &rect);
|
||||
rects[i].x = rect.x;
|
||||
rects[i].y = rect.y;
|
||||
rects[i].width = rect.width;
|
||||
rects[i].height = rect.height;
|
||||
}
|
||||
broadway_output_copy_rectangles (server->output,
|
||||
window->id,
|
||||
rects, n_rects, dx, dy);
|
||||
g_free (rects);
|
||||
sent = TRUE;
|
||||
}
|
||||
|
||||
return sent;
|
||||
}
|
||||
|
||||
static void
|
||||
diff_surfaces (cairo_surface_t *surface,
|
||||
cairo_surface_t *old_surface)
|
||||
|
||||
Reference in New Issue
Block a user