fdo#74702 Seperate ImplDrawGradientWallpaper and rename
I have made ImplDrawGradientWallpaper a virtual protected function as Window needs to handle this differently to Printer and VirtualDevice instances. I have also renamed it to DrawGradientWallpaper. Change-Id: I529ed0a757cfcebb6fe06f3738219ec43272f657
This commit is contained in:
parent
bc3625fce4
commit
948c4654f6
@ -768,7 +768,6 @@ public:
|
|||||||
SAL_DLLPRIVATE void ImplDrawWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
|
SAL_DLLPRIVATE void ImplDrawWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
|
||||||
SAL_DLLPRIVATE void ImplDrawColorWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
|
SAL_DLLPRIVATE void ImplDrawColorWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
|
||||||
SAL_DLLPRIVATE void ImplDrawBitmapWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
|
SAL_DLLPRIVATE void ImplDrawBitmapWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
|
||||||
SAL_DLLPRIVATE void ImplDrawGradientWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
|
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
/** @name Bitmap functions
|
/** @name Bitmap functions
|
||||||
@ -891,6 +890,8 @@ protected:
|
|||||||
virtual void EmulateDrawTransparent( const PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent );
|
virtual void EmulateDrawTransparent( const PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent );
|
||||||
void DrawInvisiblePolygon( const PolyPolygon& rPolyPoly );
|
void DrawInvisiblePolygon( const PolyPolygon& rPolyPoly );
|
||||||
|
|
||||||
|
virtual void DrawGradientWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef void ( OutputDevice::* FontUpdateHandler_t )( bool );
|
typedef void ( OutputDevice::* FontUpdateHandler_t )( bool );
|
||||||
|
|
||||||
|
@ -583,6 +583,8 @@ protected:
|
|||||||
virtual void ClipToPaintRegion( Rectangle& rDstRect ) SAL_OVERRIDE;
|
virtual void ClipToPaintRegion( Rectangle& rDstRect ) SAL_OVERRIDE;
|
||||||
virtual bool UsePolyPolygonForComplexGradient() SAL_OVERRIDE;
|
virtual bool UsePolyPolygonForComplexGradient() SAL_OVERRIDE;
|
||||||
|
|
||||||
|
virtual void DrawGradientWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper ) SAL_OVERRIDE;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool HasMirroredGraphics() const SAL_OVERRIDE;
|
bool HasMirroredGraphics() const SAL_OVERRIDE;
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
|
|||||||
|
|
||||||
// background of bitmap?
|
// background of bitmap?
|
||||||
if( bDrawGradientBackground )
|
if( bDrawGradientBackground )
|
||||||
ImplDrawGradientWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
|
DrawGradientWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
|
||||||
else if( bDrawColorBackground && bTransparent )
|
else if( bDrawColorBackground && bTransparent )
|
||||||
{
|
{
|
||||||
ImplDrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
|
ImplDrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
|
||||||
@ -301,14 +301,13 @@ void OutputDevice::ImplDrawBitmapWallpaper( long nX, long nY,
|
|||||||
mpMetaFile = pOldMetaFile;
|
mpMetaFile = pOldMetaFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutputDevice::ImplDrawGradientWallpaper( long nX, long nY,
|
void OutputDevice::DrawGradientWallpaper( long nX, long nY,
|
||||||
long nWidth, long nHeight,
|
long nWidth, long nHeight,
|
||||||
const Wallpaper& rWallpaper )
|
const Wallpaper& rWallpaper )
|
||||||
{
|
{
|
||||||
Rectangle aBound;
|
Rectangle aBound;
|
||||||
GDIMetaFile* pOldMetaFile = mpMetaFile;
|
GDIMetaFile* pOldMetaFile = mpMetaFile;
|
||||||
const bool bOldMap = mbMap;
|
const bool bOldMap = mbMap;
|
||||||
bool bNeedGradient = true;
|
|
||||||
|
|
||||||
aBound = Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) );
|
aBound = Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) );
|
||||||
|
|
||||||
@ -317,26 +316,6 @@ void OutputDevice::ImplDrawGradientWallpaper( long nX, long nY,
|
|||||||
Push( PUSH_CLIPREGION );
|
Push( PUSH_CLIPREGION );
|
||||||
IntersectClipRegion( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ) );
|
IntersectClipRegion( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ) );
|
||||||
|
|
||||||
if( OUTDEV_WINDOW == meOutDevType && rWallpaper.GetStyle() == WALLPAPER_APPLICATIONGRADIENT )
|
|
||||||
{
|
|
||||||
Window *pWin = dynamic_cast< Window* >( this );
|
|
||||||
if( pWin )
|
|
||||||
{
|
|
||||||
// limit gradient to useful size, so that it still can be noticed
|
|
||||||
// in maximized windows
|
|
||||||
long gradientWidth = pWin->GetDesktopRectPixel().GetSize().Width();
|
|
||||||
if( gradientWidth > 1024 )
|
|
||||||
gradientWidth = 1024;
|
|
||||||
if( mnOutOffX+nWidth > gradientWidth )
|
|
||||||
ImplDrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper.GetGradient().GetEndColor() );
|
|
||||||
if( mnOutOffX > gradientWidth )
|
|
||||||
bNeedGradient = false;
|
|
||||||
else
|
|
||||||
aBound = Rectangle( Point( -mnOutOffX, nY ), Size( gradientWidth, nHeight ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if( bNeedGradient )
|
|
||||||
DrawGradient( aBound, rWallpaper.GetGradient() );
|
DrawGradient( aBound, rWallpaper.GetGradient() );
|
||||||
|
|
||||||
Pop();
|
Pop();
|
||||||
@ -351,7 +330,7 @@ void OutputDevice::ImplDrawWallpaper( long nX, long nY,
|
|||||||
if( rWallpaper.IsBitmap() )
|
if( rWallpaper.IsBitmap() )
|
||||||
ImplDrawBitmapWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
|
ImplDrawBitmapWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
|
||||||
else if( rWallpaper.IsGradient() )
|
else if( rWallpaper.IsGradient() )
|
||||||
ImplDrawGradientWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
|
DrawGradientWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
|
||||||
else
|
else
|
||||||
ImplDrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
|
ImplDrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
|
||||||
}
|
}
|
||||||
|
@ -9378,4 +9378,44 @@ bool Window::UsePolyPolygonForComplexGradient()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Window::DrawGradientWallpaper( long nX, long nY,
|
||||||
|
long nWidth, long nHeight,
|
||||||
|
const Wallpaper& rWallpaper )
|
||||||
|
{
|
||||||
|
Rectangle aBound;
|
||||||
|
GDIMetaFile* pOldMetaFile = mpMetaFile;
|
||||||
|
const bool bOldMap = mbMap;
|
||||||
|
bool bNeedGradient = true;
|
||||||
|
|
||||||
|
aBound = Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) );
|
||||||
|
|
||||||
|
mpMetaFile = NULL;
|
||||||
|
EnableMapMode( false );
|
||||||
|
Push( PUSH_CLIPREGION );
|
||||||
|
IntersectClipRegion( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ) );
|
||||||
|
|
||||||
|
if( rWallpaper.GetStyle() == WALLPAPER_APPLICATIONGRADIENT )
|
||||||
|
{
|
||||||
|
// limit gradient to useful size, so that it still can be noticed
|
||||||
|
// in maximized windows
|
||||||
|
long gradientWidth = GetDesktopRectPixel().GetSize().Width();
|
||||||
|
if( gradientWidth > 1024 )
|
||||||
|
gradientWidth = 1024;
|
||||||
|
if( mnOutOffX+nWidth > gradientWidth )
|
||||||
|
ImplDrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper.GetGradient().GetEndColor() );
|
||||||
|
if( mnOutOffX > gradientWidth )
|
||||||
|
bNeedGradient = false;
|
||||||
|
else
|
||||||
|
aBound = Rectangle( Point( -mnOutOffX, nY ), Size( gradientWidth, nHeight ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( bNeedGradient )
|
||||||
|
DrawGradient( aBound, rWallpaper.GetGradient() );
|
||||||
|
|
||||||
|
Pop();
|
||||||
|
EnableMapMode( bOldMap );
|
||||||
|
mpMetaFile = pOldMetaFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user