diff options
author | Louis-Francis Ratté-Boulianne <lfrb@collabora.com> | 2014-11-19 10:09:42 -0500 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-11-22 20:14:18 +0100 |
commit | 56e112aace06ece44c0e8ae55b5733fb0fe21806 (patch) | |
tree | eaa73ac0ad1435630a58e5d86d57acb1c7f4074a | |
parent | 1419d851d22e06ce867d9f83167b32286e9201d0 (diff) |
vcl: Apply the OutputDevice transformation to the gradient clipping polygon
Change-Id: I16845c6cb0c110749112d608c209020f21549e70
-rw-r--r-- | vcl/opengl/gdiimpl.cxx | 1 | ||||
-rw-r--r-- | vcl/source/outdev/gradient.cxx | 19 |
2 files changed, 8 insertions, 12 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx index b1f0e49fefb3..4318eb82f2c0 100644 --- a/vcl/opengl/gdiimpl.cxx +++ b/vcl/opengl/gdiimpl.cxx @@ -1705,7 +1705,6 @@ bool OpenGLSalGraphicsImpl::drawGradient(const tools::PolyPolygon& rPolyPoly, aBoundRect.Top()--; aBoundRect.Right()++; aBoundRect.Bottom()++; - //TODO: lfrb: some missing transformation with the polygon in outdev PreDraw(); diff --git a/vcl/source/outdev/gradient.cxx b/vcl/source/outdev/gradient.cxx index 77be6a0264ea..8916e76825dd 100644 --- a/vcl/source/outdev/gradient.cxx +++ b/vcl/source/outdev/gradient.cxx @@ -41,8 +41,6 @@ void OutputDevice::DrawGradient( const Rectangle& rRect, void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient ) { - bool bDrawn = false; - if ( mnDrawMode & DRAWMODE_NOGRADIENT ) return; // nothing to draw! @@ -52,12 +50,7 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly, if ( mbOutputClipped ) return; - if ( mpGraphics || AcquireGraphics() ) - { - bDrawn = mpGraphics->DrawGradient( rPolyPoly, rGradient, this ); - } - - if ( !bDrawn && rPolyPoly.Count() && rPolyPoly[ 0 ].GetSize() ) + if ( rPolyPoly.Count() && rPolyPoly[ 0 ].GetSize() ) { if ( mnDrawMode & ( DRAWMODE_BLACKGRADIENT | DRAWMODE_WHITEGRADIENT | DRAWMODE_SETTINGSGRADIENT) ) { @@ -95,6 +88,9 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly, // do nothing if the rectangle is empty if ( !aRect.IsEmpty() ) { + tools::PolyPolygon aClipPolyPoly( ImplLogicToDevicePixel( rPolyPoly ) ); + bool bDrawn = false; + if( !mpGraphics && !AcquireGraphics() ) return; @@ -105,10 +101,11 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly, if( mbInitClipRegion ) InitClipRegion(); - if( !mbOutputClipped ) - { - tools::PolyPolygon aClipPolyPoly( ImplLogicToDevicePixel( rPolyPoly ) ); + // try to draw gradient natively + bDrawn = mpGraphics->DrawGradient( aClipPolyPoly, aGradient, this ); + if( !bDrawn && !mbOutputClipped ) + { // draw gradients without border if( mbLineColor || mbInitLineColor ) { |