diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-09-04 17:12:02 +0100 |
---|---|---|
committer | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2017-12-18 01:07:48 -0500 |
commit | b465a97637c0196054e50f92cfd689707342afdc (patch) | |
tree | ac56d1019208c1e66130f950aa5342f250d4e054 | |
parent | 5b973df3bc4f6e8949b66435b7a944b10d16f13b (diff) |
Resolves: tdf#111073 incorrect gif background color
a) set correct palette entries for the 1bit bitmap returned
b) only use a BITMASK for the mask (like its AnimatedGraphicPrimitive2D
brother in drawinglayer does)
Change-Id: I704997de554dc4d0e523458d45ab329815b5046a
Reviewed-on: https://gerrit.libreoffice.org/41905
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 67951d08ddd20ac87fc7eb54a90cb81901a89f8c)
(cherry picked from commit cee19bc97ae6d9f50233c193f8015951c30313bb)
-rw-r--r-- | slideshow/source/engine/shapes/gdimtftools.cxx | 2 | ||||
-rw-r--r-- | vcl/headless/svpgdi.cxx | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx index 6cd569e37aa1..efa43030872a 100644 --- a/slideshow/source/engine/shapes/gdimtftools.cxx +++ b/slideshow/source/engine/shapes/gdimtftools.cxx @@ -287,7 +287,7 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, pVDev->EnableMapMode( false ); // setup mask VDev (alpha VDev is currently rather slow) - ScopedVclPtrInstance< VirtualDevice > pVDevMask; + ScopedVclPtrInstance<VirtualDevice> pVDevMask(DeviceFormat::BITMASK); pVDevMask->SetOutputSizePixel( aAnimSize ); pVDevMask->EnableMapMode( false ); diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index df74a928c30e..da8377787eca 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -1144,7 +1144,14 @@ void SvpSalGraphics::drawMask( const SalTwoRect& rTR, SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeight ) { SvpSalBitmap* pBitmap = new SvpSalBitmap(); - pBitmap->Create(Size(nWidth, nHeight), GetBitCount(), BitmapPalette()); + BitmapPalette aPal; + if (GetBitCount() == 1) + { + aPal.SetEntryCount(2); + aPal[0] = Color(COL_BLACK); + aPal[1] = Color(COL_WHITE); + } + pBitmap->Create(Size(nWidth, nHeight), GetBitCount(), aPal); cairo_surface_t* target = SvpSalGraphics::createCairoSurface(pBitmap->GetBuffer()); cairo_t* cr = cairo_create(target); |