summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-02-22 16:53:39 +0000
committerMichael Meeks <michael.meeks@suse.com>2013-02-25 09:44:19 +0000
commitcb8fcf5a169f030827b1150c50b6ed284717e485 (patch)
tree2eb9af5e4731eea04b84b3bcf65aef91ef367833 /vcl
parent50822d440519bcc95fc4e5d45844c1328e72d6b2 (diff)
perf: avoid scaling images to the same size at some cost.
Change-Id: Icae65a8bf48f76801c536607055be066be0bd49f
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/bitmapex.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index e7a41936707d..db74bde538e5 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -368,7 +368,9 @@ sal_Bool BitmapEx::Scale( const Size& rNewSize, sal_uLong nScaleFlag )
{
sal_Bool bRet;
- if( aBitmapSize.Width() && aBitmapSize.Height() )
+ if( aBitmapSize.Width() && aBitmapSize.Height() &&
+ ( rNewSize.Width() != aBitmapSize.Width() ||
+ rNewSize.Height() != aBitmapSize.Height() ) )
{
bRet = Scale( (double) rNewSize.Width() / aBitmapSize.Width(),
(double) rNewSize.Height() / aBitmapSize.Height(),