mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	wlr_surface: add wlr_surface_get_effective_damage
This calculates and returns the effective damage of the surface in surface coordinates, including the client damage (in buffer coordinates), and damage induced by resize or move events.
This commit is contained in:
		
							parent
							
								
									84ecfb546b
								
							
						
					
					
						commit
						3e0a0f3c3a
					
				
					 3 changed files with 56 additions and 30 deletions
				
			
		| 
						 | 
				
			
			@ -696,13 +696,10 @@ static void damage_from_surface(struct wlr_surface *surface, int sx, int sy,
 | 
			
		|||
	int center_x = box.x + box.width/2;
 | 
			
		||||
	int center_y = box.y + box.height/2;
 | 
			
		||||
 | 
			
		||||
	enum wl_output_transform transform = surface->current.transform;
 | 
			
		||||
 | 
			
		||||
	pixman_region32_t damage;
 | 
			
		||||
	pixman_region32_init(&damage);
 | 
			
		||||
	pixman_region32_copy(&damage, &surface->buffer_damage);
 | 
			
		||||
	wlr_region_transform(&damage, &damage, transform,
 | 
			
		||||
		surface->current.buffer_width, surface->current.buffer_height);
 | 
			
		||||
	wlr_surface_get_effective_damage(surface, &damage);
 | 
			
		||||
 | 
			
		||||
	wlr_region_scale(&damage, &damage,
 | 
			
		||||
		wlr_output->scale / (float)surface->current.scale);
 | 
			
		||||
	if (ceil(wlr_output->scale) > surface->current.scale) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue