diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/source/gdi/salgdi2.cxx | 26 | ||||
-rw-r--r-- | vcl/win/source/gdi/salgdi2.cxx | 27 |
2 files changed, 40 insertions, 13 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 ); } diff --git a/vcl/win/source/gdi/salgdi2.cxx b/vcl/win/source/gdi/salgdi2.cxx index cd5bf65c3ded..1afc9213982b 100644 --- a/vcl/win/source/gdi/salgdi2.cxx +++ b/vcl/win/source/gdi/salgdi2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: salgdi2.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: ssa $ $Date: 2002-08-29 15:40:56 $ + * last change: $Author: thb $ $Date: 2002-11-18 13:50:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -549,9 +549,26 @@ void SalGraphics::DrawBitmap( const SalTwoRect* pPosAry, else ImplDrawBitmap( hMaskDC, &aPosAry, rTransparentBitmap, FALSE, SRCCOPY ); - BitBlt( hMemDC, 0, 0, nDstWidth, nDstHeight, hMaskDC, 0, 0, SRCAND ); - ImplDrawBitmap( hMaskDC, &aPosAry, rSalBitmap, FALSE, SRCERASE ); - BitBlt( hMemDC, 0, 0, nDstWidth, nDstHeight, hMaskDC, 0, 0, SRCPAINT ); + // now MemDC contains background, MaskDC the transparency mask + + // #105055# Respect XOR mode + if( maGraphicsData.mbXORMode ) + { + ImplDrawBitmap( hMaskDC, &aPosAry, rSalBitmap, FALSE, SRCERASE ); + // now MaskDC contains the bitmap area with black background + BitBlt( hMemDC, 0, 0, nDstWidth, nDstHeight, hMaskDC, 0, 0, SRCINVERT ); + // now MemDC contains background XORed bitmap area ontop + } + else + { + BitBlt( hMemDC, 0, 0, nDstWidth, nDstHeight, hMaskDC, 0, 0, SRCAND ); + // now MemDC contains background with masked-out bitmap area + ImplDrawBitmap( hMaskDC, &aPosAry, rSalBitmap, FALSE, SRCERASE ); + // now MaskDC contains the bitmap area with black background + BitBlt( hMemDC, 0, 0, nDstWidth, nDstHeight, hMaskDC, 0, 0, SRCPAINT ); + // now MemDC contains background and bitmap merged together + } + // copy to output DC BitBlt( hDC, nDstX, nDstY, nDstWidth, nDstHeight, hMemDC, 0, 0, SRCCOPY ); ImplReleaseCachedDC( CACHED_HDC_1 ); |