diff options
author | Louis-Francis Ratté-Boulianne <lfrb@collabora.com> | 2014-12-02 14:19:33 -0500 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-12-03 14:05:36 +0100 |
commit | cf3ba3561522cba179ab602b257df902d6d5d110 (patch) | |
tree | bccacc8a093ece30d7af463049a195ac5de42631 /vcl | |
parent | 58824d6f551bd505af89d8086576fed2cdf95867 (diff) |
vcl: Add dummy Replace to SalBitmap implementations
Change-Id: I2f8b11a3f7cb8872a1d8f6eeeae8ce3f30223496
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/headless/svpbmp.cxx | 5 | ||||
-rw-r--r-- | vcl/inc/headless/svpbmp.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/impbmp.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/opengl/salbmp.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/quartz/salbmp.h | 1 | ||||
-rw-r--r-- | vcl/inc/salbmp.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/unx/salbmp.h | 1 | ||||
-rw-r--r-- | vcl/inc/win/salbmp.h | 3 | ||||
-rw-r--r-- | vcl/opengl/salbmp.cxx | 5 | ||||
-rw-r--r-- | vcl/quartz/salbmp.cxx | 5 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap.cxx | 18 | ||||
-rw-r--r-- | vcl/source/gdi/impbmp.cxx | 5 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salbmp.cxx | 5 | ||||
-rw-r--r-- | vcl/win/source/gdi/salbmp.cxx | 5 |
14 files changed, 57 insertions, 1 deletions
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx index e4080da12f68..014b0e92c90a 100644 --- a/vcl/headless/svpbmp.cxx +++ b/vcl/headless/svpbmp.cxx @@ -354,6 +354,11 @@ bool SvpSalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/, return false; } +bool SvpSalBitmap::Replace( const ::Color& /*rSearchColor*/, const ::Color& /*rReplaceColor*/, sal_uLong /*nTol*/ ) +{ + return false; +} + sal_uInt32 SvpSalBitmap::getBitCountFromScanlineFormat( basebmp::Format nFormat ) { sal_uInt32 nBitCount = 1; diff --git a/vcl/inc/headless/svpbmp.hxx b/vcl/inc/headless/svpbmp.hxx index eda1be49f293..61672fc1f136 100644 --- a/vcl/inc/headless/svpbmp.hxx +++ b/vcl/inc/headless/svpbmp.hxx @@ -21,6 +21,7 @@ #define INCLUDED_VCL_INC_HEADLESS_SVPBMP_HXX #include "sal/config.h" +#include "tools/solar.h" #include "basebmp/bitmapdevice.hxx" @@ -61,6 +62,7 @@ public: virtual bool Crop( const Rectangle& rRectPixel ) SAL_OVERRIDE; virtual bool Erase( const Color& rFillColor ) SAL_OVERRIDE; virtual bool Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) SAL_OVERRIDE; + virtual bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) SAL_OVERRIDE; static sal_uInt32 getBitCountFromScanlineFormat( basebmp::Format nFormat ); }; diff --git a/vcl/inc/impbmp.hxx b/vcl/inc/impbmp.hxx index 3b2abead2dc8..de709893cf69 100644 --- a/vcl/inc/impbmp.hxx +++ b/vcl/inc/impbmp.hxx @@ -71,6 +71,7 @@ public: bool ImplCrop( const Rectangle& rRectPixel ); bool ImplErase( const Color& rFillColor ); bool ImplScale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ); + bool ImplReplace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ); }; #endif // INCLUDED_VCL_INC_IMPBMP_HXX diff --git a/vcl/inc/opengl/salbmp.hxx b/vcl/inc/opengl/salbmp.hxx index c25dfa892785..2a3076433803 100644 --- a/vcl/inc/opengl/salbmp.hxx +++ b/vcl/inc/opengl/salbmp.hxx @@ -82,6 +82,7 @@ public: bool Crop( const Rectangle& rRectPixel ) SAL_OVERRIDE; bool Erase( const Color& rFillColor ) SAL_OVERRIDE; bool Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) SAL_OVERRIDE; + bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) SAL_OVERRIDE; public: diff --git a/vcl/inc/quartz/salbmp.h b/vcl/inc/quartz/salbmp.h index 107cb3946a93..b871ffbc5571 100644 --- a/vcl/inc/quartz/salbmp.h +++ b/vcl/inc/quartz/salbmp.h @@ -78,6 +78,7 @@ public: bool Crop( const Rectangle& rRectPixel ) SAL_OVERRIDE; bool Erase( const Color& rFillColor ) SAL_OVERRIDE; bool Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) SAL_OVERRIDE; + bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) SAL_OVERRIDE; private: // quartz helper diff --git a/vcl/inc/salbmp.hxx b/vcl/inc/salbmp.hxx index 12e795421743..9760bc6a40f4 100644 --- a/vcl/inc/salbmp.hxx +++ b/vcl/inc/salbmp.hxx @@ -59,6 +59,7 @@ public: virtual bool Crop( const Rectangle& rRectPixel ) = 0; virtual bool Erase( const Color& rFillColor ) = 0; virtual bool Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) = 0; + virtual bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) = 0; }; #endif diff --git a/vcl/inc/unx/salbmp.h b/vcl/inc/unx/salbmp.h index 0dfbb2ff3468..0b5cbc7b7944 100644 --- a/vcl/inc/unx/salbmp.h +++ b/vcl/inc/unx/salbmp.h @@ -149,6 +149,7 @@ public: virtual bool Crop( const Rectangle& rRectPixel ) SAL_OVERRIDE; virtual bool Erase( const Color& rFillColor ) SAL_OVERRIDE; virtual bool Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) SAL_OVERRIDE; + virtual bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) SAL_OVERRIDE; }; // - ImplSalDDB - diff --git a/vcl/inc/win/salbmp.h b/vcl/inc/win/salbmp.h index 7329449dc852..12fd4ca35dea 100644 --- a/vcl/inc/win/salbmp.h +++ b/vcl/inc/win/salbmp.h @@ -99,7 +99,8 @@ public: virtual bool Crop( const Rectangle& rRectPixel ) SAL_OVERRIDE; virtual bool Erase( const Color& rFillColor ) SAL_OVERRIDE; - virtual bool Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ); + virtual bool Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag ) SAL_OVERRIDE; + virtual bool Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) SAL_OVERRIDE; }; #endif // INCLUDED_VCL_INC_WIN_SALBMP_H diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx index 9fde11861325..078e050df1e9 100644 --- a/vcl/opengl/salbmp.cxx +++ b/vcl/opengl/salbmp.cxx @@ -579,4 +579,9 @@ bool OpenGLSalBitmap::Erase( const ::Color& /*rFillColor*/ ) return false; } +bool OpenGLSalBitmap::Replace( const Color& /*rSearchColor*/, const Color& /*rReplaceColor*/, sal_uLong /*nTol*/ ) +{ + return false; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx index e77f9d4a2ba7..d3fc899108c7 100644 --- a/vcl/quartz/salbmp.cxx +++ b/vcl/quartz/salbmp.cxx @@ -978,4 +978,9 @@ bool QuartzSalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY* return false; } +bool QuartzSalBitmap::Replace( const Color& /*rSearchColor*/, const Color& /*rReplaceColor*/, sal_uLong /*nTol*/ ) +{ + return false; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index 69a6ecfaa575..9915125cfd8d 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -1583,6 +1583,24 @@ bool Bitmap::Replace( const AlphaMask& rAlpha, const Color& rMergeColor ) bool Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) { + if( mpImpBmp ) + { + // implementation specific replace + ImpBitmap* pImpBmp = new ImpBitmap; + + if( pImpBmp->ImplCreate( *mpImpBmp ) && pImpBmp->ImplReplace( rSearchColor, rReplaceColor, nTol ) ) + { + ImplSetImpBitmap( pImpBmp ); + maPrefMapMode = MapMode( MAP_PIXEL ); + maPrefSize = pImpBmp->ImplGetSize(); + return true; + } + else + { + delete pImpBmp; + } + } + // Bitmaps with 1 bit color depth can cause problems // if they have other entries than black/white in their palette if( 1 == GetBitCount() ) diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx index bcb5b75d20d5..5a478453f684 100644 --- a/vcl/source/gdi/impbmp.cxx +++ b/vcl/source/gdi/impbmp.cxx @@ -108,4 +108,9 @@ bool ImpBitmap::ImplScale( const double& rScaleX, const double& rScaleY, sal_uIn return mpSalBitmap->Scale( rScaleX, rScaleY, nScaleFlag ); } +bool ImpBitmap::ImplReplace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) +{ + return mpSalBitmap->Replace( rSearchColor, rReplaceColor, nTol ); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/gdi/salbmp.cxx b/vcl/unx/generic/gdi/salbmp.cxx index a08aa7da0290..3495ede50595 100644 --- a/vcl/unx/generic/gdi/salbmp.cxx +++ b/vcl/unx/generic/gdi/salbmp.cxx @@ -875,6 +875,11 @@ bool X11SalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/, return false; } +bool X11SalBitmap::Replace( const Color& /*rSearchColor*/, const Color& /*rReplaceColor*/, sal_uLong /*nTol*/ ) +{ + return false; +} + // - ImplSalDDB - ImplSalDDB::ImplSalDDB( XImage* pImage, Drawable aDrawable, diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx index 9af94eef6c19..b32067d2d5d8 100644 --- a/vcl/win/source/gdi/salbmp.cxx +++ b/vcl/win/source/gdi/salbmp.cxx @@ -1077,4 +1077,9 @@ bool WinSalBitmap::Scale( const double& /*rScaleX*/, const double& /*rScaleY*/, return false; } +bool WinSalBitmap::Replace( const Color& /*rSearchColor*/, const Color& /*rReplaceColor*/, sal_uLong /*nTol*/ ) +{ + return false; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |