Kaydet (Commit) 1987cdea authored tarafından Chris Sherlock's avatar Chris Sherlock

Fix gradient regressions

1. Fix regression 8659d189 - rect. gradients no longer do grayscale

In commit 8659d189 I swapped the passing
parameters going to ImplComplexGradient and ImplLinearGradient from
aGradient (the copy) to rGradient (the original which didn't have the
grayscale applied).

2. Fix regression 954d7ad4 - grayscale applied at wrong time

In commit 954d7ad4 grayscale was applied
in DrawGradient (Rectangle &rRect...) after the gradient was written to
the metafile. I was attempting to bring it into line with what
DrawGradient (PolyPolygon &rPolyPoly...) does. However, it remains to be
seen if that's actually doing the right thing - so best to revert this
as in all likelihood I may have caused a regression with grayscaled
gradients

Change-Id: Id94549b3366adb8fcf3cddc59d30029579430a30
Reviewed-on: https://gerrit.libreoffice.org/8908Reviewed-by: 's avatarChris Sherlock <chris.sherlock79@gmail.com>
Tested-by: 's avatarChris Sherlock <chris.sherlock79@gmail.com>
üst bf621a2e
......@@ -631,17 +631,17 @@ void OutputDevice::DrawGradient( const Rectangle& rRect,
Gradient aGradient( rGradient );
if ( mnDrawMode & ( DRAWMODE_GRAYGRADIENT | DRAWMODE_GHOSTEDGRADIENT ) )
{
SetGrayscaleColors( aGradient );
}
if( mpMetaFile )
mpMetaFile->AddAction( new MetaGradientAction( rRect, aGradient ) );
if( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
return;
if ( mnDrawMode & ( DRAWMODE_GRAYGRADIENT | DRAWMODE_GHOSTEDGRADIENT ) )
{
SetGrayscaleColors( aGradient );
}
if ( !Rectangle( PixelToLogic( Point() ), GetOutputSize() ).IsEmpty() )
{
// convert rectangle to pixels
......@@ -685,9 +685,9 @@ void OutputDevice::DrawGradient( const Rectangle& rRect,
aGradient.SetSteps( GRADIENT_DEFAULT_STEPCOUNT );
if( aGradient.GetStyle() == GradientStyle_LINEAR || aGradient.GetStyle() == GradientStyle_AXIAL )
ImplDrawLinearGradient( aRect, rGradient, false, NULL );
ImplDrawLinearGradient( aRect, aGradient, false, NULL );
else
ImplDrawComplexGradient( aRect, rGradient, false, NULL );
ImplDrawComplexGradient( aRect, aGradient, false, NULL );
}
Pop();
......
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