summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <lfrb@collabora.com>2014-11-19 10:09:42 -0500
committerLouis-Francis Ratté-Boulianne <lfrb@collabora.com>2014-11-19 10:09:42 -0500
commit738f3b4e026ec4d57d7de691df9d253f4497d9b0 (patch)
tree0832ff27dfb4c49cf9d6297b7d5e3dece805874a
parent483a43df80569285006c4f8876508d8aa2a88a6d (diff)
vcl: Apply the OutputDevice transformation to the gradient clipping polygon
Change-Id: I16845c6cb0c110749112d608c209020f21549e70
-rw-r--r--vcl/opengl/gdiimpl.cxx1
-rw-r--r--vcl/source/outdev/gradient.cxx19
2 files changed, 8 insertions, 12 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index c008cc2470b3..53c7ce090c5f 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 )
{