From 0b73b1f6e3358dc484c4e684b3c8055da7071eb5 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Fri, 22 Feb 2013 16:53:39 +0000 Subject: perf: avoid scaling images to the same size at some cost. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Icae65a8bf48f76801c536607055be066be0bd49f (cherry picked from commit cb8fcf5a169f030827b1150c50b6ed284717e485) Signed-off-by: Fridrich Štrba --- vcl/source/gdi/bitmapex.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(), -- cgit v1.2.3