vcl/headless/CairoCommon.cxx                    |   11 +++++++++++
 vcl/headless/SvpGraphicsBackend.cxx             |    8 +-------
 vcl/inc/headless/CairoCommon.hxx                |    3 +++
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx |    5 +++++
 vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx |    2 ++
 vcl/unx/generic/gdi/gdiimpl.cxx                 |   24 ------------------------
 vcl/unx/generic/gdi/gdiimpl.hxx                 |    2 --
 7 files changed, 22 insertions(+), 33 deletions(-)

New commits:
commit 06c0b13cbbd1672861ebd898e0e11981c5bb82a8
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Jan 2 21:11:38 2023 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Jan 4 19:25:29 2023 +0000

    move supportsOperation to CairoCommon
    
    Change-Id: I754080c322ec76ec8e218f8c97b1649eaf922c74
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144974
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/headless/CairoCommon.cxx b/vcl/headless/CairoCommon.cxx
index 3a8010f21b59..b79d942709b6 100644
--- a/vcl/headless/CairoCommon.cxx
+++ b/vcl/headless/CairoCommon.cxx
@@ -1112,6 +1112,17 @@ cairo_surface_t* CairoCommon::createCairoSurface(const 
BitmapBuffer* pBuffer)
     return target;
 }
 
+bool CairoCommon::supportsOperation(OutDevSupportType eType)
+{
+    switch (eType)
+    {
+        case OutDevSupportType::TransparentRect:
+        case OutDevSupportType::B2DDraw:
+            return true;
+    }
+    return false;
+}
+
 std::unique_ptr<BitmapBuffer> FastConvert24BitRgbTo32BitCairo(const 
BitmapBuffer* pSrc)
 {
     if (pSrc == nullptr)
diff --git a/vcl/headless/SvpGraphicsBackend.cxx 
b/vcl/headless/SvpGraphicsBackend.cxx
index 355a971b9b01..63e66d9a31e2 100644
--- a/vcl/headless/SvpGraphicsBackend.cxx
+++ b/vcl/headless/SvpGraphicsBackend.cxx
@@ -993,13 +993,7 @@ bool 
SvpGraphicsBackend::implDrawGradient(basegfx::B2DPolyPolygon const& rPolyPo
 
 bool SvpGraphicsBackend::supportsOperation(OutDevSupportType eType) const
 {
-    switch (eType)
-    {
-        case OutDevSupportType::TransparentRect:
-        case OutDevSupportType::B2DDraw:
-            return true;
-    }
-    return false;
+    return CairoCommon::supportsOperation(eType);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/headless/CairoCommon.hxx b/vcl/inc/headless/CairoCommon.hxx
index 3bf132c95894..e232d2167380 100644
--- a/vcl/inc/headless/CairoCommon.hxx
+++ b/vcl/inc/headless/CairoCommon.hxx
@@ -27,6 +27,7 @@
 #include <vcl/dllapi.h>
 #include <vcl/region.hxx>
 #include <vcl/salgtype.hxx>
+#include <vcl/vclenum.hxx>
 #include <vcl/BitmapBuffer.hxx>
 
 #include <com/sun/star/drawing/LineCap.hpp>
@@ -172,6 +173,8 @@ struct VCL_DLLPUBLIC CairoCommon
 
     static cairo_surface_t* createCairoSurface(const BitmapBuffer* pBuffer);
 
+    static bool supportsOperation(OutDevSupportType eType);
+
 private:
     void doXorOnRelease(sal_Int32 nExtentsLeft, sal_Int32 nExtentsTop, 
sal_Int32 nExtentsRight,
                         sal_Int32 nExtentsBottom, cairo_surface_t* const 
surface,
diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx 
b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
index fd030b112f38..a4ea13a63079 100644
--- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
+++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
@@ -153,13 +153,7 @@ bool X11CairoSalGraphicsImpl::drawPolyLine(const 
basegfx::B2DHomMatrix& rObjectT
 
 bool X11CairoSalGraphicsImpl::supportsOperation(OutDevSupportType eType) const
 {
-    switch (eType)
-    {
-        case OutDevSupportType::TransparentRect:
-        case OutDevSupportType::B2DDraw:
-            return true;
-    }
-    return false;
+    return CairoCommon::supportsOperation(eType);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 0ec1a28b4d43fc78cb5cc4c23dd0e76fd62d5e69
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Jan 2 21:07:14 2023 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Jan 4 19:25:18 2023 +0000

    move supportsOperation to X11CairoSalGraphicsImpl
    
    Change-Id: Ic5a8652857d0104310d1aead8a55d0f053852c6d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144973
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx 
b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
index 438aaf46b455..fd030b112f38 100644
--- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
+++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.cxx
@@ -151,4 +151,15 @@ bool X11CairoSalGraphicsImpl::drawPolyLine(const 
basegfx::B2DHomMatrix& rObjectT
     return bRetval;
 }
 
+bool X11CairoSalGraphicsImpl::supportsOperation(OutDevSupportType eType) const
+{
+    switch (eType)
+    {
+        case OutDevSupportType::TransparentRect:
+        case OutDevSupportType::B2DDraw:
+            return true;
+    }
+    return false;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx 
b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
index 2c7ab449a97c..ae47dc061ae0 100644
--- a/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
+++ b/vcl/unx/generic/gdi/X11CairoSalGraphicsImpl.hxx
@@ -85,6 +85,8 @@ public:
                       const std::vector<double>* pStroke, basegfx::B2DLineJoin 
eLineJoin,
                       css::drawing::LineCap eLineCap, double 
fMiterMinimumAngle,
                       bool bPixelSnapHairline) override;
+
+    virtual bool supportsOperation(OutDevSupportType eType) const override;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/gdi/gdiimpl.cxx b/vcl/unx/generic/gdi/gdiimpl.cxx
index cc7ba7052fb2..0300a646e352 100644
--- a/vcl/unx/generic/gdi/gdiimpl.cxx
+++ b/vcl/unx/generic/gdi/gdiimpl.cxx
@@ -1984,28 +1984,4 @@ bool 
X11SalGraphicsImpl::implDrawGradient(basegfx::B2DPolyPolygon const & /*rPol
     return false;
 }
 
-bool X11SalGraphicsImpl::supportsOperation(OutDevSupportType eType) const
-{
-    bool bRet = false;
-    switch (eType)
-    {
-        case OutDevSupportType::TransparentRect:
-        case OutDevSupportType::B2DDraw:
-        {
-            XRenderPeer& rPeer = XRenderPeer::GetInstance();
-            const SalDisplay* pSalDisp = mrParent.GetDisplay();
-            const SalVisual& rSalVis = 
pSalDisp->GetVisual(mrParent.GetScreenNumber());
-
-            Visual* pDstXVisual = rSalVis.GetVisual();
-            XRenderPictFormat* pDstVisFmt = 
rPeer.FindVisualFormat(pDstXVisual);
-            if (pDstVisFmt)
-                bRet = true;
-        }
-        break;
-        default:
-            break;
-    }
-    return bRet;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/gdi/gdiimpl.hxx b/vcl/unx/generic/gdi/gdiimpl.hxx
index d62011506a14..48cde6330041 100644
--- a/vcl/unx/generic/gdi/gdiimpl.hxx
+++ b/vcl/unx/generic/gdi/gdiimpl.hxx
@@ -288,8 +288,6 @@ public:
     virtual bool drawGradient(const tools::PolyPolygon& rPolygon, const 
Gradient& rGradient) override;
     virtual bool implDrawGradient(basegfx::B2DPolyPolygon const & 
rPolyPolygon, SalGradient const & rGradient) override;
 
-    virtual bool supportsOperation(OutDevSupportType eType) const override;
-
 public:
     void Init() override;
 };

Reply via email to