mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	release buffer on surface flush when no damage
This commit is contained in:
		
							parent
							
								
									3c12a32d1f
								
							
						
					
					
						commit
						73adb49f15
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -128,7 +128,7 @@ void wlr_surface_flush_damage(struct wlr_surface *surface) {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	pixman_region32_t damage = surface->current.surface_damage;
 | 
						pixman_region32_t damage = surface->current.surface_damage;
 | 
				
			||||||
	if (!pixman_region32_not_empty(&damage)) {
 | 
						if (!pixman_region32_not_empty(&damage)) {
 | 
				
			||||||
		return;
 | 
							goto release;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	int n;
 | 
						int n;
 | 
				
			||||||
	pixman_box32_t *rects = pixman_region32_rectangles(&damage, &n);
 | 
						pixman_box32_t *rects = pixman_region32_rectangles(&damage, &n);
 | 
				
			||||||
| 
						 | 
					@ -145,6 +145,7 @@ void wlr_surface_flush_damage(struct wlr_surface *surface) {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	pixman_region32_fini(&surface->current.surface_damage);
 | 
						pixman_region32_fini(&surface->current.surface_damage);
 | 
				
			||||||
	pixman_region32_init(&surface->current.surface_damage);
 | 
						pixman_region32_init(&surface->current.surface_damage);
 | 
				
			||||||
 | 
					release:
 | 
				
			||||||
	wl_resource_queue_event(surface->current.buffer, WL_BUFFER_RELEASE);
 | 
						wl_resource_queue_event(surface->current.buffer, WL_BUFFER_RELEASE);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue