summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorRelease Engineers <releng@openoffice.org>2009-08-26 14:41:39 +0000
committerRelease Engineers <releng@openoffice.org>2009-08-26 14:41:39 +0000
commit3c9734d18802d28b14887a8c2cdabb3da019c5f9 (patch)
tree3ef0ff0e4503c298230d8ef20612fd61f0f884f1 /vcl
parent2e2d1273c23a84a0b5e5b297939333ca69f62b45 (diff)
CWS-TOOLING: integrate CWS aw075
2009-08-12 18:26:05 +0200 aw r274912 : #i97672# use SelectionMaximumLuminancePercent to limit the hilight color to be not too invisible 2009-08-12 18:25:53 +0200 aw r274911 : #i97672# use SelectionMaximumLuminancePercent to limit the hilight color to be not too invisible 2009-08-12 18:25:20 +0200 aw r274910 : #i97672# Added SelectionMaximumLuminancePercent to decide which maximum luminance for the selection color to accept from the system 2009-08-12 18:00:17 +0200 aw r274908 : #i97672# added SelectionMaximumLuminancePercent which limits the luminance of the system's selection color to a maximum luminance (default is 70) 2009-08-11 14:01:07 +0200 aw r274859 : #i104150# take over values from transparence percent field even when disabled 2009-08-11 13:59:33 +0200 aw r274858 : #i103500# corrected the transparent SC overlay pixel alignment 2009-08-11 12:42:46 +0200 jsk r274854 : #i103937# Added two new controls to options/view page for transparency and opacity 2009-08-10 16:20:02 +0200 aw r274823 : #i97672# Adapting MF_SELECTION to #i35956# 2009-08-04 17:50:42 +0200 aw r274626 : #i102109# need to use AlphaMask instead of Bitmap 2009-08-04 17:03:25 +0200 aw r274624 : #i103982# corrected OutlinerParaObject owvership in GetBackgroundTextForwarder() 2009-08-04 12:18:11 +0200 aw r274614 : #i97672# corrected warning due to member initialisation 2009-08-03 11:54:16 +0200 aw r274571 : #i99268# corrected SdrExchangeView::GetObjGraphic 2009-07-31 14:22:57 +0200 aw r274529 : #i101520# added support for not correct 3d polygons for 3D polygon object which is used over API from chart directly 2009-07-31 13:25:20 +0200 aw r274527 : #i97672# added disabling selection options when system does not support them; slightly corrected positions 2009-07-31 13:20:32 +0200 aw r274526 : #i102706# Do not merge closed polygons when converting MetaFiles to SdrObjects 2009-07-30 18:03:07 +0200 aw r274499 : #i102175# corrected 1870 degree rotation situation for MetaFile paints 2009-07-30 17:06:31 +0200 aw r274496 : #i103709# corrected HitTest for callouts and DrawingLayer text objects 2009-07-29 18:55:22 +0200 aw r274465 : #i102956# corrected CutFindProcessor to back-transform all found cuts to the starting 3D coordinate system 2009-07-29 13:38:40 +0200 aw r274448 : #i103720# corrected mpAsynchLoadEvent usage 2009-07-29 12:48:12 +0200 aw r274447 : #i96762# cleanup: spaces 2009-07-28 19:11:31 +0200 aw r274427 : #97672# first version of reworked selection with changeable transparency and frame 2009-07-28 19:09:39 +0200 aw r274425 : #97672# first version of reworked selection with changeable transparency and frame 2009-07-28 19:09:27 +0200 aw r274424 : #97672# first version of reworked selection with changeable transparency and frame 2009-07-28 19:09:14 +0200 aw r274423 : #97672# first version of reworked selection with changeable transparency and frame 2009-07-28 19:08:59 +0200 aw r274422 : #97672# first version of reworked selection with changeable transparency and frame 2009-07-28 19:08:47 +0200 aw r274421 : #97672# first version of reworked selection with changeable transparency and frame 2009-07-28 15:44:50 +0200 aw r274411 : #i102556# corrected TextLayouterDevice::getTextBoundRect implementation and usage; empty Rectangles were not handled correctly 2009-07-23 17:48:36 +0200 aw r274277 : #i102063# implemented in-between OLE content holder (SdrOleContentPrimitive2D) and it's decomposition. Cleaned up diverse OLE graphic preparations 2009-07-22 12:55:12 +0200 aw r274227 : #i102109# extended OutputDevice::DrawTransparent (the version with TransparenceGradient) to work correctly with AntiAliased content 2009-07-21 13:31:12 +0200 aw r274191 : #i102611# changed scaling of Z-Range for Z-Buffer for ZBufferProcessor3D 2009-07-20 20:06:46 +0200 aw r274155 : #i103500# moved OverlayObjectCell back to use discrete coordinates for rectangle list 2009-07-16 17:33:26 +0200 aw r274065 : #i103530# corrected parameter preparation for MetaFile::Rotate call
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/outdev6.cxx144
1 files changed, 99 insertions, 45 deletions
diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx
index a11e276982f7..79986988afd7 100644
--- a/vcl/source/gdi/outdev6.cxx
+++ b/vcl/source/gdi/outdev6.cxx
@@ -642,51 +642,105 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos,
if( pVDev->SetOutputSizePixel( aDstRect.GetSize() ) )
{
- Bitmap aPaint, aMask;
- AlphaMask aAlpha;
- MapMode aMap( GetMapMode() );
- Point aOutPos( PixelToLogic( aDstRect.TopLeft() ) );
- const BOOL bOldMap = mbMap;
-
- aMap.SetOrigin( Point( -aOutPos.X(), -aOutPos.Y() ) );
- pVDev->SetMapMode( aMap );
- const BOOL bVDevOldMap = pVDev->IsMapModeEnabled();
-
- // create paint bitmap
- ( (GDIMetaFile&) rMtf ).WindStart();
- ( (GDIMetaFile&) rMtf ).Play( pVDev, rPos, rSize );
- ( (GDIMetaFile&) rMtf ).WindStart();
- pVDev->EnableMapMode( FALSE );
- aPaint = pVDev->GetBitmap( Point(), pVDev->GetOutputSizePixel() );
- pVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( TRUE ) here!
-
- // create mask bitmap
- pVDev->SetLineColor( COL_BLACK );
- pVDev->SetFillColor( COL_BLACK );
- pVDev->DrawRect( Rectangle( pVDev->PixelToLogic( Point() ), pVDev->GetOutputSize() ) );
- pVDev->SetDrawMode( DRAWMODE_WHITELINE | DRAWMODE_WHITEFILL | DRAWMODE_WHITETEXT |
- DRAWMODE_WHITEBITMAP | DRAWMODE_WHITEGRADIENT );
- ( (GDIMetaFile&) rMtf ).WindStart();
- ( (GDIMetaFile&) rMtf ).Play( pVDev, rPos, rSize );
- ( (GDIMetaFile&) rMtf ).WindStart();
- pVDev->EnableMapMode( FALSE );
- aMask = pVDev->GetBitmap( Point(), pVDev->GetOutputSizePixel() );
- pVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( TRUE ) here!
-
- // create alpha mask from gradient
- pVDev->SetDrawMode( DRAWMODE_GRAYGRADIENT );
- pVDev->DrawGradient( Rectangle( rPos, rSize ), rTransparenceGradient );
- pVDev->SetDrawMode( DRAWMODE_DEFAULT );
- pVDev->EnableMapMode( FALSE );
- pVDev->DrawMask( Point(), pVDev->GetOutputSizePixel(), aMask, Color( COL_WHITE ) );
-
- aAlpha = pVDev->GetBitmap( Point(), pVDev->GetOutputSizePixel() );
-
- delete pVDev;
-
- EnableMapMode( FALSE );
- DrawBitmapEx( aDstRect.TopLeft(), BitmapEx( aPaint, aAlpha ) );
- EnableMapMode( bOldMap );
+ if(GetAntialiasing())
+ {
+ // #i102109#
+ // For MetaFile replay (see task) it may now be neccessary to take
+ // into account that the content is AntiAlialised and needs to be masked
+ // like that. Instead of masking, i will use a copy-modify-paste cycle
+ // here (as i already use in the VclPrimiziveRenderer with successs)
+ pVDev->SetAntialiasing(GetAntialiasing());
+
+ // create MapMode for buffer (offset needed) and set
+ MapMode aMap(GetMapMode());
+ const Point aOutPos(PixelToLogic(aDstRect.TopLeft()));
+ aMap.SetOrigin(Point(-aOutPos.X(), -aOutPos.Y()));
+ pVDev->SetMapMode(aMap);
+
+ // copy MapMode state and disable for target
+ const bool bOrigMapModeEnabled(IsMapModeEnabled());
+ EnableMapMode(false);
+
+ // copy MapMode state and disable for buffer
+ const bool bBufferMapModeEnabled(pVDev->IsMapModeEnabled());
+ pVDev->EnableMapMode(false);
+
+ // copy content from original to buffer
+ pVDev->DrawOutDev(
+ aPoint, pVDev->GetOutputSizePixel(), // dest
+ aDstRect.TopLeft(), pVDev->GetOutputSizePixel(), // source
+ *this);
+
+ // draw MetaFile to buffer
+ pVDev->EnableMapMode(bBufferMapModeEnabled);
+ ((GDIMetaFile&)rMtf).WindStart();
+ ((GDIMetaFile&)rMtf).Play(pVDev, rPos, rSize);
+ ((GDIMetaFile&)rMtf).WindStart();
+
+ // get content bitmap from buffer
+ pVDev->EnableMapMode(false);
+ const Bitmap aPaint(pVDev->GetBitmap(aPoint, pVDev->GetOutputSizePixel()));
+
+ // create alpha mask from gradient and get as Bitmap
+ pVDev->EnableMapMode(bBufferMapModeEnabled);
+ pVDev->SetDrawMode(DRAWMODE_GRAYGRADIENT);
+ pVDev->DrawGradient(Rectangle(rPos, rSize), rTransparenceGradient);
+ pVDev->SetDrawMode(DRAWMODE_DEFAULT);
+ pVDev->EnableMapMode(false);
+ const AlphaMask aAlpha(pVDev->GetBitmap(aPoint, pVDev->GetOutputSizePixel()));
+
+ // draw masked content to target and restore MapMode
+ DrawBitmapEx(aDstRect.TopLeft(), BitmapEx(aPaint, aAlpha));
+ EnableMapMode(bOrigMapModeEnabled);
+ }
+ else
+ {
+ Bitmap aPaint, aMask;
+ AlphaMask aAlpha;
+ MapMode aMap( GetMapMode() );
+ Point aOutPos( PixelToLogic( aDstRect.TopLeft() ) );
+ const BOOL bOldMap = mbMap;
+
+ aMap.SetOrigin( Point( -aOutPos.X(), -aOutPos.Y() ) );
+ pVDev->SetMapMode( aMap );
+ const BOOL bVDevOldMap = pVDev->IsMapModeEnabled();
+
+ // create paint bitmap
+ ( (GDIMetaFile&) rMtf ).WindStart();
+ ( (GDIMetaFile&) rMtf ).Play( pVDev, rPos, rSize );
+ ( (GDIMetaFile&) rMtf ).WindStart();
+ pVDev->EnableMapMode( FALSE );
+ aPaint = pVDev->GetBitmap( Point(), pVDev->GetOutputSizePixel() );
+ pVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( TRUE ) here!
+
+ // create mask bitmap
+ pVDev->SetLineColor( COL_BLACK );
+ pVDev->SetFillColor( COL_BLACK );
+ pVDev->DrawRect( Rectangle( pVDev->PixelToLogic( Point() ), pVDev->GetOutputSize() ) );
+ pVDev->SetDrawMode( DRAWMODE_WHITELINE | DRAWMODE_WHITEFILL | DRAWMODE_WHITETEXT |
+ DRAWMODE_WHITEBITMAP | DRAWMODE_WHITEGRADIENT );
+ ( (GDIMetaFile&) rMtf ).WindStart();
+ ( (GDIMetaFile&) rMtf ).Play( pVDev, rPos, rSize );
+ ( (GDIMetaFile&) rMtf ).WindStart();
+ pVDev->EnableMapMode( FALSE );
+ aMask = pVDev->GetBitmap( Point(), pVDev->GetOutputSizePixel() );
+ pVDev->EnableMapMode( bVDevOldMap ); // #i35331#: MUST NOT use EnableMapMode( TRUE ) here!
+
+ // create alpha mask from gradient
+ pVDev->SetDrawMode( DRAWMODE_GRAYGRADIENT );
+ pVDev->DrawGradient( Rectangle( rPos, rSize ), rTransparenceGradient );
+ pVDev->SetDrawMode( DRAWMODE_DEFAULT );
+ pVDev->EnableMapMode( FALSE );
+ pVDev->DrawMask( Point(), pVDev->GetOutputSizePixel(), aMask, Color( COL_WHITE ) );
+
+ aAlpha = pVDev->GetBitmap( Point(), pVDev->GetOutputSizePixel() );
+
+ delete pVDev;
+
+ EnableMapMode( FALSE );
+ DrawBitmapEx( aDstRect.TopLeft(), BitmapEx( aPaint, aAlpha ) );
+ EnableMapMode( bOldMap );
+ }
}
else
delete pVDev;