summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-16 10:07:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-16 12:42:57 +0200
commit9c5f87511715ec56edf8623c583d2e37abfb2852 (patch)
treedbb8026c62ca22c62d67b3fe6dfd137ed7e3333f
parentb36ea44dcbdb862b0ac6e6cdaf27225b43dc0c7e (diff)
rename ImpBitmap::ImplConvert to ConvertToGreyscale
in preparation for removing ImpBitmap Change-Id: I1d56f2a4698559e3ff3b321577c29272ab050482 Reviewed-on: https://gerrit.libreoffice.org/52940 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--vcl/inc/impbmp.hxx2
-rw-r--r--vcl/source/gdi/bitmap3.cxx15
-rw-r--r--vcl/source/gdi/impbmp.cxx7
3 files changed, 12 insertions, 12 deletions
diff --git a/vcl/inc/impbmp.hxx b/vcl/inc/impbmp.hxx
index 3cb532bc9cfb..3281c741370d 100644
--- a/vcl/inc/impbmp.hxx
+++ b/vcl/inc/impbmp.hxx
@@ -70,7 +70,7 @@ public:
bool ImplScalingSupported() const;
bool ImplScale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag );
bool ImplReplace( const Color& rSearchColor, const Color& rReplaceColor, sal_uInt8 nTol );
- bool ImplConvert( BmpConversion eConversion );
+ bool ConvertToGreyscale();
};
#endif // INCLUDED_VCL_INC_IMPBMP_HXX
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index b42731e3696a..a8c42977bffb 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -224,12 +224,17 @@ bool Bitmap::Convert( BmpConversion eConversion )
// try to convert in backend
if (mxImpBmp)
{
- std::shared_ptr<ImpBitmap> xImpBmp(new ImpBitmap);
- if (xImpBmp->ImplCreate(*mxImpBmp) && xImpBmp->ImplConvert(eConversion))
+ // avoid large chunk of obsolete and hopefully rarely used conversions.
+ if (eConversion == BmpConversion::N8BitGreys)
{
- ImplSetImpBitmap(xImpBmp);
- SAL_INFO( "vcl.opengl", "Ref count: " << mxImpBmp.use_count() );
- return true;
+ std::shared_ptr<ImpBitmap> xImpBmp(new ImpBitmap);
+ // frequently used conversion for creating alpha masks
+ if (xImpBmp->ImplCreate(*mxImpBmp) && xImpBmp->ConvertToGreyscale())
+ {
+ ImplSetImpBitmap(xImpBmp);
+ SAL_INFO( "vcl.opengl", "Ref count: " << mxImpBmp.use_count() );
+ return true;
+ }
}
}
diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx
index ffd7f4cb45cf..9b9835b3df2d 100644
--- a/vcl/source/gdi/impbmp.cxx
+++ b/vcl/source/gdi/impbmp.cxx
@@ -114,13 +114,8 @@ bool ImpBitmap::ImplReplace( const Color& rSearchColor, const Color& rReplaceCol
return mpSalBitmap->Replace( rSearchColor, rReplaceColor, nTol );
}
-bool ImpBitmap::ImplConvert( BmpConversion eConversion )
+bool ImpBitmap::ConvertToGreyscale()
{
- // avoid large chunk of obsolete and hopefully rarely used conversions.
- if (eConversion != BmpConversion::N8BitGreys)
- return false;
-
- // frequently used conversion for creating alpha masks
return mpSalBitmap->ConvertToGreyscale();
}