mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	render: Nuke old read pixels API
Sadly, the new API is not backwards compatible with the old API. Since we have already switched all users in wlroots to the new API compositors are already practically mandated to implement the new API. Let's get rid of the old one since there is no point.
This commit is contained in:
		
							parent
							
								
									b3575fedbc
								
							
						
					
					
						commit
						3ed1268f64
					
				
					 8 changed files with 0 additions and 211 deletions
				
			
		| 
						 | 
				
			
			@ -335,45 +335,6 @@ static void pixman_destroy(struct wlr_renderer *wlr_renderer) {
 | 
			
		|||
	free(renderer);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static uint32_t pixman_preferred_read_format(
 | 
			
		||||
		struct wlr_renderer *wlr_renderer) {
 | 
			
		||||
	struct wlr_pixman_renderer *renderer = get_renderer(wlr_renderer);
 | 
			
		||||
	struct wlr_pixman_buffer *buffer = renderer->current_buffer;
 | 
			
		||||
 | 
			
		||||
	pixman_format_code_t pixman_format = pixman_image_get_format(
 | 
			
		||||
			buffer->image);
 | 
			
		||||
 | 
			
		||||
	return get_drm_format_from_pixman(pixman_format);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool pixman_read_pixels(struct wlr_renderer *wlr_renderer,
 | 
			
		||||
		uint32_t drm_format, uint32_t stride,
 | 
			
		||||
		uint32_t width, uint32_t height, uint32_t src_x, uint32_t src_y,
 | 
			
		||||
		uint32_t dst_x, uint32_t dst_y, void *data) {
 | 
			
		||||
	struct wlr_pixman_renderer *renderer = get_renderer(wlr_renderer);
 | 
			
		||||
	struct wlr_pixman_buffer *buffer = renderer->current_buffer;
 | 
			
		||||
 | 
			
		||||
	pixman_format_code_t fmt = get_pixman_format_from_drm(drm_format);
 | 
			
		||||
	if (fmt == 0) {
 | 
			
		||||
		wlr_log(WLR_ERROR, "Cannot read pixels: unsupported pixel format");
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	const struct wlr_pixel_format_info *drm_fmt =
 | 
			
		||||
		drm_get_pixel_format_info(drm_format);
 | 
			
		||||
	assert(drm_fmt);
 | 
			
		||||
 | 
			
		||||
	pixman_image_t *dst = pixman_image_create_bits_no_clear(fmt, width, height,
 | 
			
		||||
			data, stride);
 | 
			
		||||
 | 
			
		||||
	pixman_image_composite32(PIXMAN_OP_SRC, buffer->image, NULL, dst,
 | 
			
		||||
			src_x, src_y, 0, 0, dst_x, dst_y, width, height);
 | 
			
		||||
 | 
			
		||||
	pixman_image_unref(dst);
 | 
			
		||||
 | 
			
		||||
	return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static uint32_t pixman_get_render_buffer_caps(struct wlr_renderer *renderer) {
 | 
			
		||||
	return WLR_BUFFER_CAP_DATA_PTR;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -405,8 +366,6 @@ static const struct wlr_renderer_impl renderer_impl = {
 | 
			
		|||
	.texture_from_buffer = pixman_texture_from_buffer,
 | 
			
		||||
	.bind_buffer = pixman_bind_buffer,
 | 
			
		||||
	.destroy = pixman_destroy,
 | 
			
		||||
	.preferred_read_format = pixman_preferred_read_format,
 | 
			
		||||
	.read_pixels = pixman_read_pixels,
 | 
			
		||||
	.get_render_buffer_caps = pixman_get_render_buffer_caps,
 | 
			
		||||
	.begin_buffer_pass = pixman_begin_buffer_pass,
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue