Kaydet (Commit) 629baf05 authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt

Revert "Unused code removal DrawGradientWallpaper"

Seems to be used, since IsGradient() actually can be true.

This reverts commit fe4412c8.
üst c8b31f08
......@@ -999,6 +999,9 @@ public:
virtual void Erase();
virtual void Erase( const Rectangle& rRect ) { DrawWallpaper( rRect, GetBackground() ); }
protected:
virtual void DrawGradientWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
private:
SAL_DLLPRIVATE void DrawWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
SAL_DLLPRIVATE void DrawColorWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper );
......
......@@ -812,6 +812,12 @@ protected:
virtual void ClipToPaintRegion( Rectangle& rDstRect ) override;
virtual bool UsePolyPolygonForComplexGradient() override;
virtual void DrawGradientWallpaper(long nX, long nY, long nWidth, long nHeight,
const Wallpaper& rWallpaper) override
{
OutputDevice::DrawGradientWallpaper(nX, nY, nWidth, nHeight, rWallpaper);
}
virtual void ApplySettings(vcl::RenderContext& rRenderContext);
public:
bool HasMirroredGraphics() const override;
......
......@@ -60,6 +60,8 @@ void OutputDevice::DrawWallpaper( long nX, long nY,
if( rWallpaper.IsBitmap() )
DrawBitmapWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
else if( rWallpaper.IsGradient() )
DrawGradientWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
else
DrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
}
......@@ -117,6 +119,7 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY,
const WallpaperStyle eStyle = rWallpaper.GetStyle();
const bool bOldMap = mbMap;
bool bDrawn = false;
bool bDrawGradientBackground = false;
bool bDrawColorBackground = false;
if( pCached )
......@@ -131,24 +134,34 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY,
// draw background
if( bTransparent )
{
if( !pCached && !rWallpaper.GetColor().GetTransparency() )
if( rWallpaper.IsGradient() )
bDrawGradientBackground = true;
else
{
ScopedVclPtrInstance< VirtualDevice > aVDev( *this );
aVDev->SetBackground( rWallpaper.GetColor() );
aVDev->SetOutputSizePixel( Size( nBmpWidth, nBmpHeight ) );
aVDev->DrawBitmapEx( Point(), aBmpEx );
aBmpEx = aVDev->GetBitmap( Point(), aVDev->GetOutputSizePixel() );
}
if( !pCached && !rWallpaper.GetColor().GetTransparency() )
{
ScopedVclPtrInstance< VirtualDevice > aVDev( *this );
aVDev->SetBackground( rWallpaper.GetColor() );
aVDev->SetOutputSizePixel( Size( nBmpWidth, nBmpHeight ) );
aVDev->DrawBitmapEx( Point(), aBmpEx );
aBmpEx = aVDev->GetBitmap( Point(), aVDev->GetOutputSizePixel() );
}
bDrawColorBackground = true;
bDrawColorBackground = true;
}
}
else if( eStyle != WallpaperStyle::Tile && eStyle != WallpaperStyle::Scale )
{
bDrawColorBackground = true;
if( rWallpaper.IsGradient() )
bDrawGradientBackground = true;
else
bDrawColorBackground = true;
}
// background of bitmap?
if( bDrawColorBackground && bTransparent )
if( bDrawGradientBackground )
DrawGradientWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
else if( bDrawColorBackground && bTransparent )
{
DrawColorWallpaper( nX, nY, nWidth, nHeight, rWallpaper );
bDrawColorBackground = false;
......@@ -330,4 +343,28 @@ void OutputDevice::DrawBitmapWallpaper( long nX, long nY,
mpMetaFile = pOldMetaFile;
}
void OutputDevice::DrawGradientWallpaper( long nX, long nY,
long nWidth, long nHeight,
const Wallpaper& rWallpaper )
{
assert(!is_double_buffered_window());
Rectangle aBound;
GDIMetaFile* pOldMetaFile = mpMetaFile;
const bool bOldMap = mbMap;
aBound = Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) );
mpMetaFile = NULL;
EnableMapMode( false );
Push( PushFlags::CLIPREGION );
IntersectClipRegion( Rectangle( Point( nX, nY ), Size( nWidth, nHeight ) ) );
DrawGradient( aBound, rWallpaper.GetGradient() );
Pop();
EnableMapMode( bOldMap );
mpMetaFile = pOldMetaFile;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment