diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2022-03-26 14:34:50 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2022-03-26 15:45:00 +0000 |
commit | 052acc752cd31d907f134deebfeb584259e3f7ed (patch) | |
tree | 6a1cbe741174532b7568e6737a6258b7173ccbd2 /content/handlers/image | |
parent | 7bf6a88c9c9ffe92602201b1073cb2daea73867f (diff) | |
download | netsurf-052acc752cd31d907f134deebfeb584259e3f7ed.tar.gz netsurf-052acc752cd31d907f134deebfeb584259e3f7ed.tar.bz2 |
Image: PNG: Call bitmap format conversion after decode.
Currently a no-op, because we decode to the default format
and no front end requests anything but the default format.
Diffstat (limited to 'content/handlers/image')
-rw-r--r-- | content/handlers/image/png.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/content/handlers/image/png.c b/content/handlers/image/png.c index d4c2ae061..e5d64c54f 100644 --- a/content/handlers/image/png.c +++ b/content/handlers/image/png.c @@ -32,6 +32,7 @@ #include "content/content_protected.h" #include "content/content_factory.h" #include "desktop/gui_internal.h" +#include "desktop/bitmap.h" #include "image/image_cache.h" #include "image/png.h" @@ -508,6 +509,11 @@ png_cache_convert_error: } if (bitmap != NULL) { + bitmap_fmt_t png_fmt = { + .layout = BITMAP_LAYOUT_R8G8B8A8, + }; + + bitmap_format_to_client((struct bitmap *)bitmap, &png_fmt); guit->bitmap->modified((struct bitmap *)bitmap); } @@ -536,6 +542,11 @@ static bool nspng_convert(struct content *c) if (png_c->bitmap != NULL) { guit->bitmap->set_opaque(png_c->bitmap, guit->bitmap->test_opaque(png_c->bitmap)); + bitmap_fmt_t png_fmt = { + .layout = BITMAP_LAYOUT_R8G8B8A8, + }; + + bitmap_format_to_client(png_c->bitmap, &png_fmt); guit->bitmap->modified(png_c->bitmap); } |