Kaydet (Commit) 0d6bc700 authored tarafından Chris Sherlock's avatar Chris Sherlock

Rearrange OutputDevice's gradient functions

Rearranged gradient functions in outdev.hxx to group them together,
also renamed ImplGetGradientSteps to GetGradientSteps and
ImplGetGradientStepCount to GetGradientStepCount.

Change-Id: I98ea0d177531e50b9bdc097df15cfb93d26474e7
üst 655443b4
......@@ -735,31 +735,6 @@ public:
SAL_DLLPRIVATE void ImplDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyPolygon& rB2DPolyPoly);
///@}
/** @name Gradient functions
*/
///@{
public:
void DrawGradient( const Rectangle& rRect, const Gradient& rGradient );
void DrawGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient );
void AddGradientActions(
const Rectangle& rRect,
const Gradient& rGradient,
GDIMetaFile& rMtf );
protected:
virtual long ImplGetGradientStepCount( long nMinRect );
private:
SAL_DLLPRIVATE void DrawLinearGradient( const Rectangle& rRect, const Gradient& rGradient, bool bMtf, const PolyPolygon* pClipPolyPoly );
SAL_DLLPRIVATE void DrawComplexGradient( const Rectangle& rRect, const Gradient& rGradient, bool bMtf, const PolyPolygon* pClipPolyPoly );
SAL_DLLPRIVATE long ImplGetGradientSteps( const Gradient& rGradient, const Rectangle& rRect, bool bMtf, bool bComplex=false );
SAL_DLLPRIVATE Color GetSingleColorGradientFill();
SAL_DLLPRIVATE void SetGrayscaleColors( Gradient &rGradient );
///@}
public:
/** @name Hatch functions
*/
......@@ -1029,13 +1004,6 @@ public:
void DrawRect( const Rectangle& rRect );
void DrawRect( const Rectangle& rRect,
sal_uLong nHorzRount, sal_uLong nVertRound );
void DrawEllipse( const Rectangle& rRect );
void DrawArc( const Rectangle& rRect,
const Point& rStartPt, const Point& rEndPt );
void DrawPie( const Rectangle& rRect,
const Point& rStartPt, const Point& rEndPt );
void DrawChord( const Rectangle& rRect,
const Point& rStartPt, const Point& rEndPt );
virtual void DrawOutDev( const Point& rDestPt, const Size& rDestSize,
const Point& rSrcPt, const Size& rSrcSize );
......@@ -1177,6 +1145,49 @@ private:
const long* pMapY );
///@}
public:
/** @name Curved shape functions
*/
///@{
void DrawEllipse( const Rectangle& rRect );
void DrawArc( const Rectangle& rRect,
const Point& rStartPt, const Point& rEndPt );
void DrawPie( const Rectangle& rRect,
const Point& rStartPt, const Point& rEndPt );
void DrawChord( const Rectangle& rRect,
const Point& rStartPt, const Point& rEndPt );
///@}
public:
/** @name Gradient functions
*/
///@{
void DrawGradient( const Rectangle& rRect, const Gradient& rGradient );
void DrawGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient );
void AddGradientActions(
const Rectangle& rRect,
const Gradient& rGradient,
GDIMetaFile& rMtf );
protected:
virtual long GetGradientStepCount( long nMinRect );
private:
SAL_DLLPRIVATE void DrawLinearGradient( const Rectangle& rRect, const Gradient& rGradient, bool bMtf, const PolyPolygon* pClipPolyPoly );
SAL_DLLPRIVATE void DrawComplexGradient( const Rectangle& rRect, const Gradient& rGradient, bool bMtf, const PolyPolygon* pClipPolyPoly );
SAL_DLLPRIVATE long GetGradientSteps( const Gradient& rGradient, const Rectangle& rRect, bool bMtf, bool bComplex=false );
SAL_DLLPRIVATE Color GetSingleColorGradientFill();
SAL_DLLPRIVATE void SetGrayscaleColors( Gradient &rGradient );
///@}
public:
void DrawMask( const Point& rDestPt,
const Bitmap& rBitmap, const Color& rMaskColor );
......
......@@ -271,7 +271,7 @@ public:
SAL_DLLPRIVATE void ImplEndPage();
protected:
long ImplGetGradientStepCount( long nMinRect ) SAL_OVERRIDE;
virtual long GetGradientStepCount( long nMinRect ) SAL_OVERRIDE;
virtual bool UsePolyPolygonForComplexGradient() SAL_OVERRIDE;
void ScaleBitmap ( Bitmap&, SalTwoRect& ) SAL_OVERRIDE { };
......
......@@ -953,7 +953,7 @@ void Printer::ImplUpdateFontList()
ImplUpdateFontData( true );
}
long Printer::ImplGetGradientStepCount( long nMinRect )
long Printer::GetGradientStepCount( long nMinRect )
{
// use display-equivalent step size calculation
long nInc = (nMinRect < 800) ? 10 : 20;
......
......@@ -278,7 +278,7 @@ void OutputDevice::DrawLinearGradient( const Rectangle& rRect,
}
// calculate step count
long nStepCount = ImplGetGradientSteps( rGradient, aRect, bMtf );
long nStepCount = GetGradientSteps( rGradient, aRect, bMtf );
// minimal three steps and maximal as max color steps
long nAbsRedSteps = std::abs( nEndRed - nStartRed );
......@@ -402,7 +402,7 @@ void OutputDevice::DrawComplexGradient( const Rectangle& rRect,
pPolyPoly.reset(new PolyPolygon( 2 ));
// last parameter - true if complex gradient, false if linear
long nStepCount = ImplGetGradientSteps( rGradient, rRect, bMtf, true );
long nStepCount = GetGradientSteps( rGradient, rRect, bMtf, true );
// at least three steps and at most the number of colour differences
long nSteps = std::max( nStepCount, 2L );
......@@ -554,14 +554,14 @@ void OutputDevice::DrawComplexGradient( const Rectangle& rRect,
}
}
long OutputDevice::ImplGetGradientStepCount( long nMinRect )
long OutputDevice::GetGradientStepCount( long nMinRect )
{
long nInc = (nMinRect < 50) ? 2 : 4;
return nInc;
}
long OutputDevice::ImplGetGradientSteps( const Gradient& rGradient, const Rectangle& rRect, bool bMtf, bool bComplex )
long OutputDevice::GetGradientSteps( const Gradient& rGradient, const Rectangle& rRect, bool bMtf, bool bComplex )
{
// calculate step count
long nStepCount = rGradient.GetSteps();
......@@ -577,7 +577,7 @@ long OutputDevice::ImplGetGradientSteps( const Gradient& rGradient, const Rectan
{
long nInc;
nInc = ImplGetGradientStepCount (nMinRect);
nInc = GetGradientStepCount (nMinRect);
if ( !nInc || bMtf )
nInc = 1;
nStepCount = nMinRect / nInc;
......
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