summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@suse.com>2013-06-14 13:26:43 +0200
committerPetr Mladek <pmladek@suse.cz>2013-06-14 16:18:55 +0200
commit891805e02f6a8dc8a8bb2dc3a7b854601c956a7d (patch)
treedd3cdf4c09c740ba45b1aaba6a0856096ba4a6f9
parentd719c3641e26de3e744f81a1a095c515b58c64ba (diff)
Fixup alpha bitmap generation for Windows.
This improves upon d6f58fd25eeca84a94528409a05b80aa5172b8b8 by using the BitmapEx ctor instead of manual initialisation. Several EMF+ files would otherwise show up horribly mangled on Windows. Change-Id: I1808cb45818f3f0118653164c83c49d6134b9324
-rw-r--r--vcl/source/gdi/bitmapex.cxx34
1 files changed, 5 insertions, 29 deletions
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 59fc06a503ed..8b22b94e3490 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -868,9 +868,6 @@ bool BitmapEx::Create( const ::com::sun::star::uno::Reference<
::com::sun::star::rendering::XBitmapCanvas > &xBitmapCanvas,
const Size &rSize )
{
- SetEmpty();
- Size aSize( rSize );
-
uno::Reference< beans::XFastPropertySet > xFastPropertySet( xBitmapCanvas, uno::UNO_QUERY );
if( xFastPropertySet.get() )
{
@@ -890,38 +887,17 @@ bool BitmapEx::Create( const ::com::sun::star::uno::Reference<
pSalBmp = ImplGetSVData()->mpDefInst->CreateSalBitmap();
pSalMask = ImplGetSVData()->mpDefInst->CreateSalBitmap();
- if( pSalBmp->Create( xBitmapCanvas, aSize ) )
+ Size aLocalSize(rSize);
+ if( pSalBmp->Create( xBitmapCanvas, aLocalSize ) )
{
-#ifdef CLAMP_BITDEPTH_PARANOIA
- // did we get alpha mixed up in the bitmap itself
- // eg. Cairo Canvas ... yes performance of this is awful.
- if( pSalBmp->GetBitCount() > 24 )
- {
- // Format convert the pixels with generic code
- Bitmap aSrcPixels( pSalBmp );
- aBitmap = Bitmap( rSize, 24 );
- BitmapReadAccess aSrcRead( aSrcPixels );
- BitmapWriteAccess aDestWrite( aBitmap );
- aDestWrite.CopyBuffer( aSrcRead );
- }
- else
-#endif
- aBitmap = Bitmap( pSalBmp );
-
- aBitmapSize = rSize;
- if ( pSalMask->Create( xBitmapCanvas, aSize, true ) )
+ if ( pSalMask->Create( xBitmapCanvas, aLocalSize, true ) )
{
- aMask = Bitmap( pSalMask );
- bAlpha = sal_True;
- aBitmapSize = rSize;
- eTransparent = !aMask ? TRANSPARENT_NONE : TRANSPARENT_BITMAP;
-
+ *this = BitmapEx(Bitmap(pSalBmp), Bitmap(pSalMask) );
return true;
}
else
{
- bAlpha = sal_False;
- eTransparent = TRANSPARENT_NONE;
+ *this = BitmapEx(Bitmap(pSalBmp));
return true;
}
}