summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2003-11-24 16:34:15 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2003-11-24 16:34:15 +0000
commit5d3e08767d03b0c4ce7eb31440c8de3a69ad670e (patch)
tree07614da797bf91b9d767696b26d4c5670f7300a0 /vcl
parentee9b8719787f1ef6c627b4a1219fca6805c7aba1 (diff)
INTEGRATION: CWS aw003 (1.9.54); FILE MERGED
2003/11/05 09:10:55 aw 1.9.54.8: resolved one more conflict 2003/11/04 17:34:16 aw 1.9.54.7: RESYNC: (1.9-1.10); FILE MERGED 2003/08/14 11:55:57 thb 1.9.54.6: #110958# Alpha is now transitive for virdev-virdev copies; now correctly forwarding line/fill color switchings to alpha vdev 2003/07/28 18:03:56 thb 1.9.54.5: #110958# Removed several set* inlines, to intercept them for alpha vdev painting 2003/07/28 16:32:17 thb 1.9.54.4: #110958# Changed constructor 2003/07/28 14:51:20 thb 1.9.54.3: #110958# Initialize flag 2003/07/28 14:33:04 thb 1.9.54.2: #110958# Now using a separate constructor, to remain compatible 2003/07/28 14:00:01 thb 1.9.54.1: #110958# Added alpha channel for virtual device painting. That means, alpha information is retained during painting to a vdev
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/virdev.cxx61
1 files changed, 57 insertions, 4 deletions
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index d677c6e4524e..377ea4ae77d7 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: virdev.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: kz $ $Date: 2003-11-18 14:35:02 $
+ * last change: $Author: rt $ $Date: 2003-11-24 17:34:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -236,6 +236,8 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev,
mnOutWidth = nDX;
mnOutHeight = nDY;
mbScreenComp = TRUE;
+ mbScreenComp = FALSE;
+ mnAlphaDepth = -1;
if( mnBitCount < 8 )
SetAntialiasing( ANTIALIASING_DISABLE_TEXT );
@@ -291,6 +293,19 @@ VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, USHORT nBitCount )
// -----------------------------------------------------------------------
+VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, USHORT nBitCount, USHORT nAlphaBitCount )
+ : mpVirDev( NULL )
+{
+ DBG_TRACE1( "VirtualDevice::VirtualDevice( %hu )", nBitCount );
+
+ ImplInitVirDev( &rCompDev, 1, 1, nBitCount );
+
+ // #110958# Enable alpha channel
+ mnAlphaDepth = nAlphaBitCount;
+}
+
+// -----------------------------------------------------------------------
+
VirtualDevice::~VirtualDevice()
{
DBG_TRACE( "VirtualDevice::~VirtualDevice()" );
@@ -339,9 +354,9 @@ VirtualDevice::~VirtualDevice()
// -----------------------------------------------------------------------
-BOOL VirtualDevice::SetOutputSizePixel( const Size& rNewSize, BOOL bErase )
+BOOL VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, BOOL bErase )
{
- DBG_TRACE3( "VirtualDevice::SetOutputSizePixel( %ld, %ld, %d )", rNewSize.Width(), rNewSize.Height(), (int)bErase );
+ DBG_TRACE3( "VirtualDevice::ImplSetOutputSizePixel( %ld, %ld, %d )", rNewSize.Width(), rNewSize.Height(), (int)bErase );
if ( !mpVirDev )
return FALSE;
@@ -462,6 +477,43 @@ BOOL VirtualDevice::SetOutputSizePixel( const Size& rNewSize, BOOL bErase )
// -----------------------------------------------------------------------
+BOOL VirtualDevice::SetOutputSizePixel( const Size& rNewSize, BOOL bErase )
+{
+ if( ImplSetOutputSizePixel(rNewSize, bErase) )
+ {
+ if( mnAlphaDepth != -1 )
+ {
+ // #110958# Setup alpha bitmap
+ if(mpAlphaVDev && mpAlphaVDev->GetOutputSizePixel() != rNewSize)
+ {
+ delete mpAlphaVDev;
+ mpAlphaVDev = 0L;
+ }
+
+ if( !mpAlphaVDev )
+ {
+ mpAlphaVDev = new VirtualDevice( *this, mnAlphaDepth );
+ mpAlphaVDev->ImplSetOutputSizePixel(rNewSize, bErase);
+ }
+
+ // TODO: copy full outdev state to new one, here. Also needed in outdev2.cxx:DrawOutDev
+ if( GetLineColor() != Color( COL_TRANSPARENT ) )
+ mpAlphaVDev->SetLineColor( COL_BLACK );
+
+ if( GetFillColor() != Color( COL_TRANSPARENT ) )
+ mpAlphaVDev->SetFillColor( COL_BLACK );
+
+ mpAlphaVDev->SetMapMode( GetMapMode() );
+ }
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
void VirtualDevice::SetReferenceDevice( RefDevMode eRefDevMode )
{
switch( eRefDevMode )
@@ -543,3 +595,4 @@ void VirtualDevice::SetReferenceDevice( RefDevMode eRefDevMode )
}
// -----------------------------------------------------------------------
+// eof