summaryrefslogtreecommitdiff
path: root/vcl/unx/source/gdi/salgdi.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx/source/gdi/salgdi.cxx')
-rw-r--r--vcl/unx/source/gdi/salgdi.cxx284
1 files changed, 136 insertions, 148 deletions
diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx
index 38c760af2661..4d3141fc9ded 100644
--- a/vcl/unx/source/gdi/salgdi.cxx
+++ b/vcl/unx/source/gdi/salgdi.cxx
@@ -41,6 +41,7 @@
#include "vcl/printergfx.hxx"
#include "vcl/jobdata.hxx"
+#include "vcl/region.h"
#include "tools/debug.hxx"
@@ -68,21 +69,21 @@ class SalPolyLine
XPoint Points_[STATIC_POINTS];
XPoint *pFirst_;
public:
- inline SalPolyLine( ULONG nPoints );
- inline SalPolyLine( ULONG nPoints, const SalPoint *p );
+ inline SalPolyLine( sal_uLong nPoints );
+ inline SalPolyLine( sal_uLong nPoints, const SalPoint *p );
inline ~SalPolyLine();
- inline XPoint &operator [] ( ULONG n ) const
+ inline XPoint &operator [] ( sal_uLong n ) const
{ return pFirst_[n]; }
};
-inline SalPolyLine::SalPolyLine( ULONG nPoints )
+inline SalPolyLine::SalPolyLine( sal_uLong nPoints )
: pFirst_( nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_ )
{}
-inline SalPolyLine::SalPolyLine( ULONG nPoints, const SalPoint *p )
+inline SalPolyLine::SalPolyLine( sal_uLong nPoints, const SalPoint *p )
: pFirst_( nPoints+1 > STATIC_POINTS ? new XPoint[nPoints+1] : Points_ )
{
- for( ULONG i = 0; i < nPoints; i++ )
+ for( sal_uLong i = 0; i < nPoints; i++ )
{
pFirst_[i].x = (short)p[i].mnX;
pFirst_[i].y = (short)p[i].mnY;
@@ -105,7 +106,7 @@ X11SalGraphics::X11SalGraphics()
m_aXRenderPicture = 0;
m_pXRenderFormat = NULL;
- pClipRegion_ = NULL;
+ mpClipRegion = NULL;
pPaintRegion_ = NULL;
pPenGC_ = NULL;
@@ -114,10 +115,7 @@ X11SalGraphics::X11SalGraphics()
pFontGC_ = NULL;
for( int i = 0; i < MAX_FALLBACK; ++i )
- {
- mXFont[i] = NULL;
mpServerFont[i] = NULL;
- }
nTextPixel_ = 0;
nTextColor_ = MAKE_SALCOLOR( 0x00, 0x00, 0x00 ); // Black
@@ -125,7 +123,7 @@ X11SalGraphics::X11SalGraphics()
#ifdef ENABLE_GRAPHITE
// check if graphite fonts have been disabled
static const char* pDisableGraphiteStr = getenv( "SAL_DISABLE_GRAPHITE" );
- bDisableGraphite_ = pDisableGraphiteStr ? (pDisableGraphiteStr[0]!='0') : FALSE;
+ bDisableGraphite_ = pDisableGraphiteStr ? (pDisableGraphiteStr[0]!='0') : sal_False;
#endif
pBrushGC_ = NULL;
@@ -141,20 +139,20 @@ X11SalGraphics::X11SalGraphics()
pStippleGC_ = NULL;
pTrackingGC_ = NULL;
- bWindow_ = FALSE;
- bPrinter_ = FALSE;
- bVirDev_ = FALSE;
- bPenGC_ = FALSE;
- bFontGC_ = FALSE;
- bBrushGC_ = FALSE;
- bMonoGC_ = FALSE;
- bCopyGC_ = FALSE;
- bInvertGC_ = FALSE;
- bInvert50GC_ = FALSE;
- bStippleGC_ = FALSE;
- bTrackingGC_ = FALSE;
- bXORMode_ = FALSE;
- bDitherBrush_ = FALSE;
+ bWindow_ = sal_False;
+ bPrinter_ = sal_False;
+ bVirDev_ = sal_False;
+ bPenGC_ = sal_False;
+ bFontGC_ = sal_False;
+ bBrushGC_ = sal_False;
+ bMonoGC_ = sal_False;
+ bCopyGC_ = sal_False;
+ bInvertGC_ = sal_False;
+ bInvert50GC_ = sal_False;
+ bStippleGC_ = sal_False;
+ bTrackingGC_ = sal_False;
+ bXORMode_ = sal_False;
+ bDitherBrush_ = sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -171,7 +169,7 @@ void X11SalGraphics::freeResources()
Display *pDisplay = GetXDisplay();
DBG_ASSERT( !pPaintRegion_, "pPaintRegion_" );
- if( pClipRegion_ ) XDestroyRegion( pClipRegion_ ), pClipRegion_ = None;
+ if( mpClipRegion ) XDestroyRegion( mpClipRegion ), mpClipRegion = None;
if( hBrush_ ) XFreePixmap( pDisplay, hBrush_ ), hBrush_ = None;
if( pPenGC_ ) XFreeGC( pDisplay, pPenGC_ ), pPenGC_ = None;
@@ -230,7 +228,7 @@ void X11SalGraphics::Init( SalFrame *pFrame, Drawable aTarget, int nScreen )
m_nScreen = nScreen;
SetDrawable( aTarget, nScreen );
- bWindow_ = TRUE;
+ bWindow_ = sal_True;
m_pFrame = pFrame;
m_pVDev = NULL;
}
@@ -249,8 +247,8 @@ void X11SalGraphics::SetClipRegion( GC pGC, XLIB_Region pXReg ) const
int n = 0;
XLIB_Region Regions[3];
- if( pClipRegion_ )
- Regions[n++] = pClipRegion_;
+ if( mpClipRegion )
+ Regions[n++] = mpClipRegion;
if( pXReg && !XEmptyRegion( pXReg ) )
Regions[n++] = pXReg;
@@ -292,7 +290,7 @@ GC X11SalGraphics::SelectPen()
XSetForeground( pDisplay, pPenGC_, nPenPixel_ );
XSetFunction ( pDisplay, pPenGC_, bXORMode_ ? GXxor : GXcopy );
SetClipRegion( pPenGC_ );
- bPenGC_ = TRUE;
+ bPenGC_ = sal_True;
}
return pPenGC_;
@@ -323,13 +321,8 @@ GC X11SalGraphics::SelectBrush()
{
XSetFillStyle ( pDisplay, pBrushGC_, FillSolid );
XSetForeground( pDisplay, pBrushGC_, nBrushPixel_ );
- #if defined(_USE_PRINT_EXTENSION_)
- XSetBackground( pDisplay, pBrushGC_,
- WhitePixel(pDisplay, DefaultScreen(pDisplay)) );
- #else
if( bPrinter_ )
XSetTile( pDisplay, pBrushGC_, None );
- #endif
}
else
{
@@ -344,7 +337,7 @@ GC X11SalGraphics::SelectBrush()
XSetFunction ( pDisplay, pBrushGC_, bXORMode_ ? GXxor : GXcopy );
SetClipRegion( pBrushGC_ );
- bBrushGC_ = TRUE;
+ bBrushGC_ = sal_True;
}
return pBrushGC_;
@@ -376,26 +369,26 @@ GC X11SalGraphics::GetTrackingGC()
if( !bTrackingGC_ )
{
SetClipRegion( pTrackingGC_ );
- bTrackingGC_ = TRUE;
+ bTrackingGC_ = sal_True;
}
return pTrackingGC_;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::DrawLines( ULONG nPoints,
+void X11SalGraphics::DrawLines( sal_uLong nPoints,
const SalPolyLine &rPoints,
GC pGC,
bool bClose
)
{
// errechne wie viele Linien XWindow auf einmal zeichnen kann
- ULONG nMaxLines = (GetDisplay()->GetMaxRequestSize() - sizeof(xPolyPointReq))
+ sal_uLong nMaxLines = (GetDisplay()->GetMaxRequestSize() - sizeof(xPolyPointReq))
/ sizeof(xPoint);
if( nMaxLines > nPoints ) nMaxLines = nPoints;
// gebe alle Linien aus, die XWindows zeichnen kann.
- ULONG n;
+ sal_uLong n;
for( n = 0; nPoints - n > nMaxLines; n += nMaxLines - 1 )
XDrawLines( GetXDisplay(),
GetDrawable(),
@@ -439,24 +432,24 @@ BOOL X11SalGraphics::GetDitherPixmap( SalColor nSalColor )
// test for correct depth (8bit)
if( GetColormap().GetVisual().GetDepth() != 8 )
- return FALSE;
+ return sal_False;
char pBits[64];
char *pBitsPtr = pBits;
// Set the pallette-entries for the dithering tile
- UINT8 nSalColorRed = SALCOLOR_RED ( nSalColor );
- UINT8 nSalColorGreen = SALCOLOR_GREEN ( nSalColor );
- UINT8 nSalColorBlue = SALCOLOR_BLUE ( nSalColor );
+ sal_uInt8 nSalColorRed = SALCOLOR_RED ( nSalColor );
+ sal_uInt8 nSalColorGreen = SALCOLOR_GREEN ( nSalColor );
+ sal_uInt8 nSalColorBlue = SALCOLOR_BLUE ( nSalColor );
for( int nY = 0; nY < 8; nY++ )
{
for( int nX = 0; nX < 8; nX++ )
{
short nMagic = nOrdDither8Bit[nY][nX];
- UINT8 nR = P_DELTA * DMAP( nSalColorRed, nMagic );
- UINT8 nG = P_DELTA * DMAP( nSalColorGreen, nMagic );
- UINT8 nB = P_DELTA * DMAP( nSalColorBlue, nMagic );
+ sal_uInt8 nR = P_DELTA * DMAP( nSalColorRed, nMagic );
+ sal_uInt8 nG = P_DELTA * DMAP( nSalColorGreen, nMagic );
+ sal_uInt8 nB = P_DELTA * DMAP( nSalColorBlue, nMagic );
*pBitsPtr++ = GetColormap().GetPixel( MAKE_SALCOLOR( nR, nG, nB ) );
}
@@ -496,7 +489,7 @@ BOOL X11SalGraphics::GetDitherPixmap( SalColor nSalColor )
pImage->data = NULL;
XDestroyImage( pImage );
- return TRUE;
+ return sal_True;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -531,7 +524,7 @@ void X11SalGraphics::GetResolution( sal_Int32 &rDPIX, sal_Int32 &rDPIY ) // cons
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-USHORT X11SalGraphics::GetBitCount() const
+sal_uInt16 X11SalGraphics::GetBitCount() const
{
return GetVisual().GetDepth();
}
@@ -561,73 +554,64 @@ long X11SalGraphics::GetGraphicsHeight() const
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void X11SalGraphics::ResetClipRegion()
{
- if( pClipRegion_ )
+ if( mpClipRegion )
{
- bPenGC_ = FALSE;
- bFontGC_ = FALSE;
- bBrushGC_ = FALSE;
- bMonoGC_ = FALSE;
- bCopyGC_ = FALSE;
- bInvertGC_ = FALSE;
- bInvert50GC_ = FALSE;
- bStippleGC_ = FALSE;
- bTrackingGC_ = FALSE;
-
- XDestroyRegion( pClipRegion_ );
- pClipRegion_ = NULL;
+ bPenGC_ = sal_False;
+ bFontGC_ = sal_False;
+ bBrushGC_ = sal_False;
+ bMonoGC_ = sal_False;
+ bCopyGC_ = sal_False;
+ bInvertGC_ = sal_False;
+ bInvert50GC_ = sal_False;
+ bStippleGC_ = sal_False;
+ bTrackingGC_ = sal_False;
+
+ XDestroyRegion( mpClipRegion );
+ mpClipRegion = NULL;
}
}
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::BeginSetClipRegion( ULONG )
-{
- if( pClipRegion_ )
- XDestroyRegion( pClipRegion_ );
- pClipRegion_ = XCreateRegion();
-}
-
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-BOOL X11SalGraphics::unionClipRegion( long nX, long nY, long nDX, long nDY )
+bool X11SalGraphics::setClipRegion( const Region& i_rClip )
{
- if (!nDX || !nDY)
- return TRUE;
-
- XRectangle aRect;
- aRect.x = (short)nX;
- aRect.y = (short)nY;
- aRect.width = (unsigned short)nDX;
- aRect.height = (unsigned short)nDY;
-
- XUnionRectWithRegion( &aRect, pClipRegion_, pClipRegion_ );
-
- return TRUE;
-}
+ if( mpClipRegion )
+ XDestroyRegion( mpClipRegion );
+ mpClipRegion = XCreateRegion();
+
+ ImplRegionInfo aInfo;
+ long nX, nY, nW, nH;
+ bool bRegionRect = i_rClip.ImplGetFirstRect(aInfo, nX, nY, nW, nH );
+ while( bRegionRect )
+ {
+ if ( nW && nH )
+ {
+ XRectangle aRect;
+ aRect.x = (short)nX;
+ aRect.y = (short)nY;
+ aRect.width = (unsigned short)nW;
+ aRect.height = (unsigned short)nH;
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-bool X11SalGraphics::unionClipRegion( const ::basegfx::B2DPolyPolygon& )
-{
- // TODO: implement and advertise OutDevSupport_B2DClip support
- return false;
-}
+ XUnionRectWithRegion( &aRect, mpClipRegion, mpClipRegion );
+ }
+ bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
+ }
-// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::EndSetClipRegion()
-{
- bPenGC_ = FALSE;
- bFontGC_ = FALSE;
- bBrushGC_ = FALSE;
- bMonoGC_ = FALSE;
- bCopyGC_ = FALSE;
- bInvertGC_ = FALSE;
- bInvert50GC_ = FALSE;
- bStippleGC_ = FALSE;
- bTrackingGC_ = FALSE;
-
- if( XEmptyRegion( pClipRegion_ ) )
+ // done, invalidate GCs
+ bPenGC_ = sal_False;
+ bFontGC_ = sal_False;
+ bBrushGC_ = sal_False;
+ bMonoGC_ = sal_False;
+ bCopyGC_ = sal_False;
+ bInvertGC_ = sal_False;
+ bInvert50GC_ = sal_False;
+ bStippleGC_ = sal_False;
+ bTrackingGC_ = sal_False;
+
+ if( XEmptyRegion( mpClipRegion ) )
{
- XDestroyRegion( pClipRegion_ );
- pClipRegion_= NULL;
+ XDestroyRegion( mpClipRegion );
+ mpClipRegion= NULL;
}
+ return true;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -636,7 +620,7 @@ void X11SalGraphics::SetLineColor()
if( nPenColor_ != SALCOLOR_NONE )
{
nPenColor_ = SALCOLOR_NONE;
- bPenGC_ = FALSE;
+ bPenGC_ = sal_False;
}
}
@@ -647,7 +631,7 @@ void X11SalGraphics::SetLineColor( SalColor nSalColor )
{
nPenColor_ = nSalColor;
nPenPixel_ = GetPixel( nSalColor );
- bPenGC_ = FALSE;
+ bPenGC_ = sal_False;
}
}
@@ -656,9 +640,9 @@ void X11SalGraphics::SetFillColor()
{
if( nBrushColor_ != SALCOLOR_NONE )
{
- bDitherBrush_ = FALSE;
+ bDitherBrush_ = sal_False;
nBrushColor_ = SALCOLOR_NONE;
- bBrushGC_ = FALSE;
+ bBrushGC_ = sal_False;
}
}
@@ -667,7 +651,7 @@ void X11SalGraphics::SetFillColor( SalColor nSalColor )
{
if( nBrushColor_ != nSalColor )
{
- bDitherBrush_ = FALSE;
+ bDitherBrush_ = sal_False;
nBrushColor_ = nSalColor;
nBrushPixel_ = GetPixel( nSalColor );
if( TrueColor != GetColormap().GetVisual().GetClass()
@@ -689,7 +673,7 @@ void X11SalGraphics::SetFillColor( SalColor nSalColor )
&& nSalColor != MAKE_SALCOLOR( 0xFF, 0xFF, 0x00 ) // light brown
&& nSalColor != MAKE_SALCOLOR( 0xFF, 0xFF, 0xFF ) )
bDitherBrush_ = GetDitherPixmap(nSalColor);
- bBrushGC_ = FALSE;
+ bBrushGC_ = sal_False;
}
}
@@ -709,7 +693,7 @@ void X11SalGraphics::SetROPLineColor( SalROPColor nROPColor )
break;
}
nPenColor_ = GetColormap().GetColor( nPenPixel_ );
- bPenGC_ = FALSE;
+ bPenGC_ = sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -727,9 +711,9 @@ void X11SalGraphics::SetROPFillColor( SalROPColor nROPColor )
nBrushPixel_ = (Pixel)(1 << GetVisual().GetDepth()) - 1;
break;
}
- bDitherBrush_ = FALSE;
+ bDitherBrush_ = sal_False;
nBrushColor_ = GetColormap().GetColor( nBrushPixel_ );
- bBrushGC_ = FALSE;
+ bBrushGC_ = sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -738,14 +722,15 @@ void X11SalGraphics::SetXORMode( bool bSet, bool )
if( !bXORMode_ == bSet )
{
bXORMode_ = bSet;
- bPenGC_ = FALSE;
- bBrushGC_ = FALSE;
- bMonoGC_ = FALSE;
- bCopyGC_ = FALSE;
- bInvertGC_ = FALSE;
- bInvert50GC_ = FALSE;
- bStippleGC_ = FALSE;
- bTrackingGC_ = FALSE;
+ bPenGC_ = sal_False;
+ bFontGC_ = sal_False;
+ bBrushGC_ = sal_False;
+ bMonoGC_ = sal_False;
+ bCopyGC_ = sal_False;
+ bInvertGC_ = sal_False;
+ bInvert50GC_ = sal_False;
+ bStippleGC_ = sal_False;
+ bTrackingGC_ = sal_False;
}
}
@@ -821,13 +806,13 @@ void X11SalGraphics::drawRect( long nX, long nY, long nDX, long nDY )
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry )
+void X11SalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry )
{
drawPolyLine( nPoints, pPtAry, false );
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry, bool bClose )
+void X11SalGraphics::drawPolyLine( sal_uLong nPoints, const SalPoint *pPtAry, bool bClose )
{
if( nPenColor_ != 0xFFFFFFFF )
{
@@ -838,7 +823,7 @@ void X11SalGraphics::drawPolyLine( ULONG nPoints, const SalPoint *pPtAry, bool b
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::drawPolygon( ULONG nPoints, const SalPoint* pPtAry )
+void X11SalGraphics::drawPolygon( sal_uLong nPoints, const SalPoint* pPtAry )
{
if( nPoints == 0 )
return;
@@ -911,7 +896,7 @@ void X11SalGraphics::drawPolyPolygon( sal_uInt32 nPoly,
{
if( nBrushColor_ != SALCOLOR_NONE )
{
- ULONG i, n;
+ sal_uInt32 i, n;
XLIB_Region pXRegA = NULL;
for( i = 0; i < nPoly; i++ ) {
@@ -938,7 +923,7 @@ void X11SalGraphics::drawPolyPolygon( sal_uInt32 nPoly,
GC pGC = SelectBrush();
SetClipRegion( pGC, pXRegA ); // ??? doppelt
XDestroyRegion( pXRegA );
- bBrushGC_ = FALSE;
+ bBrushGC_ = sal_False;
XFillRectangle( GetXDisplay(),
GetDrawable(),
@@ -948,20 +933,20 @@ void X11SalGraphics::drawPolyPolygon( sal_uInt32 nPoly,
}
if( nPenColor_ != SALCOLOR_NONE )
- for( ULONG i = 0; i < nPoly; i++ )
+ for( sal_uInt32 i = 0; i < nPoly; i++ )
drawPolyLine( pPoints[i], pPtAry[i], true );
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-sal_Bool X11SalGraphics::drawPolyLineBezier( ULONG, const SalPoint*, const BYTE* )
+sal_Bool X11SalGraphics::drawPolyLineBezier( sal_uLong, const SalPoint*, const BYTE* )
{
return sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-sal_Bool X11SalGraphics::drawPolygonBezier( ULONG, const SalPoint*, const BYTE* )
+sal_Bool X11SalGraphics::drawPolygonBezier( sal_uLong, const SalPoint*, const BYTE* )
{
return sal_False;
}
@@ -976,7 +961,7 @@ sal_Bool X11SalGraphics::drawPolyPolygonBezier( sal_uInt32, const sal_uInt32*,
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-void X11SalGraphics::invert( ULONG nPoints,
+void X11SalGraphics::invert( sal_uLong nPoints,
const SalPoint* pPtAry,
SalInvert nFlags )
{
@@ -1003,9 +988,9 @@ void X11SalGraphics::invert( ULONG nPoints,
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-BOOL X11SalGraphics::drawEPS( long,long,long,long,void*,ULONG )
+BOOL X11SalGraphics::drawEPS( long,long,long,long,void*,sal_uLong )
{
- return FALSE;
+ return sal_False;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -1067,22 +1052,22 @@ bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rOrigPoly
// nothing to do for empty polypolygons
const int nOrigPolyCount = rOrigPolyPoly.count();
if( nOrigPolyCount <= 0 )
- return TRUE;
+ return sal_True;
// nothing to do if everything is transparent
if( (nBrushColor_ == SALCOLOR_NONE)
&& (nPenColor_ == SALCOLOR_NONE) )
- return TRUE;
+ return sal_True;
// cannot handle pencolor!=brushcolor yet
if( (nPenColor_ != SALCOLOR_NONE)
&& (nPenColor_ != nBrushColor_) )
- return FALSE;
+ return sal_False;
// TODO: remove the env-variable when no longer needed
static const char* pRenderEnv = getenv( "SAL_DISABLE_RENDER_POLY" );
if( pRenderEnv )
- return FALSE;
+ return sal_False;
// snap to raster if requested
basegfx::B2DPolyPolygon aPolyPoly = rOrigPolyPoly;
@@ -1165,8 +1150,8 @@ bool X11SalGraphics::drawFilledTrapezoids( const ::basegfx::B2DTrapezoid* pB2DTr
// set clipping
// TODO: move into GetXRenderPicture?
- if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
- rRenderPeer.SetPictureClipRegion( aDstPic, pClipRegion_ );
+ if( mpClipRegion && !XEmptyRegion( mpClipRegion ) )
+ rRenderPeer.SetPictureClipRegion( aDstPic, mpClipRegion );
// render the trapezoids
const XRenderPictFormat* pMaskFormat = rRenderPeer.GetStandardFormatA8();
@@ -1213,14 +1198,17 @@ bool X11SalGraphics::drawPolyLine(const ::basegfx::B2DPolygon& rPolygon, double
basegfx::tools::createLineTrapezoidFromB2DPolygon( aB2DTrapVector, aPolygon, rLineWidth.getX() );
// draw tesselation result
- const int nTrapCount = aB2DTrapVector.size();
- if( !nTrapCount )
- return true;
- const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency );
+ if( ! aB2DTrapVector.empty() )
+ {
+ const int nTrapCount = aB2DTrapVector.size();
+ const bool bDrawOk = drawFilledTrapezoids( &aB2DTrapVector[0], nTrapCount, fTransparency );
- // restore the original brush GC
- nBrushColor_ = aKeepBrushColor;
- return bDrawOk;
+ // restore the original brush GC
+ nBrushColor_ = aKeepBrushColor;
+ return bDrawOk;
+ }
+ else
+ return true;
}
// get the area polygon for the line polygon