vcl/headless/CairoCommon.cxx     |   13 +++++++++++++
 vcl/headless/svpgdi.cxx          |   13 -------------
 vcl/inc/headless/CairoCommon.hxx |    2 ++
 3 files changed, 15 insertions(+), 13 deletions(-)

New commits:
commit 971b029308c527737d4085559e91fa8495b93d9c
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Tue Dec 28 14:12:19 2021 +0900
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Tue Jan 4 13:48:54 2022 +0100

    vcl: move Toggle1BitTransparency to CairoCommon
    
    Intermediate step beore moving bitmap related members.
    
    Change-Id: Iaa30fd53d3b14c08fd502b33d370950569994139
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127922
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx
index 5316b88e699f..6194d976ab7b 100644
--- a/vcl/headless/CairoCommon.cxx
+++ b/vcl/headless/CairoCommon.cxx
@@ -1160,4 +1160,17 @@ std::unique_ptr<BitmapBuffer> 
FastConvert24BitRgbTo32BitCairo(const BitmapBuffer
     return pDst;
 }
 
+void Toggle1BitTransparency(const BitmapBuffer& rBuf)
+{
+    assert(rBuf.maPalette.GetBestIndex(BitmapColor(COL_BLACK)) == 0);
+    // TODO: make upper layers use standard alpha
+    if (getCairoFormat(rBuf) == CAIRO_FORMAT_A1)
+    {
+        const int nImageSize = rBuf.mnHeight * rBuf.mnScanlineSize;
+        unsigned char* pDst = rBuf.mpBits;
+        for (int i = nImageSize; --i >= 0; ++pDst)
+            *pDst = ~*pDst;
+    }
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 25f385a8396a..92c0cbe39fbb 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -59,19 +59,6 @@
 
 namespace
 {
-    void Toggle1BitTransparency(const BitmapBuffer& rBuf)
-    {
-        assert(rBuf.maPalette.GetBestIndex(BitmapColor(COL_BLACK)) == 0);
-        // TODO: make upper layers use standard alpha
-        if (getCairoFormat(rBuf) == CAIRO_FORMAT_A1)
-        {
-            const int nImageSize = rBuf.mnHeight * rBuf.mnScanlineSize;
-            unsigned char* pDst = rBuf.mpBits;
-            for (int i = nImageSize; --i >= 0; ++pDst)
-                *pDst = ~*pDst;
-        }
-    }
-
     // check for env var that decides for using downscale pattern
     const char* pDisableDownScale(getenv("SAL_DISABLE_CAIRO_DOWNSCALE"));
     bool bDisableDownScale(nullptr != pDisableDownScale);
diff --git a/vcl/inc/headless/CairoCommon.hxx b/vcl/inc/headless/CairoCommon.hxx
index c79b2297e106..b1f6a8198a60 100644
--- a/vcl/inc/headless/CairoCommon.hxx
+++ b/vcl/inc/headless/CairoCommon.hxx
@@ -125,6 +125,8 @@ VCL_DLLPUBLIC cairo_format_t getCairoFormat(const 
BitmapBuffer& rBuffer);
 VCL_DLLPUBLIC std::unique_ptr<BitmapBuffer>
 FastConvert24BitRgbTo32BitCairo(const BitmapBuffer* pSrc);
 
+VCL_DLLPUBLIC void Toggle1BitTransparency(const BitmapBuffer& rBuf);
+
 enum class PaintMode
 {
     Over,

Reply via email to