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 +----------------------------------------------- windows/bitmap.h | 5 +---- 2 files changed, 2 insertions(+), 51 deletions(-) (limited to 'windows') 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) diff --git a/windows/bitmap.h b/windows/bitmap.h index 434c5e992..c723159e1 100644 --- a/windows/bitmap.h +++ b/windows/bitmap.h @@ -20,8 +20,6 @@ #ifndef _NETSURF_WINDOWS_BITMAP_H_ #define _NETSURF_WINDOWS_BITMAP_H_ -#include "desktop/plotters.h" - struct gui_bitmap_table *win32_bitmap_table; struct bitmap { @@ -34,10 +32,9 @@ struct bitmap { }; 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); void *win32_bitmap_create(int width, int height, unsigned int state); + void win32_bitmap_destroy(void *bitmap); #endif -- cgit v1.2.3