summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorThorsten Behrens <thb@openoffice.org>2002-11-18 12:50:32 +0000
committerThorsten Behrens <thb@openoffice.org>2002-11-18 12:50:32 +0000
commit15e932d171734aa98b2c312945ee98cdc8cc43de (patch)
tree83edab5ee900120c4e53a11108a85679bcc95b3d /vcl/unx
parentd648d5a79002955f6ee0ebfb2c33d068945f8fac (diff)
#105055# Respect paintmode XOR for transparent bitmaps
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/source/gdi/salgdi2.cxx26
1 files changed, 18 insertions, 8 deletions
diff --git a/vcl/unx/source/gdi/salgdi2.cxx b/vcl/unx/source/gdi/salgdi2.cxx
index 7c77d31d5e9a..c3693b3a3ab3 100644
--- a/vcl/unx/source/gdi/salgdi2.cxx
+++ b/vcl/unx/source/gdi/salgdi2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: salgdi2.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: pl $ $Date: 2002-09-18 09:13:08 $
+ * last change: $Author: thb $ $Date: 2002-11-18 13:48:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -856,16 +856,20 @@ void SalGraphics::DrawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBi
DBG_TESTTRANS( aFG );
- // mask out background in pixmap #2 (nontransparent areas 0)
- aValues.function = GXand, aValues.foreground = 0xffffffff, aValues.background = 0x00000000;
- XChangeGC( pXDisp, aTmpGC, nValues, &aValues );
+ // #105055# For XOR mode, keep background behind bitmap intact
+ if( !maGraphicsData.bXORMode_ )
+ {
+ // mask out background in pixmap #2 (nontransparent areas 0)
+ aValues.function = GXand, aValues.foreground = 0xffffffff, aValues.background = 0x00000000;
+ XChangeGC( pXDisp, aTmpGC, nValues, &aValues );
#ifdef _USE_PRINT_EXTENSION_
- rTransBitmap.ImplDraw( pSalDisp, aBG, 1, aTmpRect, aTmpGC );
+ rTransBitmap.ImplDraw( pSalDisp, aBG, 1, aTmpRect, aTmpGC );
#else
- rTransBitmap.ImplDraw( aBG, 1, aTmpRect, aTmpGC );
+ rTransBitmap.ImplDraw( aBG, 1, aTmpRect, aTmpGC );
#endif
- DBG_TESTTRANS( aBG );
+ DBG_TESTTRANS( aBG );
+ }
// merge pixmap #1 and pixmap #2 in pixmap #2
aValues.function = GXxor, aValues.foreground = 0xffffffff, aValues.background = 0x00000000;
@@ -876,6 +880,10 @@ void SalGraphics::DrawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBi
0, 0 );
DBG_TESTTRANS( aBG );
+ // #105055# Disable XOR temporarily
+ BOOL bOldXORMode( maGraphicsData.bXORMode_ );
+ maGraphicsData.bXORMode_ = FALSE;
+
// copy pixmap #2 (result) to background
XCopyArea( pXDisp, aBG, aDrawable, maGraphicsData.GetCopyGC(),
0, 0,
@@ -883,6 +891,8 @@ void SalGraphics::DrawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSalBi
pPosAry->mnDestX, pPosAry->mnDestY );
DBG_TESTTRANS( aBG );
+ maGraphicsData.bXORMode_ = bOldXORMode;
+
XFreeGC( pXDisp, aTmpGC );
XFlush( pXDisp );
}