summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2006-11-14 14:27:27 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2006-11-14 14:27:27 +0000
commit401c1a6d6b4fd25dbb8843261a673a8254acff06 (patch)
tree857054ee3aa8a48217bcb4cdc62beffecbc6dbe0 /vcl/win
parent82f7256fe222c6f5edeee14ef0a0191fc60ba123 (diff)
INTEGRATION: CWS aw024 (1.10.32); FILE MERGED
2006/09/22 03:43:42 aw 1.10.32.3: RESYNC: (1.11-1.12); FILE MERGED 2006/08/03 17:30:35 aw 1.10.32.2: RESYNC: (1.10-1.11); FILE MERGED 2006/07/20 16:05:53 thb 1.10.32.1: #i66849# Added drawAlphaBitmap & drawAlphaRect; fixed brush state modification to correctly mirror brush usage
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/source/gdi/salgdi2.cxx46
1 files changed, 44 insertions, 2 deletions
diff --git a/vcl/win/source/gdi/salgdi2.cxx b/vcl/win/source/gdi/salgdi2.cxx
index 717bf83b3c0d..8cf2a9d414cb 100644
--- a/vcl/win/source/gdi/salgdi2.cxx
+++ b/vcl/win/source/gdi/salgdi2.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: salgdi2.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: obo $ $Date: 2006-09-17 12:45:05 $
+ * last change: $Author: ihi $ $Date: 2006-11-14 15:27:27 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -586,6 +586,48 @@ void WinSalGraphics::drawBitmap( const SalTwoRect* pPosAry,
// -----------------------------------------------------------------------
+bool WinSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
+ const SalBitmap& rSrcBitmap,
+ const SalBitmap& rAlphaBmp )
+{
+ (void)rTR; (void)rSrcBitmap; (void)rAlphaBmp;
+
+ // TODO(P3): implement alpha bmp blits. Catch: Windows only
+ // handles 32bpp, premultiplied bitmaps
+ return false;
+}
+
+// -----------------------------------------------------------------------
+
+bool WinSalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
+ long nHeight, sal_uInt8 nTransparency )
+{
+ if( mbPen || !mbBrush || mbXORMode )
+ return false; // can only perform solid fills without XOR.
+
+ HDC hMemDC = ImplGetCachedDC( CACHED_HDC_1, 0 );
+ SetPixel( hMemDC, (int)0, (int)0, mnBrushColor );
+
+ BLENDFUNCTION aFunc = {
+ AC_SRC_OVER,
+ 0,
+ 255 - 255L*nTransparency/100,
+ 0
+ };
+
+ // hMemDC contains a 1x1 bitmap of the right color - stretch-blit
+ // that to dest hdc
+ bool bRet = AlphaBlend( mhDC, nX, nY, nWidth, nHeight,
+ hMemDC, 0,0,1,1,
+ aFunc ) == TRUE;
+
+ ImplReleaseCachedDC( CACHED_HDC_1 );
+
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
void WinSalGraphics::drawMask( const SalTwoRect* pPosAry,
const SalBitmap& rSSalBitmap,
SalColor nMaskColor )