mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-11 16:32:58 +00:00
rendercopy: Remove rendercopy.c
Move scratch_buf_write_to_png() to its only user, gem_render_copy.c. This makes the cairo dependencies easier to handle from the Android perspective, but if there is a good reason why this file exists I can try to handle it differently. Signed-off-by: Oscar Mateo <oscar.mateo@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
committed by
Daniel Vetter
parent
37f26d17b1
commit
1cd6913608
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <unistd.h>
|
||||
#include <cairo.h>
|
||||
|
||||
#include "rendercopy.h"
|
||||
|
||||
@@ -49,6 +50,26 @@ typedef struct {
|
||||
uint32_t linear[WIDTH * HEIGHT];
|
||||
} data_t;
|
||||
|
||||
static void scratch_buf_write_to_png(struct scratch_buf *buf, const char *filename)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
cairo_status_t ret;
|
||||
|
||||
drm_intel_bo_map(buf->bo, 0);
|
||||
surface = cairo_image_surface_create_for_data(buf->bo->virtual,
|
||||
CAIRO_FORMAT_RGB24,
|
||||
buf_width(buf),
|
||||
buf_height(buf),
|
||||
buf->stride);
|
||||
ret = cairo_surface_write_to_png(surface, filename);
|
||||
if (ret != CAIRO_STATUS_SUCCESS) {
|
||||
fprintf(stderr, "%s: %s\n", __func__,
|
||||
cairo_status_to_string(ret));
|
||||
}
|
||||
cairo_surface_destroy(surface);
|
||||
drm_intel_bo_unmap(buf->bo);
|
||||
}
|
||||
|
||||
static void scratch_buf_init(data_t *data, struct scratch_buf *buf,
|
||||
int width, int height, int stride, uint32_t color)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user