summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ã…dahl <jadahl@gmail.com>2016-02-16 13:05:25 +0800
committerRay Strode <rstrode@redhat.com>2016-02-16 16:22:51 -0500
commit38b1f15f1257003fffd69f6017caefa57f56a24e (patch)
tree932e567205c0707b2cc82d129451cc63d88a2219
parent64c9ec14fea2a68377f7a9c5297fb24b365bf50e (diff)
downloadgtk+-38b1f15f1257003fffd69f6017caefa57f56a24e.tar.gz
wayland: Only attach the buffer if there was damage
There is no point in attaching and then committing the same buffer if there was no damage. This will also make us do less unnecessary backfill read backs, for the cases where we paint with an empty paint region. https://bugzilla.gnome.org/show_bug.cgi?id=762120
-rw-r--r--gdk/wayland/gdkwindow-wayland.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index bafeb715d8..87bdc934ae 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -782,7 +782,8 @@ gdk_window_impl_wayland_end_paint (GdkWindow *window)
cairo_rectangle_int_t rect;
int i, n;
- if (!window->current_paint.use_gl)
+ if (!window->current_paint.use_gl &&
+ !cairo_region_is_empty (window->current_paint.region))
{
gdk_wayland_window_attach_image (window);
@@ -809,8 +810,9 @@ gdk_window_impl_wayland_end_paint (GdkWindow *window)
{
cairo_region_get_rectangle (window->current_paint.region, i, &rect);
wl_surface_damage (impl->display_server.wl_surface, rect.x, rect.y, rect.width, rect.height);
- impl->pending_commit = TRUE;
}
+
+ impl->pending_commit = TRUE;
}
}