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:
Oscar Mateo
2013-11-12 11:50:39 +00:00
committed by Daniel Vetter
parent 37f26d17b1
commit 1cd6913608
4 changed files with 21 additions and 52 deletions
+21
View File
@@ -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)
{