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>
This commit is contained in:
@@ -285,7 +285,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 );
|
||||
|
||||
|
@@ -1145,7 +1145,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);
|
||||
|
Reference in New Issue
Block a user