[Libreoffice-commits] core.git: vcl/headless vcl/inc vcl/opengl vcl/quartz vcl/source vcl/unx vcl/win

Caolán McNamara caolanm at redhat.com
Tue Mar 28 19:59:09 UTC 2017


 vcl/headless/svpbmp.cxx        |    5 +++++
 vcl/inc/headless/svpbmp.hxx    |    1 +
 vcl/inc/impbmp.hxx             |    1 +
 vcl/inc/opengl/salbmp.hxx      |    1 +
 vcl/inc/quartz/salbmp.h        |    1 +
 vcl/inc/salbmp.hxx             |    1 +
 vcl/inc/unx/salbmp.h           |    1 +
 vcl/inc/win/salbmp.h           |    1 +
 vcl/opengl/scale.cxx           |    5 +++++
 vcl/quartz/salbmp.cxx          |    5 +++++
 vcl/source/gdi/bitmap3.cxx     |    2 +-
 vcl/source/gdi/impbmp.cxx      |    5 +++++
 vcl/unx/generic/gdi/salbmp.cxx |    5 +++++
 vcl/win/gdi/salbmp.cxx         |    5 +++++
 14 files changed, 38 insertions(+), 1 deletion(-)

New commits:
commit 5d87c15ef0935081319afe2400c99df14d9fa258
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Mar 28 10:00:59 2017 +0100

    ofz#954 out of memory
    
    Change-Id: Ib27f2dfe0d0837544910208f38a1bc11a35e3cb4
    Reviewed-on: https://gerrit.libreoffice.org/35794
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx
index ee5a98359591..3091dfba888c 100644
--- a/vcl/headless/svpbmp.cxx
+++ b/vcl/headless/svpbmp.cxx
@@ -267,6 +267,11 @@ bool SvpSalBitmap::GetSystemData( BitmapSystemData& )
     return false;
 }
 
+bool SvpSalBitmap::ScalingSupported() const
+{
+    return false;
+}
+
 bool SvpSalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/, BmpScaleFlag /*nScaleFlag*/ )
 {
     return false;
diff --git a/vcl/inc/headless/svpbmp.hxx b/vcl/inc/headless/svpbmp.hxx
index af50ecff6cf5..83c197087931 100644
--- a/vcl/inc/headless/svpbmp.hxx
+++ b/vcl/inc/headless/svpbmp.hxx
@@ -57,6 +57,7 @@ public:
     virtual void            ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode ) override;
     virtual bool            GetSystemData( BitmapSystemData& rData ) override;
 
+    virtual bool            ScalingSupported() const override;
     virtual bool            Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) override;
     virtual bool            Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) override;
 };
diff --git a/vcl/inc/impbmp.hxx b/vcl/inc/impbmp.hxx
index dd607fccc2f6..5824068c6c8a 100644
--- a/vcl/inc/impbmp.hxx
+++ b/vcl/inc/impbmp.hxx
@@ -66,6 +66,7 @@ public:
     BitmapChecksum      ImplGetChecksum() const;
     void                ImplInvalidateChecksum();
 
+    bool                ImplScalingSupported() const;
     bool                ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag );
     bool                ImplReplace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol );
     bool                ImplConvert( BmpConversion eConversion );
diff --git a/vcl/inc/opengl/salbmp.hxx b/vcl/inc/opengl/salbmp.hxx
index d10129ce8d0c..8d4e05f77050 100644
--- a/vcl/inc/opengl/salbmp.hxx
+++ b/vcl/inc/opengl/salbmp.hxx
@@ -74,6 +74,7 @@ public:
 
     bool            GetSystemData( BitmapSystemData& rData ) override;
 
+    bool            ScalingSupported() const override;
     bool            Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) override;
     bool            Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) override;
     bool            ConvertToGreyscale() override;
diff --git a/vcl/inc/quartz/salbmp.h b/vcl/inc/quartz/salbmp.h
index 5fe1294c41cf..7c79110ed509 100644
--- a/vcl/inc/quartz/salbmp.h
+++ b/vcl/inc/quartz/salbmp.h
@@ -74,6 +74,7 @@ public:
 
     bool            GetSystemData( BitmapSystemData& rData ) override;
 
+    bool            ScalingSupported() const override;
     bool            Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) override;
     bool            Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) override;
 
diff --git a/vcl/inc/salbmp.hxx b/vcl/inc/salbmp.hxx
index 69d25392a448..47d0c0280400 100644
--- a/vcl/inc/salbmp.hxx
+++ b/vcl/inc/salbmp.hxx
@@ -66,6 +66,7 @@ public:
     virtual void            ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode ) = 0;
     virtual bool            GetSystemData( BitmapSystemData& rData ) = 0;
 
+    virtual bool            ScalingSupported() const = 0;
     virtual bool            Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) = 0;
     virtual bool            Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) = 0;
 
diff --git a/vcl/inc/unx/salbmp.h b/vcl/inc/unx/salbmp.h
index 81998ba35bea..6b0e722dd7d6 100644
--- a/vcl/inc/unx/salbmp.h
+++ b/vcl/inc/unx/salbmp.h
@@ -144,6 +144,7 @@ public:
     virtual void                ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode ) override;
     virtual bool                GetSystemData( BitmapSystemData& rData ) override;
 
+    virtual bool                ScalingSupported() const override;
     virtual bool                Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) override;
     virtual bool                Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) override;
 };
diff --git a/vcl/inc/win/salbmp.h b/vcl/inc/win/salbmp.h
index d1b96be52a1c..33d88bb92a30 100644
--- a/vcl/inc/win/salbmp.h
+++ b/vcl/inc/win/salbmp.h
@@ -95,6 +95,7 @@ public:
     virtual void                ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode ) override;
     virtual bool                GetSystemData( BitmapSystemData& rData ) override;
 
+    virtual bool                ScalingSupported() const override;
     virtual bool                Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) override;
     virtual bool                Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) override;
 };
diff --git a/vcl/opengl/scale.cxx b/vcl/opengl/scale.cxx
index a6fa42ca543e..8a23fdd94100 100644
--- a/vcl/opengl/scale.cxx
+++ b/vcl/opengl/scale.cxx
@@ -371,6 +371,11 @@ bool OpenGLSalBitmap::ImplScale( const double& rScaleX, const double& rScaleY, B
     return false;
 }
 
+bool OpenGLSalBitmap::ScalingSupported() const
+{
+    return true;
+}
+
 bool OpenGLSalBitmap::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag )
 {
     OpenGLVCLContextZone aContextZone;
diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 014dd34259d9..5d358964e7cd 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -1048,6 +1048,11 @@ bool QuartzSalBitmap::GetSystemData( BitmapSystemData& rData )
     return bRet;
 }
 
+bool QuartzSalBitmap::ScalingSupported() const
+{
+    return false;
+}
+
 bool QuartzSalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/, BmpScaleFlag /*nScaleFlag*/ )
 {
     return false;
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index adcdba447f68..ce0f22210a32 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -776,7 +776,7 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag n
 
     const sal_uInt16 nStartCount(GetBitCount());
 
-    if (mxImpBmp)
+    if (mxImpBmp && mxImpBmp->ImplScalingSupported())
     {
         // implementation specific scaling
         std::shared_ptr<ImpBitmap> xImpBmp(new ImpBitmap);
diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx
index 25ebb604d0f1..4342bc8e6402 100644
--- a/vcl/source/gdi/impbmp.cxx
+++ b/vcl/source/gdi/impbmp.cxx
@@ -102,6 +102,11 @@ void ImpBitmap::ImplInvalidateChecksum()
     mpSalBitmap->InvalidateChecksum();
 }
 
+bool ImpBitmap::ImplScalingSupported() const
+{
+    return mpSalBitmap->ScalingSupported();
+}
+
 bool ImpBitmap::ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag )
 {
     return mpSalBitmap->Scale( rScaleX, rScaleY, nScaleFlag );
diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx
index 158a2f52d0fc..8301e75774df 100644
--- a/vcl/unx/generic/gdi/salbmp.cxx
+++ b/vcl/unx/generic/gdi/salbmp.cxx
@@ -896,6 +896,11 @@ bool X11SalBitmap::GetSystemData( BitmapSystemData& rData )
     return false;
 }
 
+bool X11SalBitmap::ScalingSupported() const
+{
+    return false;
+}
+
 bool X11SalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/, BmpScaleFlag /*nScaleFlag*/ )
 {
     return false;
diff --git a/vcl/win/gdi/salbmp.cxx b/vcl/win/gdi/salbmp.cxx
index 4470576edfd7..8b95249da6d8 100644
--- a/vcl/win/gdi/salbmp.cxx
+++ b/vcl/win/gdi/salbmp.cxx
@@ -1063,6 +1063,11 @@ bool WinSalBitmap::GetSystemData( BitmapSystemData& rData )
     return bRet;
 }
 
+bool WinSalBitmap::ScalingSupported() const
+{
+    return false;
+}
+
 bool WinSalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/, BmpScaleFlag /*nScaleFlag*/ )
 {
     return false;


More information about the Libreoffice-commits mailing list