[Libreoffice-commits] core.git: vcl/headless vcl/inc

Noel Grandin noel.grandin at collabora.co.uk
Thu Feb 9 08:42:50 UTC 2017


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

New commits:
commit 0bf5254b00a21da3dd348a7155c2a40b8ae2d8fe
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Feb 8 13:22:14 2017 +0200

    convert PaintMode to scoped enum
    
    and drop unused INVERT enumerator
    
    Change-Id: I6db12ff76a5515bcb4691403b8fb380f9d74c1c9
    Reviewed-on: https://gerrit.libreoffice.org/34055
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 191c5c6..e638080 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -393,7 +393,7 @@ SvpSalGraphics::SvpSalGraphics()
     , m_fScale(1.0)
     , m_aLineColor(MAKE_SALCOLOR(0x00, 0x00, 0x00))
     , m_aFillColor(MAKE_SALCOLOR(0xFF, 0xFF, 0XFF))
-    , m_ePaintMode(OVERPAINT)
+    , m_ePaintMode(PaintMode::Over)
     , m_aTextRenderImpl(*this)
 {
 }
@@ -462,7 +462,7 @@ void SvpSalGraphics::SetFillColor( SalColor nSalColor )
 
 void SvpSalGraphics::SetXORMode(bool bSet )
 {
-    m_ePaintMode = bSet ? XOR : OVERPAINT;
+    m_ePaintMode = bSet ? PaintMode::Xor : PaintMode::Over;
 }
 
 void SvpSalGraphics::SetROPLineColor( SalROPColor nROPColor )
@@ -1291,17 +1291,14 @@ cairo_t* SvpSalGraphics::createTmpCompatibleCairoContext() const
 cairo_t* SvpSalGraphics::getCairoContext(bool bXorModeAllowed) const
 {
     cairo_t* cr;
-    if (m_ePaintMode == XOR && bXorModeAllowed)
+    if (m_ePaintMode == PaintMode::Xor && bXorModeAllowed)
         cr = createTmpCompatibleCairoContext();
     else
         cr = cairo_create(m_pSurface);
     cairo_set_line_width(cr, 1);
     cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
     cairo_set_antialias(cr, getAntiAliasB2DDraw() ? CAIRO_ANTIALIAS_DEFAULT : CAIRO_ANTIALIAS_NONE);
-    if (m_ePaintMode == INVERT)
-        cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
-    else
-        cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
+    cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
     return cr;
 }
 
@@ -1335,7 +1332,7 @@ void SvpSalGraphics::releaseCairoContext(cairo_t* cr, bool bXorModeAllowed, cons
     //For the most part we avoid the use of XOR these days, but there
     //are some edge cases where legacy stuff still supports it, so
     //emulate it (slowly) here.
-    if (m_ePaintMode == XOR && bXorModeAllowed)
+    if (m_ePaintMode == PaintMode::Xor && bXorModeAllowed)
     {
         cairo_surface_t* target_surface = m_pSurface;
         if (cairo_surface_get_type(target_surface) != CAIRO_SURFACE_TYPE_IMAGE)
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index 5673706..64101e3 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -65,7 +65,7 @@ typedef struct _cairo cairo_t;
 typedef struct _cairo_surface cairo_surface_t;
 typedef struct _cairo_user_data_key cairo_user_data_key_t;
 
-enum PaintMode { OVERPAINT, XOR, INVERT };
+enum class PaintMode { Over, Xor };
 
 typedef void (*damageHandler)(void* handle,
                               sal_Int32 nExtentsX, sal_Int32 nExtentsY,


More information about the Libreoffice-commits mailing list