[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - drawinglayer/source vcl/headless

Vasily Melenchuk Vasily.Melenchuk at cib.de
Thu Mar 15 09:09:50 UTC 2018


 drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx |    6 +-
 vcl/headless/svpgdi.cxx                                      |   31 -----------
 2 files changed, 4 insertions(+), 33 deletions(-)

New commits:
commit c6be257f11560ee8fe755ea8ea8fb9432c982316
Author: Vasily Melenchuk <Vasily.Melenchuk at cib.de>
Date:   Tue Mar 6 16:23:40 2018 +0300

    tdf#115297: 1bit images displaying fixed (again)
    
    Previous fix 25cd843664919974f0d21ca7a0b02cc43e9eeabb like any
    other before it have some regressions, so reverted.
    
    The root of most problems: fix for tdf#104141
    d148340babf6c973f7d463909d7a51e16c953248, where mask drawing
    was implemented in bitmap drawing code.
    
    So instead of guessing for type of bitmap, mask is drawn with
    DrawBitmapEx resolving all known problems (tdf#114726, tdf#115297,
    tdf#113918 and tdf#104141).
    
    Reviewed-on: https://gerrit.libreoffice.org/50828
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    
    Conflicts:
            vcl/headless/svpgdi.cxx
    
    Change-Id: Ie00f7552d667e237b3c0f9505ee09cb51e85c43c

diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
index bd62db88bec4..22944564c4da 100644
--- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
@@ -263,7 +263,8 @@ namespace drawinglayer
                                 }
                                 else
                                 {
-                                    maVirtualDeviceMask->DrawBitmap(rAnimBitmap.aPosPix, aMask);
+                                    BitmapEx aExpandVisibilityMask = BitmapEx(aMask, aMask);
+                                    maVirtualDeviceMask->DrawBitmapEx(rAnimBitmap.aPosPix, aExpandVisibilityMask);
                                 }
 
                                 break;
@@ -271,7 +272,8 @@ namespace drawinglayer
                             case Disposal::Previous:
                             {
                                 maVirtualDevice->DrawBitmapEx(rAnimBitmap.aPosPix, rAnimBitmap.aBmpEx);
-                                maVirtualDeviceMask->DrawBitmap(rAnimBitmap.aPosPix, rAnimBitmap.aBmpEx.GetMask());
+                                BitmapEx aExpandVisibilityMask = BitmapEx(rAnimBitmap.aBmpEx.GetMask(), rAnimBitmap.aBmpEx.GetMask());
+                                maVirtualDeviceMask->DrawBitmapEx(rAnimBitmap.aPosPix, aExpandVisibilityMask);
                                 break;
                             }
                         }
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 4a3874f4586b..11f408aaf773 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1014,39 +1014,8 @@ void SvpSalGraphics::copyBits( const SalTwoRect& rTR,
         cairo_surface_destroy(pCopy);
 }
 
-namespace
-{
-    bool isBlackWhite(const SalBitmap& rBitmap)
-    {
-        const SvpSalBitmap& rSrcBmp = static_cast<const SvpSalBitmap&>(rBitmap);
-        const BitmapBuffer * pSourceBuffer = rSrcBmp.GetBuffer();
-        const BitmapPalette & rPalette = pSourceBuffer->maPalette;
-
-        return (
-            rPalette.GetEntryCount() < 2 ||
-
-            (rPalette.GetEntryCount() == 2 &&
-            rPalette[0] == Color(COL_BLACK) &&
-            rPalette[1] == Color(COL_WHITE) ) ||
-
-            (rPalette.GetEntryCount() == 2 &&
-            rPalette[1] == Color(COL_BLACK) &&
-            rPalette[0] == Color(COL_WHITE) )
-            );
-    }
-}
-
 void SvpSalGraphics::drawBitmap(const SalTwoRect& rTR, const SalBitmap& rSourceBitmap)
 {
-    if (rSourceBitmap.GetBitCount() == 1 && isBlackWhite(rSourceBitmap))
-    {
-        // This way we draw only monochrome b/w bitmaps
-        MaskHelper aMask(rSourceBitmap);
-        cairo_surface_t* source = aMask.getMask();
-        copySource(rTR, source);
-        return;
-    }
-
     SourceHelper aSurface(rSourceBitmap);
     cairo_surface_t* source = aSurface.getSurface();
     if (!source)


More information about the Libreoffice-commits mailing list