[Libreoffice-commits] core.git: include/vcl vcl/source

Bryan Quigley gquigs at gmail.com
Tue Oct 13 23:01:45 PDT 2015


 include/vcl/outdev.hxx          |    3 --
 include/vcl/window.hxx          |    6 ----
 vcl/source/outdev/wallpaper.cxx |   57 +++++++---------------------------------
 3 files changed, 10 insertions(+), 56 deletions(-)

New commits:
commit fe4412c8850bd1212dce786510dd61ddd6c43b36
Author: Bryan Quigley <gquigs at gmail.com>
Date:   Thu Oct 8 16:23:28 2015 -0400

    Unused code removal DrawGradientWallpaper
    
    Doesn't appear needed on Linux and tests have shown it isn't
    needed on Windows or Mac either.
    
    Change-Id: Iaaba6dcc4783557a4165d635b57a256402b0b4d2
    Reviewed-on: https://gerrit.libreoffice.org/19259
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index f4cbc5f..33908fc 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -999,9 +999,6 @@ public:
     virtual void                Erase();
     virtual void                Erase( const Rectangle& rRect ) { DrawWallpaper( rRect, GetBackground() ); }
 
-protected:
-    virtual void                DrawGradientWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
-
 private:
     SAL_DLLPRIVATE void         DrawWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
     SAL_DLLPRIVATE void         DrawColorWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 308760b..9e0bbbc 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -812,12 +812,6 @@ protected:
     virtual void                        ClipToPaintRegion( Rectangle& rDstRect ) override;
     virtual bool                        UsePolyPolygonForComplexGradient() override;
 
-    virtual void DrawGradientWallpaper(long nX, long nY, long nWidth, long nHeight,
-                                       const Wallpaper& rWallpaper) override
-    {
-        OutputDevice::DrawGradientWallpaper(nX, nY, nWidth, nHeight, rWallpaper);
-    }
-
     virtual void ApplySettings(vcl::RenderContext& rRenderContext);
 public:
     bool                                HasMirroredGraphics() const override;
diff --git a/vcl/source/outdev/wallpaper.cxx b/vcl/source/outdev/wallpaper.cxx
index 175f0d1..1819f93 100644
--- a/vcl/source/outdev/wallpaper.cxx
+++ b/vcl/source/outdev/wallpaper.cxx
@@ -60,8 +60,6 @@ void OutputDevice::DrawWallpaper( long nX, long nY,
 
     if( rWallpaper.IsBitmap() )
         DrawBitmapWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
-    else if( rWallpaper.IsGradient() )
-        DrawGradientWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
     else
         DrawColorWallpaper(  nX, nY, nWidth, nHeight, rWallpaper );
 }
@@ -119,7 +117,6 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY,
     const WallpaperStyle eStyle = rWallpaper.GetStyle();
     const bool bOldMap = mbMap;
     bool bDrawn = false;
-    bool bDrawGradientBackground = false;
     bool bDrawColorBackground = false;
 
     if( pCached )
@@ -134,34 +131,24 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY,
     // draw background
     if( bTransparent )
     {
-        if( rWallpaper.IsGradient() )
-            bDrawGradientBackground = true;
-        else
+        if( !pCached && !rWallpaper.GetColor().GetTransparency() )
         {
-            if( !pCached && !rWallpaper.GetColor().GetTransparency() )
-            {
-                ScopedVclPtrInstance< VirtualDevice > aVDev(  *this  );
-                aVDev->SetBackground( rWallpaper.GetColor() );
-                aVDev->SetOutputSizePixel( Size( nBmpWidth, nBmpHeight ) );
-                aVDev->DrawBitmapEx( Point(), aBmpEx );
-                aBmpEx = aVDev->GetBitmap( Point(), aVDev->GetOutputSizePixel() );
-            }
-
-            bDrawColorBackground = true;
+            ScopedVclPtrInstance< VirtualDevice > aVDev(  *this  );
+            aVDev->SetBackground( rWallpaper.GetColor() );
+            aVDev->SetOutputSizePixel( Size( nBmpWidth, nBmpHeight ) );
+            aVDev->DrawBitmapEx( Point(), aBmpEx );
+            aBmpEx = aVDev->GetBitmap( Point(), aVDev->GetOutputSizePixel() );
         }
+
+        bDrawColorBackground = true;
     }
     else if( eStyle != WallpaperStyle::Tile && eStyle != WallpaperStyle::Scale )
     {
-        if( rWallpaper.IsGradient() )
-            bDrawGradientBackground = true;
-        else
-            bDrawColorBackground = true;
+        bDrawColorBackground = true;
     }
 
     // background of bitmap?
-    if( bDrawGradientBackground )
-        DrawGradientWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
-    else if( bDrawColorBackground && bTransparent )
+    if( bDrawColorBackground && bTransparent )
     {
         DrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
         bDrawColorBackground = false;
@@ -343,28 +330,4 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY,
     mpMetaFile = pOldMetaFile;
 }
 
-void OutputDevice::DrawGradientWallpaper( long nX, long nY,
-                                          long nWidth, long nHeight,
-                                          const Wallpaper& rWallpaper )
-{
-    assert(!is_double_buffered_window());
-
-    Rectangle aBound;
-    GDIMetaFile* pOldMetaFile = mpMetaFile;
-    const bool bOldMap = mbMap;
-
-    aBound = Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) );
-
-    mpMetaFile = NULL;
-    EnableMapMode( false );
-    Push( PushFlags::CLIPREGION );
-    IntersectClipRegion( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ) );
-
-    DrawGradient( aBound, rWallpaper.GetGradient() );
-
-    Pop();
-    EnableMapMode( bOldMap );
-    mpMetaFile = pOldMetaFile;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list