[PATCH] xwayland: Snap damage reports to the bounding box
Adam Jackson
ajax at redhat.com
Wed Jul 2 09:09:52 PDT 2014
Instead of sending every little rect. Lets x11perf run to completion,
makes 'while true; do gtkperf -a; done' take longer to crash.
This is effectively a resend of the same logic against the old
xfree86+xwayland branch:
http://lists.x.org/archives/xorg-devel/2013-October/038453.html
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>
Signed-off-by: Adam Jackson <ajax at redhat.com>
---
hw/xwayland/xwayland.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index b966e50..a4aeecd 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -326,25 +326,21 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen)
struct xwl_window *xwl_window;
RegionPtr region;
BoxPtr box;
- int count, i;
struct wl_buffer *buffer;
PixmapPtr pixmap;
xorg_list_for_each_entry(xwl_window, &xwl_screen->damage_window_list,
link_damage) {
region = DamageRegion(xwl_window->damage);
- count = RegionNumRects(region);
-
pixmap = (*xwl_screen->screen->GetWindowPixmap) (xwl_window->window);
buffer = xwl_shm_pixmap_get_wl_buffer(pixmap);
wl_surface_attach(xwl_window->surface, buffer, 0, 0);
- for (i = 0; i < count; i++) {
- box = &RegionRects(region)[i];
- wl_surface_damage(xwl_window->surface,
- box->x1, box->y1,
- box->x2 - box->x1, box->y2 - box->y1);
- }
+
+ box = RegionExtents(region);
+ wl_surface_damage(xwl_window->surface, box->x1, box->y1,
+ box->x2 - box->x1, box->y2 - box->y1);
+
wl_surface_commit(xwl_window->surface);
DamageEmpty(xwl_window->damage);
}
--
2.0.0
More information about the xorg-devel
mailing list