summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2008-05-30 09:06:23 +0000
committerOliver Bolte <obo@openoffice.org>2008-05-30 09:06:23 +0000
commit72b6b77d7b6895c7bf8e42e844670b232b8379a8 (patch)
tree477aa571530fca5798f2903a5cbf533ff3ba235d
parent844f9a38ab061c9ccebd0a73d0814a68f75d0b01 (diff)
INTEGRATION: CWS aquabmpfix01 (1.26.12); FILE MERGED
2008/05/09 11:08:13 hdu 1.26.12.2: RESYNC: (1.26-1.27); FILE MERGED 2008/05/05 09:06:18 hdu 1.26.12.1: #i88795# use SalGraphics::UnionClipRegion(B2D) if available
-rw-r--r--vcl/source/gdi/outdev4.cxx31
1 files changed, 29 insertions, 2 deletions
diff --git a/vcl/source/gdi/outdev4.cxx b/vcl/source/gdi/outdev4.cxx
index 49a0c268152a..80c6d19229ab 100644
--- a/vcl/source/gdi/outdev4.cxx
+++ b/vcl/source/gdi/outdev4.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: outdev4.cxx,v $
- * $Revision: 1.27 $
+ * $Revision: 1.28 $
*
* This file is part of OpenOffice.org.
*
@@ -55,6 +55,10 @@
#include "vcl/window.h"
#include "vcl/salframe.hxx"
+#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/matrix/b2dhommatrix.hxx>
+
// -----------
// - Defines -
// -----------
@@ -812,6 +816,16 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
DBG_CHKOBJ( &rGradient, Gradient, NULL );
+ if( mbInitClipRegion )
+ ImplInitClipRegion();
+
+ if( mbOutputClipped )
+ return;
+
+ if( !mpGraphics )
+ if( !ImplGetGraphics() )
+ return;
+
if( rPolyPoly.Count() && rPolyPoly[ 0 ].GetSize() && !( mnDrawMode & DRAWMODE_NOGRADIENT ) )
{
if ( mnDrawMode & ( DRAWMODE_BLACKGRADIENT | DRAWMODE_WHITEGRADIENT | DRAWMODE_SETTINGSGRADIENT) )
@@ -906,7 +920,20 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
aGradient.SetEndColor( aEndCol );
}
- if( OUTDEV_PRINTER == meOutDevType )
+ if( mpGraphics->supportsOperation( OutDevSupport_B2DClip ) )
+ {
+ ::basegfx::B2DPolyPolygon aB2DPolyPolygon = rPolyPoly.getB2DPolyPolygon();
+ const ::basegfx::B2DHomMatrix aTransform = GetViewTransformation();
+ aB2DPolyPolygon.transform( aTransform );
+ mpGraphics->BeginSetClipRegion( 0 );
+ mpGraphics->UnionClipRegion( aB2DPolyPolygon, this );
+ mpGraphics->EndSetClipRegion();
+ const Rectangle aBoundRect( rPolyPoly.GetBoundRect() );
+ DrawGradient( aBoundRect, rGradient );
+ mpGraphics->BeginSetClipRegion( 0 );
+ mpGraphics->EndSetClipRegion();
+ }
+ else if( OUTDEV_PRINTER == meOutDevType )
{
const Rectangle aBoundRect( rPolyPoly.GetBoundRect() );