forked from AuroraMiddleware/gtk
[broadway] Copy regions on last_surface during translations too
This will help make scrolling more efficient
This commit is contained in:
parent
60cf2d53eb
commit
f02b7c9ed2
@ -1120,43 +1120,55 @@ _gdk_broadway_window_queue_antiexpose (GdkWindow *window,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
copy_region (cairo_surface_t *surface,
|
||||||
|
cairo_region_t *area,
|
||||||
|
gint dx,
|
||||||
|
gint dy)
|
||||||
|
{
|
||||||
|
cairo_t *cr;
|
||||||
|
|
||||||
|
cr = cairo_create (surface);
|
||||||
|
|
||||||
|
area = cairo_region_copy (area);
|
||||||
|
|
||||||
|
gdk_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);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_gdk_broadway_window_translate (GdkWindow *window,
|
_gdk_broadway_window_translate (GdkWindow *window,
|
||||||
cairo_region_t *area,
|
cairo_region_t *area,
|
||||||
gint dx,
|
gint dx,
|
||||||
gint dy)
|
gint dy)
|
||||||
{
|
{
|
||||||
GdkWindowObject *private;
|
GdkWindowObject *private;
|
||||||
GdkWindowImplBroadway *impl;
|
GdkDrawableImplBroadway *impl;
|
||||||
cairo_surface_t *surface;
|
|
||||||
|
|
||||||
private = (GdkWindowObject *)window;
|
private = (GdkWindowObject *)window;
|
||||||
impl = GDK_WINDOW_IMPL_BROADWAY (private->impl);
|
impl = GDK_DRAWABLE_IMPL_BROADWAY (private->impl);
|
||||||
|
|
||||||
surface = GDK_DRAWABLE_IMPL_BROADWAY (impl)->surface;
|
if (impl->surface)
|
||||||
if (surface)
|
|
||||||
{
|
{
|
||||||
cairo_t *cr;
|
copy_region (impl->surface, area, dx, dy);
|
||||||
|
if (GDK_WINDOW_IMPL_BROADWAY (impl)->last_synced)
|
||||||
cr = cairo_create (surface);
|
{
|
||||||
|
copy_region (impl->last_surface, area, dx, dy);
|
||||||
area = cairo_region_copy (area);
|
/* TODO: Send copy-rects */
|
||||||
|
}
|
||||||
gdk_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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user