From 4a4a442e6cd0a4f9eecd1608bc4fff7cf3cec7a0 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 4 May 2016 15:29:09 +0100 Subject: remove unused windows pretile code and plotter API use --- windows/bitmap.c | 48 +----------------------------------------------- 1 file changed, 1 insertion(+), 47 deletions(-) (limited to 'windows/bitmap.c') diff --git a/windows/bitmap.c b/windows/bitmap.c index e86f95bfe..664244838 100644 --- a/windows/bitmap.c +++ b/windows/bitmap.c @@ -31,6 +31,7 @@ #include "utils/log.h" #include "image/bitmap.h" +#include "desktop/plotters.h" #include "content/content.h" #include "windows/plot.h" @@ -309,53 +310,6 @@ struct bitmap *bitmap_scale(struct bitmap *prescale, int width, int height) } -struct bitmap * -bitmap_pretile(struct bitmap *untiled, - int width, - int height, - bitmap_flags_t flags) -{ - struct bitmap *ret = malloc(sizeof(struct bitmap)); - if (ret == NULL) - return NULL; - int i, hrepeat, vrepeat, repeat; - vrepeat = ((flags & BITMAPF_REPEAT_Y) != 0) ? - ((height + untiled->height - 1) / untiled->height) : 1; - hrepeat = ((flags & BITMAPF_REPEAT_X) != 0) ? - ((width + untiled->width - 1) / untiled->width) : 1; - width = untiled->width * hrepeat; - height = untiled->height * vrepeat; - uint8_t *indata = untiled->pixdata; - uint8_t *newdata = malloc(4 * width * height); - if (newdata == NULL) { - free(ret); - return NULL; - } - ret->pixdata = newdata; - size_t stride = untiled->width * 4; - - /* horizontal tiling */ - for (i = 0; i < untiled->height; i++) { - for (repeat = 0; repeat < hrepeat; repeat ++) { - memcpy(newdata, indata, stride); - newdata += stride; - } - indata += stride; - } - - /* vertical tiling */ - stride = untiled->height * width * 4; - newdata = ret->pixdata + stride; - indata = ret->pixdata; - - for (repeat = 1; repeat < vrepeat; repeat++) { - memcpy(newdata, indata, stride); - newdata += stride; - } - ret->width = width; - ret->height = height; - return ret; -} static nserror bitmap_render(struct bitmap *bitmap, struct hlcache_handle *content) -- cgit v1.2.3