diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-04-14 18:17:50 +1000 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-04-16 07:33:52 +1000 |
commit | 96cdea537fadab0e927ab98e2a6ff3216315ee7e (patch) | |
tree | d169688ff72c7d81ca009a644a94928b20b601be /vcl | |
parent | 96d5e016e1ab6dd873d67a6f389048b013bb49c3 (diff) |
Reorganize locations of functions in gradient.cxx
Change-Id: Ibce763ab4397c4ca4ebce0b25322c249f36499e2
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/outdev/gradient.cxx | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/vcl/source/gdi/outdev/gradient.cxx b/vcl/source/gdi/outdev/gradient.cxx index f9889a65b613..a109b80d9440 100644 --- a/vcl/source/gdi/outdev/gradient.cxx +++ b/vcl/source/gdi/outdev/gradient.cxx @@ -177,48 +177,6 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly, mpAlphaVDev->DrawPolyPolygon( rPolyPoly ); } -inline sal_uInt8 ImplGetGradientColorValue( long nValue ) -{ - if ( nValue < 0 ) - return 0; - else if ( nValue > 0xFF ) - return 0xFF; - else - return (sal_uInt8)nValue; -} - -long OutputDevice::ImplGetGradientStepCount( long nMinRect ) -{ - long nInc = (nMinRect < 50) ? 2 : 4; - - return nInc; -} - -long OutputDevice::ImplGetGradientSteps( const Gradient& rGradient, const Rectangle& rRect, bool bMtf, bool bComplex ) -{ - // calculate step count - long nStepCount = rGradient.GetSteps(); - long nMinRect; - - // generate nStepCount, if not passed - if (bComplex) - nMinRect = std::min( rRect.GetWidth(), rRect.GetHeight() ); - else - nMinRect = rRect.GetHeight(); - - if ( !nStepCount ) - { - long nInc; - - nInc = ImplGetGradientStepCount (nMinRect); - if ( !nInc || bMtf ) - nInc = 1; - nStepCount = nMinRect / nInc; - } - - return nStepCount; -} - void OutputDevice::ImplDrawLinearGradient( const Rectangle& rRect, const Gradient& rGradient, bool bMtf, const PolyPolygon* pClipPolyPoly ) @@ -598,6 +556,48 @@ void OutputDevice::ImplDrawComplexGradient( const Rectangle& rRect, } } +inline sal_uInt8 ImplGetGradientColorValue( long nValue ) +{ + if ( nValue < 0 ) + return 0; + else if ( nValue > 0xFF ) + return 0xFF; + else + return (sal_uInt8)nValue; +} + +long OutputDevice::ImplGetGradientStepCount( long nMinRect ) +{ + long nInc = (nMinRect < 50) ? 2 : 4; + + return nInc; +} + +long OutputDevice::ImplGetGradientSteps( const Gradient& rGradient, const Rectangle& rRect, bool bMtf, bool bComplex ) +{ + // calculate step count + long nStepCount = rGradient.GetSteps(); + long nMinRect; + + // generate nStepCount, if not passed + if (bComplex) + nMinRect = std::min( rRect.GetWidth(), rRect.GetHeight() ); + else + nMinRect = rRect.GetHeight(); + + if ( !nStepCount ) + { + long nInc; + + nInc = ImplGetGradientStepCount (nMinRect); + if ( !nInc || bMtf ) + nInc = 1; + nStepCount = nMinRect / nInc; + } + + return nStepCount; +} + Color OutputDevice::GetSingleColorGradientFill() { Color aColor; |