diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2003-11-24 16:32:23 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2003-11-24 16:32:23 +0000 |
commit | abc73d32a2f73764a6f20ff826cee8b1a709cdf8 (patch) | |
tree | c4f836a3ed1cb9d05fbc34f8341e1cddff080d0d | |
parent | cce301dabd992b5df48ce589b86def65104c070a (diff) |
INTEGRATION: CWS aw003 (1.23.58); FILE MERGED
2003/10/07 19:10:52 aw 1.23.58.6: RESYNC: (1.23-1.24); FILE MERGED
2003/09/02 16:47:27 thb 1.23.58.5: #110958# Added alpha channel query methods
2003/08/14 11:55:55 thb 1.23.58.4: #110958# Alpha is now transitive for virdev-virdev copies; now correctly forwarding line/fill color switchings to alpha vdev
2003/07/28 18:07:59 thb 1.23.58.3: #110958# Removed several set* inlines, to intercept them for alpha vdev painting
2003/07/28 18:03:55 thb 1.23.58.2: #110958# Removed several set* inlines, to intercept them for alpha vdev painting
2003/07/28 13:59:58 thb 1.23.58.1: #110958# Added alpha channel for virtual device painting. That means, alpha information is retained during painting to a vdev
-rw-r--r-- | vcl/source/gdi/outdev.cxx | 132 |
1 files changed, 130 insertions, 2 deletions
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx index 7dcfcdc3dd2e..bb04513d7743 100644 --- a/vcl/source/gdi/outdev.cxx +++ b/vcl/source/gdi/outdev.cxx @@ -2,9 +2,9 @@ * * $RCSfile: outdev.cxx,v $ * - * $Revision: 1.24 $ + * $Revision: 1.25 $ * - * last change: $Author: kz $ $Date: 2003-08-25 13:53:32 $ + * last change: $Author: rt $ $Date: 2003-11-24 17:32:23 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -418,6 +418,7 @@ OutputDevice::OutputDevice() : mpOutDevData = NULL; mp3DContext = NULL; mpPDFWriter = NULL; + mpAlphaVDev = NULL; mnOutOffX = 0; mnOutOffY = 0; mnOutWidth = 0; @@ -525,6 +526,8 @@ OutputDevice::~OutputDevice() mpFontList->Clear(); delete mpFontList; } + + delete mpAlphaVDev; } // ----------------------------------------------------------------------- @@ -542,6 +545,9 @@ void OutputDevice::EnableRTL( BOOL bEnable ) if( ImplGetGraphics() ) mpGraphics->SetLayout( mbEnableRTL ? SAL_LAYOUT_BIDI_RTL : 0 ); } + + if( mpAlphaVDev ) + mpAlphaVDev->EnableRTL( bEnable ); } BOOL OutputDevice::ImplHasMirroredGraphics() @@ -1033,6 +1039,9 @@ void OutputDevice::SetClipRegion() mpMetaFile->AddAction( new MetaClipRegionAction( Region(), FALSE ) ); ImplSetClipRegion( NULL ); + + if( mpAlphaVDev ) + mpAlphaVDev->SetClipRegion(); } // ----------------------------------------------------------------------- @@ -1053,6 +1062,9 @@ void OutputDevice::SetClipRegion( const Region& rRegion ) Region aRegion = LogicToPixel( rRegion ); ImplSetClipRegion( &aRegion ); } + + if( mpAlphaVDev ) + mpAlphaVDev->SetClipRegion( rRegion ); } // ----------------------------------------------------------------------- @@ -1103,6 +1115,9 @@ void OutputDevice::MoveClipRegion( long nHorzMove, long nVertMove ) ImplLogicHeightToDevicePixel( nVertMove ) ); mbInitClipRegion = TRUE; } + + if( mpAlphaVDev ) + mpAlphaVDev->MoveClipRegion( nHorzMove, nVertMove ); } // ----------------------------------------------------------------------- @@ -1119,6 +1134,9 @@ void OutputDevice::IntersectClipRegion( const Rectangle& rRect ) maRegion.Intersect( aRect ); mbClipRegion = TRUE; mbInitClipRegion = TRUE; + + if( mpAlphaVDev ) + mpAlphaVDev->IntersectClipRegion( rRect ); } // ----------------------------------------------------------------------- @@ -1141,6 +1159,9 @@ void OutputDevice::IntersectClipRegion( const Region& rRegion ) mbClipRegion = TRUE; mbInitClipRegion = TRUE; } + + if( mpAlphaVDev ) + mpAlphaVDev->IntersectClipRegion( rRegion ); } // ----------------------------------------------------------------------- @@ -1151,6 +1172,9 @@ void OutputDevice::SetDrawMode( ULONG nDrawMode ) DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice ); mnDrawMode = nDrawMode; + + if( mpAlphaVDev ) + mpAlphaVDev->SetDrawMode( nDrawMode ); } // ----------------------------------------------------------------------- @@ -1177,6 +1201,9 @@ void OutputDevice::SetRasterOp( RasterOp eRasterOp ) pGraphics->SetRasterOp( eRasterOp ); #endif } + + if( mpAlphaVDev ) + mpAlphaVDev->SetRasterOp( eRasterOp ); } // ----------------------------------------------------------------------- @@ -1195,6 +1222,9 @@ void OutputDevice::SetLineColor() mbLineColor = FALSE; maLineColor = Color( COL_TRANSPARENT ); } + + if( mpAlphaVDev ) + mpAlphaVDev->SetLineColor(); } // ----------------------------------------------------------------------- @@ -1260,6 +1290,9 @@ void OutputDevice::SetLineColor( const Color& rColor ) maLineColor = aColor; } } + + if( mpAlphaVDev ) + mpAlphaVDev->SetLineColor( COL_BLACK ); } // ----------------------------------------------------------------------- @@ -1278,6 +1311,9 @@ void OutputDevice::SetFillColor() mbFillColor = FALSE; maFillColor = Color( COL_TRANSPARENT ); } + + if( mpAlphaVDev ) + mpAlphaVDev->SetFillColor(); } // ----------------------------------------------------------------------- @@ -1347,6 +1383,9 @@ void OutputDevice::SetFillColor( const Color& rColor ) maFillColor = aColor; } } + + if( mpAlphaVDev ) + mpAlphaVDev->SetFillColor( COL_BLACK ); } // ----------------------------------------------------------------------- @@ -1358,6 +1397,9 @@ void OutputDevice::SetBackground() maBackground = Wallpaper(); mbBackground = FALSE; + + if( mpAlphaVDev ) + mpAlphaVDev->SetBackground(); } // ----------------------------------------------------------------------- @@ -1373,6 +1415,9 @@ void OutputDevice::SetBackground( const Wallpaper& rBackground ) mbBackground = FALSE; else mbBackground = TRUE; + + if( mpAlphaVDev ) + mpAlphaVDev->SetBackground( rBackground ); } // ----------------------------------------------------------------------- @@ -1387,6 +1432,9 @@ void OutputDevice::SetRefPoint() mbRefPoint = FALSE; maRefPoint.X() = maRefPoint.Y() = 0L; + + if( mpAlphaVDev ) + mpAlphaVDev->SetRefPoint(); } // ----------------------------------------------------------------------- @@ -1401,6 +1449,9 @@ void OutputDevice::SetRefPoint( const Point& rRefPoint ) mbRefPoint = TRUE; maRefPoint = rRefPoint; + + if( mpAlphaVDev ) + mpAlphaVDev->SetRefPoint( rRefPoint ); } // ----------------------------------------------------------------------- @@ -1435,6 +1486,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt ) Point aEndPt = ImplLogicToDevicePixel( rEndPt ); mpGraphics->DrawLine( aStartPt.X(), aStartPt.Y(), aEndPt.X(), aEndPt.Y(), this ); + #else ImplServerGraphics* pGraphics = ImplGetServerGraphics(); if ( pGraphics ) @@ -1445,6 +1497,9 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt ) ImplLogicToDevicePixel( rEndPt ) ); } #endif + + if( mpAlphaVDev ) + mpAlphaVDev->DrawLine( rStartPt, rEndPt ); } // ----------------------------------------------------------------------- @@ -1579,6 +1634,9 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt, } #endif + + if( mpAlphaVDev ) + mpAlphaVDev->DrawLine( rStartPt, rEndPt, rLineInfo ); } // ----------------------------------------------------------------------- @@ -1629,6 +1687,9 @@ void OutputDevice::DrawRect( const Rectangle& rRect ) pGraphics->DrawRect( aRect ); } #endif + + if( mpAlphaVDev ) + mpAlphaVDev->DrawRect( rRect ); } // ----------------------------------------------------------------------- @@ -1697,6 +1758,9 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly ) pGraphics->DrawPolyLine( aPoly ); } #endif + + if( mpAlphaVDev ) + mpAlphaVDev->DrawPolyLine( rPoly ); } // ----------------------------------------------------------------------- @@ -1818,6 +1882,9 @@ void OutputDevice::DrawPolyLine( const Polygon& rPoly, const LineInfo& rLineInfo } } #endif + + if( mpAlphaVDev ) + mpAlphaVDev->DrawPolyLine( rPoly, rLineInfo ); } // ----------------------------------------------------------------------- @@ -1890,6 +1957,9 @@ void OutputDevice::DrawPolygon( const Polygon& rPoly ) pGraphics->DrawPolygon( aPoly ); } #endif + + if( mpAlphaVDev ) + mpAlphaVDev->DrawPolygon( rPoly ); } // ----------------------------------------------------------------------- @@ -1988,6 +2058,9 @@ void OutputDevice::DrawPolyPolygon( const PolyPolygon& rPolyPoly ) } } #endif + + if( mpAlphaVDev ) + mpAlphaVDev->DrawPolyPolygon( rPolyPoly ); } // ----------------------------------------------------------------------- @@ -2067,6 +2140,9 @@ void OutputDevice::Push( USHORT nFlags ) else pData->mpRefPoint = NULL; } + + if( mpAlphaVDev ) + mpAlphaVDev->Push(); } // ----------------------------------------------------------------------- @@ -2089,6 +2165,9 @@ void OutputDevice::Pop() return; } + if( mpAlphaVDev ) + mpAlphaVDev->Pop(); + mpObjStack = pData->mpPrev; if ( pData->mnFlags & PUSH_LINECOLOR ) @@ -2155,6 +2234,33 @@ void OutputDevice::Pop() // ----------------------------------------------------------------------- +void OutputDevice::SetConnectMetaFile( GDIMetaFile* pMtf ) +{ + mpMetaFile = pMtf; +} + +// ----------------------------------------------------------------------- + +void OutputDevice::EnableOutput( BOOL bEnable ) +{ + mbOutput = (bEnable != 0); + + if( mpAlphaVDev ) + mpAlphaVDev->EnableOutput( bEnable ); +} + +// ----------------------------------------------------------------------- + +void OutputDevice::SetSettings( const AllSettings& rSettings ) +{ + maSettings = rSettings; + + if( mpAlphaVDev ) + mpAlphaVDev->SetSettings( rSettings ); +} + +// ----------------------------------------------------------------------- + USHORT OutputDevice::GetBitCount() const { DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice ); @@ -2176,6 +2282,21 @@ USHORT OutputDevice::GetBitCount() const // ----------------------------------------------------------------------- +USHORT OutputDevice::GetAlphaBitCount() const +{ + DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice ); + + if ( meOutDevType == OUTDEV_VIRDEV && + mpAlphaVDev != NULL ) + { + return mpAlphaVDev->GetBitCount(); + } + + return 0; +} + +// ----------------------------------------------------------------------- + ULONG OutputDevice::GetColorCount() const { DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice ); @@ -2186,6 +2307,13 @@ ULONG OutputDevice::GetColorCount() const // ----------------------------------------------------------------------- +BOOL OutputDevice::HasAlpha() +{ + return mpAlphaVDev != NULL; +} + +// ----------------------------------------------------------------------- + OpenGL* OutputDevice::GetOpenGL() { DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice ); |