[Libreoffice-commits] core.git: 3 commits - icon-themes/breeze icon-themes/galaxy vcl/headless

Caolán McNamara caolanm at redhat.com
Wed Nov 25 08:46:35 PST 2015


 dev/null                                        |binary
 icon-themes/galaxy/cmd/lc_changecasetolower.png |binary
 icon-themes/galaxy/cmd/lc_changecasetoupper.png |binary
 vcl/headless/svpgdi.cxx                         |   39 +++++++++++++++++-------
 4 files changed, 29 insertions(+), 10 deletions(-)

New commits:
commit 4fee13c30eb7b67fd1c97466955742536265687c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 25 16:43:19 2015 +0000

    gtk3: of course we have a different 1 bit mask format as well
    
    Change-Id: I02763bc1dfeec4a04f40fa0246cdc93eab6d6d33

diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 7864eff..ccfdd5c 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -134,6 +134,17 @@ bool SvpSalGraphics::blendAlphaBitmap( const SalTwoRect&, const SalBitmap&, cons
     return false;
 }
 
+namespace
+{
+    unsigned char reverseAndInvert(unsigned char b)
+    {
+        b = (b & 0xF0) >> 4 | (b & 0x0F) << 4;
+        b = (b & 0xCC) >> 2 | (b & 0x33) << 2;
+        b = (b & 0xAA) >> 1 | (b & 0x55) << 1;
+        return ~b;
+    }
+}
+
 bool SvpSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap )
 {
     bool bRet = false;
@@ -201,13 +212,10 @@ bool SvpSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, const SalBitmap& rS
         memcpy(pAlphaBits, pSrcBits, nImageSize);
 
         // TODO: make upper layers use standard alpha
-        long* pLDst = reinterpret_cast<long*>(pAlphaBits);
-        for( int i = nImageSize/sizeof(long); --i >= 0; ++pLDst )
+        sal_uInt32* pLDst = reinterpret_cast<sal_uInt32*>(pAlphaBits);
+        for( int i = nImageSize/sizeof(sal_uInt32); --i >= 0; ++pLDst )
             *pLDst = ~*pLDst;
-
-        char* pCDst = reinterpret_cast<char*>(pLDst);
-        for( int i = nImageSize & (sizeof(long)-1); --i >= 0; ++pCDst )
-            *pCDst = ~*pCDst;
+        assert(reinterpret_cast<unsigned char*>(pLDst) == pAlphaBits+nImageSize);
 
         mask = cairo_image_surface_create_for_data(pAlphaBits,
                                         CAIRO_FORMAT_A8,
@@ -216,7 +224,18 @@ bool SvpSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, const SalBitmap& rS
     }
     else
     {
-        mask = cairo_image_surface_create_for_data(data.get(),
+        // the alpha values need to be inverted *and* reordered for Cairo
+        // so big stupid copy and reverse + invert here
+        const int nImageSize = size.getY() * nStride;
+        const unsigned char* pSrcBits = data.get();
+        pAlphaBits = new unsigned char[nImageSize];
+        memcpy(pAlphaBits, pSrcBits, nImageSize);
+
+        unsigned char* pDst = pAlphaBits;
+        for (int i = nImageSize; --i >= 0; ++pDst)
+            *pDst = reverseAndInvert(*pDst);
+
+        mask = cairo_image_surface_create_for_data(pAlphaBits,
                                         CAIRO_FORMAT_A1,
                                         size.getX(), size.getY(),
                                         nStride);
commit 528417fb3ca30d028aece6867a5c2a079097d5e9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 25 16:09:29 2015 +0000

    presumably if only one theme has an icon, it should be in the base theme
    
    Change-Id: I90e1e147357d6509024f807bc2f777141e79b586

diff --git a/icon-themes/breeze/cmd/lc_changecasetolower.png b/icon-themes/galaxy/cmd/lc_changecasetolower.png
similarity index 100%
rename from icon-themes/breeze/cmd/lc_changecasetolower.png
rename to icon-themes/galaxy/cmd/lc_changecasetolower.png
diff --git a/icon-themes/breeze/cmd/lc_changecasetoupper.png b/icon-themes/galaxy/cmd/lc_changecasetoupper.png
similarity index 100%
rename from icon-themes/breeze/cmd/lc_changecasetoupper.png
rename to icon-themes/galaxy/cmd/lc_changecasetoupper.png
commit 213c0267c8c239eae9c2b00bdf737aaf678360e5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 25 15:59:20 2015 +0000

    downgrade these warnings to info
    
    quartz doesn't impl them either, so presumably its not too bad to
    not have them. Can't see anything visually ugly at the moment
    to warrant the effort.
    
    Change-Id: Ibf6119f549ab6712d3f1aca18e2cdab905f00030

diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 84b4b32..7864eff 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -964,7 +964,7 @@ bool SvpSalGraphics::drawPolyLineBezier( sal_uInt32,
                                          const SalPoint*,
                                          const sal_uInt8* )
 {
-    SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawPolyLineBezier case");
+    SAL_INFO("vcl.gdi", "unsupported SvpSalGraphics::drawPolyLineBezier case");
     return false;
 }
 
@@ -972,7 +972,7 @@ bool SvpSalGraphics::drawPolygonBezier( sal_uInt32,
                                         const SalPoint*,
                                         const sal_uInt8* )
 {
-    SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawPolygonBezier case");
+    SAL_INFO("vcl.gdi", "unsupported SvpSalGraphics::drawPolygonBezier case");
     return false;
 }
 
@@ -981,7 +981,7 @@ bool SvpSalGraphics::drawPolyPolygonBezier( sal_uInt32,
                                             const SalPoint* const*,
                                             const sal_uInt8* const* )
 {
-    SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawPolyPolygonBezier case");
+    SAL_INFO("vcl.gdi", "unsupported SvpSalGraphics::drawPolyPolygonBezier case");
     return false;
 }
 


More information about the Libreoffice-commits mailing list