xwayland: Snap damage reports to the bounding box
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@fooishbar.org> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
		
							parent
							
								
									5ecc0315a2
								
							
						
					
					
						commit
						d3427717f2
					
				| 
						 | 
					@ -342,7 +342,6 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen)
 | 
				
			||||||
    struct xwl_window *xwl_window, *next_xwl_window;
 | 
					    struct xwl_window *xwl_window, *next_xwl_window;
 | 
				
			||||||
    RegionPtr region;
 | 
					    RegionPtr region;
 | 
				
			||||||
    BoxPtr box;
 | 
					    BoxPtr box;
 | 
				
			||||||
    int count, i;
 | 
					 | 
				
			||||||
    struct wl_buffer *buffer;
 | 
					    struct wl_buffer *buffer;
 | 
				
			||||||
    PixmapPtr pixmap;
 | 
					    PixmapPtr pixmap;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -354,8 +353,6 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen)
 | 
				
			||||||
            continue;
 | 
					            continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        region = DamageRegion(xwl_window->damage);
 | 
					        region = DamageRegion(xwl_window->damage);
 | 
				
			||||||
        count = RegionNumRects(region);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        pixmap = (*xwl_screen->screen->GetWindowPixmap) (xwl_window->window);
 | 
					        pixmap = (*xwl_screen->screen->GetWindowPixmap) (xwl_window->window);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if GLAMOR_HAS_GBM
 | 
					#if GLAMOR_HAS_GBM
 | 
				
			||||||
| 
						 | 
					@ -366,12 +363,10 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen)
 | 
				
			||||||
            buffer = xwl_shm_pixmap_get_wl_buffer(pixmap);
 | 
					            buffer = xwl_shm_pixmap_get_wl_buffer(pixmap);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        wl_surface_attach(xwl_window->surface, buffer, 0, 0);
 | 
					        wl_surface_attach(xwl_window->surface, buffer, 0, 0);
 | 
				
			||||||
        for (i = 0; i < count; i++) {
 | 
					
 | 
				
			||||||
            box = &RegionRects(region)[i];
 | 
					        box = RegionExtents(region);
 | 
				
			||||||
            wl_surface_damage(xwl_window->surface,
 | 
					        wl_surface_damage(xwl_window->surface, box->x1, box->y1,
 | 
				
			||||||
                              box->x1, box->y1,
 | 
					                          box->x2 - box->x1, box->y2 - box->y1);
 | 
				
			||||||
                              box->x2 - box->x1, box->y2 - box->y1);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        xwl_window->frame_callback = wl_surface_frame(xwl_window->surface);
 | 
					        xwl_window->frame_callback = wl_surface_frame(xwl_window->surface);
 | 
				
			||||||
        wl_callback_add_listener(xwl_window->frame_callback, &frame_listener, xwl_window);
 | 
					        wl_callback_add_listener(xwl_window->frame_callback, &frame_listener, xwl_window);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue