summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2018-04-22 22:33:40 +1000
committerTomaž Vajngerl <quikee@gmail.com>2018-05-13 08:28:43 +0200
commit1f6af5c409105562edf2a034f4841c1aeb5a38b5 (patch)
tree28b62c6b4807bf135c0a066d8ee85412548366e4 /canvas
parent48cf194a1bdd7625c58edd201a7d5191fcd0f934 (diff)
vcl: move Bitmap::MakeMonochrome() to BitmapMonochromeFilter
Change-Id: Iefe5be4349475a4aa0138534cf6bfe87ff7df245 Reviewed-on: https://gerrit.libreoffice.org/53280 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/vcl/canvashelper.cxx6
-rw-r--r--canvas/source/vcl/spritehelper.cxx5
2 files changed, 8 insertions, 3 deletions
diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx
index d31a45286dc3..5a0a74e389d2 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -46,6 +46,7 @@
#include <vcl/bitmapaccess.hxx>
#include <vcl/canvastools.hxx>
#include <vcl/window.hxx>
+#include <vcl/BitmapMonochromeFilter.hxx>
#include <canvas/canvastools.hxx>
@@ -720,8 +721,9 @@ namespace vclcanvas
if( aBmpEx.IsAlpha() )
{
Bitmap aMask( aBmpEx.GetAlpha().GetBitmap() );
- aMask.MakeMonochrome(253);
- aBmpEx = BitmapEx( aBmpEx.GetBitmap(), aMask );
+ BitmapEx aMaskEx(aMask);
+ BitmapFilter::Filter(aMaskEx, BitmapMonochromeFilter(253));
+ aMask = aMaskEx.GetBitmap();
}
else if( aBmpEx.IsTransparent() )
{
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx
index 366d0a5b9829..9424d4ec54b9 100644
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -36,6 +36,7 @@
#include <vcl/bitmapex.hxx>
#include <vcl/canvastools.hxx>
#include <vcl/outdev.hxx>
+#include <vcl/BitmapMonochromeFilter.hxx>
#include <canvas/canvastools.hxx>
@@ -153,7 +154,9 @@ namespace vclcanvas
{
OSL_FAIL("CanvasCustomSprite::redraw(): Mask bitmap is not "
"monochrome (performance!)");
- aMask.MakeMonochrome(255);
+ BitmapEx aMaskEx(aMask);
+ BitmapFilter::Filter(aMaskEx, BitmapMonochromeFilter(255));
+ aMask = aMaskEx.GetBitmap();
}
#endif