summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/bitmap3.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2012-12-05 16:17:41 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-05-10 17:04:28 +0100
commitfb6f2e1109abdd09e80dbcd6660a9530fc06ff0f (patch)
tree9b099e9edca5ee8993a86cf5989b34c46d76e7cd /vcl/source/gdi/bitmap3.cxx
parentf2b92a9ab5d1b0c7d3d01db675268b0e1925cdc6 (diff)
Resolves: #i121407# Gallery reorganizations...
and additions of new themes (cherry picked from commit 8ccf0e00b5c67f17427d041321baaa5ade488e7c) Conflicts: extras/prj/build.lst extras/source/gallery/bullets/makefile.mk extras/source/gallery/gallery_system/sg2.sdg extras/source/gallery/gallery_system/sg2.sdv extras/source/gallery/gallery_system/sg2.thm extras/util/target.pmk scp2/source/ooo/directory_ooo.scp scp2/source/ooo/file_extra_ooo.scp svx/inc/galtheme.hrc svx/source/gallery2/gallery1.cxx svx/source/gallery2/galobj.cxx svx/source/gallery2/galtheme.src vcl/inc/vcl/alpha.hxx vcl/inc/vcl/bitmap.hxx vcl/inc/vcl/bitmapex.hxx vcl/source/gdi/alpha.cxx vcl/source/gdi/bitmap.cxx vcl/source/gdi/bitmap3.cxx vcl/source/gdi/bitmapex.cxx (cherry picked from commit 8012fae6cedcf325130d70adf0a486e8918f452f) Conflicts: vcl/source/gdi/bitmap3.cxx Change-Id: If4b2397b889f914487f2135679250c175181e1df
Diffstat (limited to 'vcl/source/gdi/bitmap3.cxx')
-rw-r--r--vcl/source/gdi/bitmap3.cxx112
1 files changed, 59 insertions, 53 deletions
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx
index f647cdbe93a6..6816bb9aa49f 100644
--- a/vcl/source/gdi/bitmap3.cxx
+++ b/vcl/source/gdi/bitmap3.cxx
@@ -853,81 +853,87 @@ sal_Bool Bitmap::ImplConvertGhosted()
return bRet;
}
-sal_Bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uLong nScaleFlag )
+sal_Bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nScaleFlag )
{
- if(basegfx::fTools::equalZero(rScaleX) && basegfx::fTools::equalZero(rScaleY))
+ if(basegfx::fTools::equalZero(rScaleX) || basegfx::fTools::equalZero(rScaleY))
{
// no scale
return true;
}
- else
+
+ if(basegfx::fTools::equal(rScaleX, 1.0) && basegfx::fTools::equal(rScaleY, 1.0))
+ {
+ // no scale
+ return true;
+ }
+
+ switch(nScaleFlag)
{
- switch(nScaleFlag)
+ case BMP_SCALE_NONE :
{
- case BMP_SCALE_NONE :
- {
- return false;
- break;
- }
- case BMP_SCALE_FAST :
+ return false;
+ break;
+ }
+ case BMP_SCALE_FAST :
+ {
+ return ImplScaleFast( rScaleX, rScaleY );
+ break;
+ }
+ case BMP_SCALE_INTERPOLATE :
+ {
+ return ImplScaleInterpolate( rScaleX, rScaleY );
+ break;
+ }
+ case BMP_SCALE_SUPER :
+ {
+ if(GetSizePixel().Width() < 2 || GetSizePixel().Height() < 2)
{
+ // fallback to ImplScaleFast
return ImplScaleFast( rScaleX, rScaleY );
- break;
}
- case BMP_SCALE_INTERPOLATE :
+ else
{
- return ImplScaleInterpolate( rScaleX, rScaleY );
- break;
+ // #i121233# use method from symphony
+ return ImplScaleSuper( rScaleX, rScaleY );
}
- case BMP_SCALE_SUPER :
- {
- if(GetSizePixel().Width() < 2 || GetSizePixel().Height() < 2)
- {
- // fallback to ImplScaleFast
- return ImplScaleFast( rScaleX, rScaleY );
- }
- else
- {
- // #i121233# use method from symphony
- return ImplScaleSuper( rScaleX, rScaleY );
- }
- break;
- }
- case BMP_SCALE_LANCZOS :
- {
- const Lanczos3Kernel kernel;
+ break;
+ }
+ case BMP_SCALE_LANCZOS :
+ {
+ const Lanczos3Kernel kernel;
- return ImplScaleConvolution( rScaleX, rScaleY, kernel );
- break;
- }
- case BMP_SCALE_BICUBIC :
- {
- const BicubicKernel kernel;
+ return ImplScaleConvolution( rScaleX, rScaleY, kernel );
+ break;
+ }
+ case BMP_SCALE_BICUBIC :
+ {
+ const BicubicKernel kernel;
- return ImplScaleConvolution( rScaleX, rScaleY, kernel );
- break;
- }
- case BMP_SCALE_BILINEAR :
- {
- const BilinearKernel kernel;
+ return ImplScaleConvolution( rScaleX, rScaleY, kernel );
+ break;
+ }
+ case BMP_SCALE_BILINEAR :
+ {
+ const BilinearKernel kernel;
- return ImplScaleConvolution( rScaleX, rScaleY, kernel );
- break;
- }
- case BMP_SCALE_BOX :
- {
- const BoxKernel kernel;
+ return ImplScaleConvolution( rScaleX, rScaleY, kernel );
+ break;
+ }
+ case BMP_SCALE_BOX :
+ {
+ const BoxKernel kernel;
- return ImplScaleConvolution( rScaleX, rScaleY, kernel );
- break;
- }
+ return ImplScaleConvolution( rScaleX, rScaleY, kernel );
+ break;
}
}
return false;
}
-sal_Bool Bitmap::Scale( const Size& rNewSize, sal_uLong nScaleFlag )
+// ------------------------------------------------------------------------
+
+sal_Bool Bitmap::Scale( const Size& rNewSize, sal_uInt32 nScaleFlag )
{
const Size aSize( GetSizePixel() );
bool bRet;