[Libreoffice-commits] core.git: 3 commits - drawinglayer/source include/drawinglayer sd/source svx/source

Miklos Vajna vmiklos at collabora.co.uk
Fri Oct 2 06:02:28 PDT 2015


 drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx  |    6 ++++--
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx         |    4 +++-
 include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx |    5 ++++-
 sd/source/ui/view/drviews1.cxx                                  |    3 +++
 svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx           |    2 +-
 5 files changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 474228f89128487ea7a216580df0a8bc5e06f87e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Oct 2 15:01:52 2015 +0200

    sd tiled rendering: default to transparent background outside slide area
    
    Change-Id: Ic9023640c34c3d7efd00e2eb0894ed4d01109d8d

diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 78a6bc0..cf146ae 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -80,6 +80,7 @@
 #include "ViewShellHint.hxx"
 
 #include <sfx2/request.hxx>
+#include <comphelper/lok.hxx>
 
 using namespace com::sun::star;
 
@@ -380,6 +381,8 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
 
         svtools::ColorConfig aColorConfig;
         Color aFillColor = Color( aColorConfig.GetColorValue( svtools::APPBACKGROUND ).nColor );
+        if (comphelper::LibreOfficeKit::isActive())
+            aFillColor = COL_TRANSPARENT;
 
         if (meEditMode == EM_PAGE)
         {
commit b1a9aba3bc33524dcf0dc1c4afc5c1aeeb5ba4d1
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Oct 2 14:12:20 2015 +0200

    svx, drawinglayer: handle tools Color <-> BackgroundColorPrimitive2D roundtrip
    
    Change-Id: Ia8c080ef50e1ddbfce17b5c5d357a240edea46f2

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 9aa861d..54cedad 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -1161,7 +1161,9 @@ namespace drawinglayer
 
                     // create color for fill
                     const basegfx::BColor aPolygonColor(maBColorModifierStack.getModifiedColor(rPrimitive.getBColor()));
-                    mpOutputDevice->SetFillColor(Color(aPolygonColor));
+                    Color aFillColor(aPolygonColor);
+                    aFillColor.SetTransparency(sal_uInt8((rPrimitive.getTransparency() * 255.0) + 0.5));
+                    mpOutputDevice->SetFillColor(aFillColor);
                     mpOutputDevice->SetLineColor();
 
                     // create rectangle for fill
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
index 4ca35ba..dcb8325 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx
@@ -142,7 +142,7 @@ drawinglayer::primitive2d::Primitive2DSequence ViewObjectContactOfPageBackground
         // init background with InitColor
         xRetval.realloc(1);
         const basegfx::BColor aRGBColor(aInitColor.getBColor());
-        xRetval[0] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::BackgroundColorPrimitive2D(aRGBColor));
+        xRetval[0] = drawinglayer::primitive2d::Primitive2DReference(new drawinglayer::primitive2d::BackgroundColorPrimitive2D(aRGBColor, aInitColor.GetTransparency() / 255.0));
     }
 
     return xRetval;
commit 9824134ab3c19aa0a00943c65a0e09c36ef23899
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Oct 2 13:48:17 2015 +0200

    drawinglayer: add transparency support to BackgroundColorPrimitive2D
    
    Impress has tools Color that is wrapped in this primitive, then later
    drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D()
    converts it back to tools Color. Problem is that the primitive uses basegfx
    BColor, so the alpha channel is lost.
    
    Add member and API to survive this roundtrip.
    
    Change-Id: I940e60f6e352022306abac3223636d19dd859355

diff --git a/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx b/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx
index 3441483..ea10d20 100644
--- a/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx
@@ -50,9 +50,11 @@ namespace drawinglayer
         }
 
         BackgroundColorPrimitive2D::BackgroundColorPrimitive2D(
-            const basegfx::BColor& rBColor)
+            const basegfx::BColor& rBColor,
+            double fTransparency)
         :   BufferedDecompositionPrimitive2D(),
             maBColor(rBColor),
+            mfTransparency(fTransparency),
             maLastViewport()
         {
         }
@@ -63,7 +65,7 @@ namespace drawinglayer
             {
                 const BackgroundColorPrimitive2D& rCompare = static_cast<const BackgroundColorPrimitive2D&>(rPrimitive);
 
-                return (getBColor() == rCompare.getBColor());
+                return (getBColor() == rCompare.getBColor() && getTransparency() == rCompare.getTransparency());
             }
 
             return false;
diff --git a/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx b/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
index 3b789eb..def2b43 100644
--- a/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/backgroundcolorprimitive2d.hxx
@@ -48,6 +48,7 @@ namespace drawinglayer
         private:
             /// the fill color to use
             basegfx::BColor                             maBColor;
+            double mfTransparency;
 
             /// the last used viewInformation, used from getDecomposition for buffering
             basegfx::B2DRange                           maLastViewport;
@@ -59,10 +60,12 @@ namespace drawinglayer
         public:
             /// constructor
             explicit BackgroundColorPrimitive2D(
-                const basegfx::BColor& rBColor);
+                const basegfx::BColor& rBColor,
+                double fTransparency = 0);
 
             /// data read access
             const basegfx::BColor& getBColor() const { return maBColor; }
+            double getTransparency() const { return mfTransparency; }
 
             /// compare operator
             virtual bool operator==(const BasePrimitive2D& rPrimitive) const SAL_OVERRIDE;


More information about the Libreoffice-commits mailing list