diff options
Diffstat (limited to 'frontends/windows/bitmap.c')
-rw-r--r-- | frontends/windows/bitmap.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/frontends/windows/bitmap.c b/frontends/windows/bitmap.c index f60dab613..eed3d3a15 100644 --- a/frontends/windows/bitmap.c +++ b/frontends/windows/bitmap.c @@ -52,7 +52,8 @@ void *win32_bitmap_create(int width, int height, unsigned int state) HBITMAP windib; uint8_t *pixdata; - LOG("width %d, height %d, state %u", width, height, state); + NSLOG(netsurf, INFO, "width %d, height %d, state %u", width, height, + state); pbmi = calloc(1, sizeof(BITMAPV5HEADER)); if (pbmi == NULL) { @@ -96,7 +97,7 @@ void *win32_bitmap_create(int width, int height, unsigned int state) bitmap->opaque = false; } - LOG("bitmap %p", bitmap); + NSLOG(netsurf, INFO, "bitmap %p", bitmap); return bitmap; } @@ -115,7 +116,7 @@ static unsigned char *bitmap_get_buffer(void *bitmap) { struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return NULL; } @@ -134,7 +135,7 @@ static size_t bitmap_get_rowstride(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return 0; } @@ -152,7 +153,7 @@ void win32_bitmap_destroy(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return; } @@ -195,11 +196,12 @@ static void bitmap_set_opaque(void *bitmap, bool opaque) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return; } - LOG("setting bitmap %p to %s", bm, opaque ? "opaque" : "transparent"); + NSLOG(netsurf, INFO, "setting bitmap %p to %s", bm, + opaque ? "opaque" : "transparent"); bm->opaque = opaque; } @@ -216,7 +218,7 @@ static bool bitmap_test_opaque(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return false; } @@ -224,11 +226,11 @@ static bool bitmap_test_opaque(void *bitmap) while (tst-- > 0) { if (bm->pixdata[(tst << 2) + 3] != 0xff) { - LOG("bitmap %p has transparency", bm); + NSLOG(netsurf, INFO, "bitmap %p has transparency", bm); return false; } } - LOG("bitmap %p is opaque", bm); + NSLOG(netsurf, INFO, "bitmap %p is opaque", bm); return true; } @@ -243,7 +245,7 @@ static bool bitmap_get_opaque(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return false; } @@ -255,7 +257,7 @@ static int bitmap_get_width(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return 0; } @@ -267,7 +269,7 @@ static int bitmap_get_height(void *bitmap) struct bitmap *bm = bitmap; if (bitmap == NULL) { - LOG("NULL bitmap!"); + NSLOG(netsurf, INFO, "NULL bitmap!"); return 0; } @@ -324,12 +326,12 @@ bitmap_render(struct bitmap *bitmap, struct hlcache_handle *content) .plot = &win_plotters }; - width = min(content_get_width(content), 1024); + width = min(max(content_get_width(content), bitmap->width), 1024); height = ((width * bitmap->height) + (bitmap->width / 2)) / bitmap->width; - LOG("bitmap %p for content %p width %d, height %d", - bitmap, content, width, height); + NSLOG(netsurf, INFO, "bitmap %p for content %p width %d, height %d", + bitmap, content, width, height); /* create two memory device contexts to put the bitmaps in */ bufferdc = CreateCompatibleDC(NULL); |