diff options
Diffstat (limited to 'frontends/framebuffer/bitmap.c')
-rw-r--r-- | frontends/framebuffer/bitmap.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/frontends/framebuffer/bitmap.c b/frontends/framebuffer/bitmap.c index 027e0122b..1fc9f46a2 100644 --- a/frontends/framebuffer/bitmap.c +++ b/frontends/framebuffer/bitmap.c @@ -51,7 +51,8 @@ static void *bitmap_create(int width, int height, unsigned int state) { nsfb_t *bm; - LOG("width %d, height %d, state %u", width, height, state); + NSLOG(netsurf, INFO, "width %d, height %d, state %u", width, height, + state); bm = nsfb_new(NSFB_SURFACE_RAM); if (bm == NULL) { @@ -69,7 +70,7 @@ static void *bitmap_create(int width, int height, unsigned int state) return NULL; } - LOG("bitmap %p", bm); + NSLOG(netsurf, INFO, "bitmap %p", bm); return bm; } @@ -197,11 +198,11 @@ static bool bitmap_test_opaque(void *bitmap) while (tst-- > 0) { if (bmpptr[(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; } @@ -282,14 +283,14 @@ bitmap_render(struct bitmap *bitmap, nsfb_get_geometry(tbm, &width, &height, NULL); - LOG("width %d, height %d", width, height); + NSLOG(netsurf, INFO, "width %d, height %d", width, height); /* Calculate size of buffer to render the content into */ - /* We get the width from the content width, unless it exceeds 1024, - * in which case we use 1024. This means we never create excessively - * large render buffers for huge contents, which would eat memory and - * cripple performance. */ - cwidth = min(content_get_width(content), 1024); + /* We get the width from the largest of the bitmap width and the content + * width, unless it exceeds 1024, in which case we use 1024. This means + * we never create excessively large render buffers for huge contents, + * which would eat memory and cripple performance. */ + cwidth = max(width, min(content_get_width(content), 1024)); /* The height is set in proportion with the width, according to the * aspect ratio of the required thumbnail. */ cheight = ((cwidth * height) + (width / 2)) / width; |