summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-05-04 15:29:09 +0100
committerVincent Sanders <vince@kyllikki.org>2016-05-04 15:29:09 +0100
commit4a4a442e6cd0a4f9eecd1608bc4fff7cf3cec7a0 (patch)
tree64f4f61ec2c9a80ac4e5c14c7af1391780c451d1 /windows
parent976e4f8973eea4b2b9904488ef92b66fc332521e (diff)
downloadnetsurf-4a4a442e6cd0a4f9eecd1608bc4fff7cf3cec7a0.tar.gz
netsurf-4a4a442e6cd0a4f9eecd1608bc4fff7cf3cec7a0.tar.bz2
remove unused windows pretile code and plotter API use
Diffstat (limited to 'windows')
-rw-r--r--windows/bitmap.c48
-rw-r--r--windows/bitmap.h5
2 files changed, 2 insertions, 51 deletions
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