mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	scene/surface: simplify single-pixel-buffer check in surface_reconfigure()
No need to call wlr_client_buffer_get() on wlr_client_buffer.base:
we're already manipulating a wlr_client_buffer.
(cherry picked from commit b62c6878e1)
			
			
This commit is contained in:
		
							parent
							
								
									73aa61686f
								
							
						
					
					
						commit
						bb5180ce9e
					
				
					 1 changed files with 2 additions and 3 deletions
				
			
		| 
						 | 
					@ -175,10 +175,9 @@ static void surface_reconfigure(struct wlr_scene_surface *scene_surface) {
 | 
				
			||||||
		// can't use the cached scene_buffer->is_single_pixel_buffer
 | 
							// can't use the cached scene_buffer->is_single_pixel_buffer
 | 
				
			||||||
		// because that's only set later on.
 | 
							// because that's only set later on.
 | 
				
			||||||
		bool is_single_pixel_buffer = false;
 | 
							bool is_single_pixel_buffer = false;
 | 
				
			||||||
		struct wlr_client_buffer *client_buffer = wlr_client_buffer_get(&surface->buffer->base);
 | 
							if (surface->buffer->source != NULL) {
 | 
				
			||||||
		if (client_buffer != NULL && client_buffer->source != NULL) {
 | 
					 | 
				
			||||||
			struct wlr_single_pixel_buffer_v1 *spb =
 | 
								struct wlr_single_pixel_buffer_v1 *spb =
 | 
				
			||||||
				wlr_single_pixel_buffer_v1_try_from_buffer(client_buffer->source);
 | 
									wlr_single_pixel_buffer_v1_try_from_buffer(surface->buffer->source);
 | 
				
			||||||
			is_single_pixel_buffer = spb != NULL;
 | 
								is_single_pixel_buffer = spb != NULL;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (!is_single_pixel_buffer) {
 | 
							if (!is_single_pixel_buffer) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue