diff options
author | Louis-Francis Ratté-Boulianne <lfrb@collabora.com> | 2014-11-06 14:17:24 -0500 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-11-10 07:59:11 +0100 |
commit | 6282509c2fe81b7218af955639f01fc06ccd33cd (patch) | |
tree | 6d3f4cfb99672ed57a6ed172d1b3c5a89bf927cf /vcl/source/gdi/bitmap3.cxx | |
parent | b4daf82f84dc142c7b8ef14fc4110afae0da79e7 (diff) |
vcl: Add a way to resize an image using the GPU
Change-Id: I949e13277fa176d64d7fba9a57e3ca6f3f0dd732
Diffstat (limited to 'vcl/source/gdi/bitmap3.cxx')
-rw-r--r-- | vcl/source/gdi/bitmap3.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index 657c3ac2d863..335d625b29ab 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -874,10 +874,23 @@ bool Bitmap::Scale( const double& rScaleX, const double& rScaleY, sal_uInt32 nSc bRetval = true; } - if( mpImpBmp && mpImpBmp->ImplScale( rScaleX, rScaleY, nScaleFlag ) ) + if( mpImpBmp ) { // implementation specific scaling - return true; + ImpBitmap* pImpBmp = new ImpBitmap; + + if( pImpBmp->ImplCreate( *mpImpBmp ) && pImpBmp->ImplScale( rScaleX, rScaleY, nScaleFlag ) ) + { + ImplSetImpBitmap( pImpBmp ); + SAL_INFO( "vcl.opengl", "Ref count: " << mpImpBmp->ImplGetRefCount() ); + maPrefMapMode = MapMode( MAP_PIXEL ); + maPrefSize = pImpBmp->ImplGetSize(); + return true; + } + else + { + delete pImpBmp; + } } //fdo#33455 |