summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-03-28 16:06:02 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2022-03-28 16:06:02 +0100
commitfeeda29c27cff97eca82de8044d5d4161eac2491 (patch)
tree988cd4b750c4e58813edde1782f74821fc0f6d3d /content
parent4307230331cba76e3bae99e76021c9991a522b97 (diff)
downloadnetsurf-feeda29c27cff97eca82de8044d5d4161eac2491.tar.gz
netsurf-feeda29c27cff97eca82de8044d5d4161eac2491.tar.bz2
WebP: Optimisation: If it's opaque avoid any PMA conversions.
Diffstat (limited to 'content')
-rw-r--r--content/handlers/image/webp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/content/handlers/image/webp.c b/content/handlers/image/webp.c
index 4087f4cfe..da13316bc 100644
--- a/content/handlers/image/webp.c
+++ b/content/handlers/image/webp.c
@@ -112,6 +112,10 @@ webp_cache_convert(struct content *c)
if (webpfeatures.has_alpha == 0) {
bmap_flags = BITMAP_OPAQUE;
+ /* Image has no alpha. Premultiplied alpha makes no difference.
+ * Optimisation: Avoid unnecessary conversion by copying format.
+ */
+ webp_fmt.pma = bitmap_fmt.pma;
} else {
bmap_flags = BITMAP_NONE;
}