mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	shm: Deprecate wl_shm_buffer_create()
From irc:
<pq> it creates a wl_buffer object in a way that no client can ever
     access the storage.
So, let's replace it with return NULL; and mark it with attribute
deprecated in the header.
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
			
			
This commit is contained in:
		
							parent
							
								
									4a97cb3579
								
							
						
					
					
						commit
						91881e8f89
					
				
					 2 changed files with 2 additions and 29 deletions
				
			
		| 
						 | 
				
			
			@ -472,7 +472,7 @@ wl_display_add_shm_format(struct wl_display *display, uint32_t format);
 | 
			
		|||
struct wl_shm_buffer *
 | 
			
		||||
wl_shm_buffer_create(struct wl_client *client,
 | 
			
		||||
		     uint32_t id, int32_t width, int32_t height,
 | 
			
		||||
		     int32_t stride, uint32_t format);
 | 
			
		||||
		     int32_t stride, uint32_t format) WL_DEPRECATED;
 | 
			
		||||
 | 
			
		||||
void wl_log_set_handler_server(wl_log_func_t handler);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -319,34 +319,7 @@ wl_shm_buffer_create(struct wl_client *client,
 | 
			
		|||
		     uint32_t id, int32_t width, int32_t height,
 | 
			
		||||
		     int32_t stride, uint32_t format)
 | 
			
		||||
{
 | 
			
		||||
	struct wl_shm_buffer *buffer;
 | 
			
		||||
 | 
			
		||||
	if (!format_is_supported(client, format))
 | 
			
		||||
		return NULL;
 | 
			
		||||
 | 
			
		||||
	buffer = malloc(sizeof *buffer + stride * height);
 | 
			
		||||
	if (buffer == NULL)
 | 
			
		||||
		return NULL;
 | 
			
		||||
 | 
			
		||||
	buffer->width = width;
 | 
			
		||||
	buffer->height = height;
 | 
			
		||||
	buffer->format = format;
 | 
			
		||||
	buffer->stride = stride;
 | 
			
		||||
	buffer->offset = 0;
 | 
			
		||||
	buffer->pool = NULL;
 | 
			
		||||
 | 
			
		||||
	buffer->resource =
 | 
			
		||||
		wl_resource_create(client, &wl_buffer_interface, 1, id);
 | 
			
		||||
	if (buffer->resource == NULL) {
 | 
			
		||||
		free(buffer);
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	wl_resource_set_implementation(buffer->resource,
 | 
			
		||||
				       &shm_buffer_interface,
 | 
			
		||||
				       buffer, destroy_buffer);
 | 
			
		||||
 | 
			
		||||
	return buffer;
 | 
			
		||||
	return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
WL_EXPORT struct wl_shm_buffer *
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue