[fix] Properly account for MuPDF feeding us premultiplied alpha (#4807)

* Properly account for MuPDF feeding us premultiplied alpha

* Bump base to pickup necessary backend changes

Also includes a bunch of CMake refactoring
(https://github.com/koreader/koreader-base/pull/865
https://github.com/koreader/koreader-base/pull/867
https://github.com/koreader/koreader-base/pull/868)
This commit is contained in:
NiLuJe
2019-03-18 09:35:27 +01:00
committed by Frans de Jonge
parent 59d8a1852f
commit 003de939b0
3 changed files with 5 additions and 3 deletions

2
base

Submodule base updated: 6bd23e9dc0...9dd7333312

View File

@@ -359,7 +359,8 @@ function ImageWidget:paintTo(bb, x, y)
-- Only actually try to alpha-blend if the image really has an alpha channel...
local bbtype = self._bb:getType()
if bbtype == Blitbuffer.TYPE_BB8A or bbtype == Blitbuffer.TYPE_BBRGB32 then
bb:alphablitFrom(self._bb, x, y, self._offset_x, self._offset_y, size.w, size.h)
-- NOTE: MuPDF feeds us premultiplied alpha (and we don't care w/ GifLib, as alpha is all or nothing).
bb:pmulalphablitFrom(self._bb, x, y, self._offset_x, self._offset_y, size.w, size.h)
else
bb:blitFrom(self._bb, x, y, self._offset_x, self._offset_y, size.w, size.h)
end

View File

@@ -431,7 +431,8 @@ function TextBoxWidget:_renderImage(start_row_idx)
-- With alpha-blending if the image contains an alpha channel
local bbtype = image.bb:getType()
if bbtype == Blitbuffer.TYPE_BB8A or bbtype == Blitbuffer.TYPE_BBRGB32 then
self._bb:alphablitFrom(image.bb, self.width - image.width, 0)
-- NOTE: MuPDF feeds us premultiplied alpha (and we don't care w/ GifLib, as alpha is all or nothing).
self._bb:pmulalphablitFrom(image.bb, self.width - image.width, 0)
else
self._bb:blitFrom(image.bb, self.width - image.width, 0)
end