Kaydet (Commit) 56e112aa authored tarafından Louis-Francis Ratté-Boulianne's avatar Louis-Francis Ratté-Boulianne Kaydeden (comit) Jan Holesovsky

vcl: Apply the OutputDevice transformation to the gradient clipping polygon

Change-Id: I16845c6cb0c110749112d608c209020f21549e70
üst 1419d851
...@@ -1705,7 +1705,6 @@ bool OpenGLSalGraphicsImpl::drawGradient(const tools::PolyPolygon& rPolyPoly, ...@@ -1705,7 +1705,6 @@ bool OpenGLSalGraphicsImpl::drawGradient(const tools::PolyPolygon& rPolyPoly,
aBoundRect.Top()--; aBoundRect.Top()--;
aBoundRect.Right()++; aBoundRect.Right()++;
aBoundRect.Bottom()++; aBoundRect.Bottom()++;
//TODO: lfrb: some missing transformation with the polygon in outdev
PreDraw(); PreDraw();
......
...@@ -41,8 +41,6 @@ void OutputDevice::DrawGradient( const Rectangle& rRect, ...@@ -41,8 +41,6 @@ void OutputDevice::DrawGradient( const Rectangle& rRect,
void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly, void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly,
const Gradient& rGradient ) const Gradient& rGradient )
{ {
bool bDrawn = false;
if ( mnDrawMode & DRAWMODE_NOGRADIENT ) if ( mnDrawMode & DRAWMODE_NOGRADIENT )
return; // nothing to draw! return; // nothing to draw!
...@@ -52,12 +50,7 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly, ...@@ -52,12 +50,7 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly,
if ( mbOutputClipped ) if ( mbOutputClipped )
return; return;
if ( mpGraphics || AcquireGraphics() ) if ( rPolyPoly.Count() && rPolyPoly[ 0 ].GetSize() )
{
bDrawn = mpGraphics->DrawGradient( rPolyPoly, rGradient, this );
}
if ( !bDrawn && rPolyPoly.Count() && rPolyPoly[ 0 ].GetSize() )
{ {
if ( mnDrawMode & ( DRAWMODE_BLACKGRADIENT | DRAWMODE_WHITEGRADIENT | DRAWMODE_SETTINGSGRADIENT) ) if ( mnDrawMode & ( DRAWMODE_BLACKGRADIENT | DRAWMODE_WHITEGRADIENT | DRAWMODE_SETTINGSGRADIENT) )
{ {
...@@ -95,6 +88,9 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly, ...@@ -95,6 +88,9 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly,
// do nothing if the rectangle is empty // do nothing if the rectangle is empty
if ( !aRect.IsEmpty() ) if ( !aRect.IsEmpty() )
{ {
tools::PolyPolygon aClipPolyPoly( ImplLogicToDevicePixel( rPolyPoly ) );
bool bDrawn = false;
if( !mpGraphics && !AcquireGraphics() ) if( !mpGraphics && !AcquireGraphics() )
return; return;
...@@ -105,10 +101,11 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly, ...@@ -105,10 +101,11 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly,
if( mbInitClipRegion ) if( mbInitClipRegion )
InitClipRegion(); InitClipRegion();
if( !mbOutputClipped ) // try to draw gradient natively
{ bDrawn = mpGraphics->DrawGradient( aClipPolyPoly, aGradient, this );
tools::PolyPolygon aClipPolyPoly( ImplLogicToDevicePixel( rPolyPoly ) );
if( !bDrawn && !mbOutputClipped )
{
// draw gradients without border // draw gradients without border
if( mbLineColor || mbInitLineColor ) if( mbLineColor || mbInitLineColor )
{ {
......
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