diff options
author | Paris Oplopoios <paris.oplopoios@collabora.com> | 2023-06-24 17:36:09 +0300 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-06-29 15:19:54 +0200 |
commit | 8dfde7d69a8bbdc8ce88aefded231b94e30271d6 (patch) | |
tree | c0c2e0b78bcedd4ff327f7e62af411f97f02e797 /drawinglayer/source/primitive2d | |
parent | 532e37c8127c9ae8bc1c455ef2d582e6d2252fb5 (diff) |
tdf#104877 Implement APNG blending modes
Change-Id: Ib7ce4d113ccaa4843b8332087ebe52ac3828180e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153556
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'drawinglayer/source/primitive2d')
-rw-r--r-- | drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx index a95df2474744..f3c4cf69911c 100644 --- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx @@ -252,6 +252,15 @@ namespace drawinglayer::primitive2d // prepare step const AnimationFrame& rAnimationFrame = maAnimation.Get(sal_uInt16(mnNextFrameToPrepare)); + bool bSourceBlending = rAnimationFrame.meBlend == Blend::Source; + + if (bSourceBlending) + { + tools::Rectangle aArea(rAnimationFrame.maPositionPixel, rAnimationFrame.maBitmapEx.GetSizePixel()); + maVirtualDevice->Erase(aArea); + maVirtualDeviceMask->Erase(aArea); + } + switch (rAnimationFrame.meDisposal) { case Disposal::Not: @@ -278,14 +287,13 @@ namespace drawinglayer::primitive2d { // #i70772# react on no mask, for primitives, too. const AlphaMask & rMask(rAnimationFrame.maBitmapEx.GetAlphaMask()); - const Bitmap & rContent(rAnimationFrame.maBitmapEx.GetBitmap()); maVirtualDeviceMask->Erase(); - maVirtualDevice->DrawBitmap(rAnimationFrame.maPositionPixel, rContent); + maVirtualDevice->DrawBitmapEx(rAnimationFrame.maPositionPixel, rAnimationFrame.maBitmapEx); if (rMask.IsEmpty()) { - const ::tools::Rectangle aRect(rAnimationFrame.maPositionPixel, rContent.GetSizePixel()); + const ::tools::Rectangle aRect(rAnimationFrame.maPositionPixel, rAnimationFrame.maBitmapEx.GetSizePixel()); maVirtualDeviceMask->SetFillColor(COL_BLACK); maVirtualDeviceMask->SetLineColor(); maVirtualDeviceMask->DrawRect(aRect); |