Kaydet (Commit) 05fb3136 authored tarafından Chris Sherlock's avatar Chris Sherlock

Exit out of DrawGradient that uses PolyPolygon much faster

There are two DrawGradient(...) functions in OutputDevice. One uses
a PolyPolygon, the other uses a Rectangle. The Rectangle version
exits out a lot faster, the PolyPolygon one seems to try to getting
clipping regions and a Graphics instance first which is entirely
unnecessary if the drawing mode is DRAWMODE_NOGRADIENT! Therefore,
I'm bailing out of this function much faster, bring the two functions
into line with each other.

Change-Id: I882862ab82a93c2c9dfd5fc86f2507926d28aaea
üst 54687db0
......@@ -554,7 +554,9 @@ void OutputDevice::DrawGradient( const Rectangle& rRect,
{
if ( mnDrawMode & DRAWMODE_NOGRADIENT )
return;
{
return; // nothing to draw!
}
else if ( mnDrawMode & ( DRAWMODE_BLACKGRADIENT | DRAWMODE_WHITEGRADIENT | DRAWMODE_SETTINGSGRADIENT) )
{
Color aColor;
......@@ -801,6 +803,8 @@ void OutputDevice::XORClipAndDrawGradient ( Gradient &rGradient, const PolyPolyg
void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
const Gradient& rGradient )
{
if ( mnDrawMode & DRAWMODE_NOGRADIENT )
return; // nothing to draw!
if( mbInitClipRegion )
ImplInitClipRegion();
......@@ -812,7 +816,7 @@ void OutputDevice::DrawGradient( const PolyPolygon& rPolyPoly,
if( !ImplGetGraphics() )
return;
if( rPolyPoly.Count() && rPolyPoly[ 0 ].GetSize() && !( mnDrawMode & DRAWMODE_NOGRADIENT ) )
if( rPolyPoly.Count() && rPolyPoly[ 0 ].GetSize() )
{
if ( mnDrawMode & ( DRAWMODE_BLACKGRADIENT | DRAWMODE_WHITEGRADIENT | DRAWMODE_SETTINGSGRADIENT) )
{
......
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