summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2008-02-27 09:33:38 +0000
committerOliver Bolte <obo@openoffice.org>2008-02-27 09:33:38 +0000
commite764ca84b9139a1b541ccb45de903607d26218ee (patch)
tree5dbf0596badbad75f22ce1367bf3c74353fe6a57 /vcl/unx
parent4aaf3f0067290beb12d9fb5f7b1cea3406cf0f5d (diff)
INTEGRATION: CWS vclshowstop15_DEV300 (1.41.144.1.6); FILE MERGED
2008/02/25 16:25:32 pl 1.41.144.1.6.1: #i86327# fix an Xerror in drawAlphaRect, handle xerror in ImplCreate more specific
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/source/gdi/salgdi2.cxx24
1 files changed, 18 insertions, 6 deletions
diff --git a/vcl/unx/source/gdi/salgdi2.cxx b/vcl/unx/source/gdi/salgdi2.cxx
index 57213ba32beb..14ae3b34312f 100644
--- a/vcl/unx/source/gdi/salgdi2.cxx
+++ b/vcl/unx/source/gdi/salgdi2.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: salgdi2.cxx,v $
*
- * $Revision: 1.43 $
+ * $Revision: 1.44 $
*
- * last change: $Author: rt $ $Date: 2008-02-19 15:57:23 $
+ * last change: $Author: obo $ $Date: 2008-02-27 10:33:38 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -699,10 +699,13 @@ void X11SalGraphics::drawBitmap( const SalTwoRect* pPosAry,
// decide if alpha masking or transparency masking is needed
BitmapBuffer* pAlphaBuffer = const_cast<SalBitmap&>(rMaskBitmap).AcquireBuffer( TRUE );
- int nMaskFormat = pAlphaBuffer->mnFormat;
- const_cast<SalBitmap&>(rMaskBitmap).ReleaseBuffer( pAlphaBuffer, TRUE );
- if( nMaskFormat == BMP_FORMAT_8BIT_PAL )
- drawAlphaBitmap( *pPosAry, rSrcBitmap, rMaskBitmap );
+ if( pAlphaBuffer )
+ {
+ int nMaskFormat = pAlphaBuffer->mnFormat;
+ const_cast<SalBitmap&>(rMaskBitmap).ReleaseBuffer( pAlphaBuffer, TRUE );
+ if( nMaskFormat == BMP_FORMAT_8BIT_PAL )
+ drawAlphaBitmap( *pPosAry, rSrcBitmap, rMaskBitmap );
+ }
drawMaskedBitmap( pPosAry, rSrcBitmap, rMaskBitmap );
}
@@ -949,9 +952,15 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
bool X11SalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
long nHeight, sal_uInt8 nTransparency )
{
+ if( ! m_pFrame && ! m_pVDev )
+ return false;
+
if( bPenGC_ || !bBrushGC_ || bXORMode_ )
return false; // can only perform solid fills without XOR.
+ if( m_pVDev && m_pVDev->GetDepth() < 8 )
+ return false;
+
XRenderPeer& rPeer = XRenderPeer::GetInstance();
if( rPeer.GetVersion() < 0x02 )
return false;
@@ -984,6 +993,9 @@ bool X11SalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
nX, nY,
nWidth, nHeight );
+ // cleanup
+ rPeer.FreePicture( aDstPic );
+
return true;
}