diff options
author | Michael Meeks <michael.meeks@suse.com> | 2013-02-22 16:53:39 +0000 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2013-02-25 11:35:20 +0100 |
commit | 0b73b1f6e3358dc484c4e684b3c8055da7071eb5 (patch) | |
tree | cafb1892fd457eb85f6a502b11fdfabf5cce0d9c /vcl | |
parent | 0f203c99fac3778500dbf664e34ac4cd2d6455de (diff) |
perf: avoid scaling images to the same size at some cost.
Change-Id: Icae65a8bf48f76801c536607055be066be0bd49f
(cherry picked from commit cb8fcf5a169f030827b1150c50b6ed284717e485)
Signed-off-by: Fridrich Štrba <fridrich.strba@bluewin.ch>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/bitmapex.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index f6994320058a..45fe0aa925ec 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(), |