Am remarking out some Debugs that would only be useful to someone debugging image code. Of no use to end users and get called so much that must cause a performance problem, especially when debug logging is actually turned on

This commit is contained in:
Isaac Connor 2014-09-18 15:44:53 -04:00
parent d1b1c35e48
commit c9e04e48bb
1 changed files with 9 additions and 9 deletions

View File

@ -2088,10 +2088,10 @@ void Image::Outline( Rgb colour, const Polygon &polygon )
double grad; double grad;
Debug( 9, "dx: %.2lf, dy: %.2lf", dx, dy ); //Debug( 9, "dx: %.2lf, dy: %.2lf", dx, dy );
if ( fabs(dx) <= fabs(dy) ) if ( fabs(dx) <= fabs(dy) )
{ {
Debug( 9, "dx <= dy" ); //Debug( 9, "dx <= dy" );
if ( y1 != y2 ) if ( y1 != y2 )
grad = dx/dy; grad = dx/dy;
else else
@ -2102,10 +2102,10 @@ void Image::Outline( Rgb colour, const Polygon &polygon )
grad *= yinc; grad *= yinc;
if ( colours == ZM_COLOUR_GRAY8 ) if ( colours == ZM_COLOUR_GRAY8 )
{ {
Debug( 9, "x1:%d, x2:%d, y1:%d, y2:%d, gr:%.2f", x1, x2, y1, y2, grad ); //Debug( 9, "x1:%d, x2:%d, y1:%d, y2:%d, gr:%.2f", x1, x2, y1, y2, grad );
for ( x = x1, y = y1; y != y2; y += yinc, x += grad ) for ( x = x1, y = y1; y != y2; y += yinc, x += grad )
{ {
Debug( 9, "x:%.2f, y:%d", x, y ); //Debug( 9, "x:%.2f, y:%d", x, y );
buffer[(y*width)+int(round(x))] = colour; buffer[(y*width)+int(round(x))] = colour;
} }
} }
@ -2129,22 +2129,22 @@ void Image::Outline( Rgb colour, const Polygon &polygon )
} }
else else
{ {
Debug( 9, "dx > dy" ); //Debug( 9, "dx > dy" );
if ( x1 != x2 ) if ( x1 != x2 )
grad = dy/dx; grad = dy/dx;
else else
grad = height; grad = height;
Debug( 9, "grad: %.2lf", grad ); //Debug( 9, "grad: %.2lf", grad );
double y; double y;
int x, xinc = (x1<x2)?1:-1; int x, xinc = (x1<x2)?1:-1;
grad *= xinc; grad *= xinc;
if ( colours == ZM_COLOUR_GRAY8 ) if ( colours == ZM_COLOUR_GRAY8 )
{ {
Debug( 9, "x1:%d, x2:%d, y1:%d, y2:%d, gr:%.2lf", x1, x2, y1, y2, grad ); //Debug( 9, "x1:%d, x2:%d, y1:%d, y2:%d, gr:%.2lf", x1, x2, y1, y2, grad );
for ( y = y1, x = x1; x != x2; x += xinc, y += grad ) for ( y = y1, x = x1; x != x2; x += xinc, y += grad )
{ {
Debug( 9, "x:%d, y:%.2f", x, y ); //Debug( 9, "x:%d, y:%.2f", x, y );
buffer[(int(round(y))*width)+x] = colour; buffer[(int(round(y))*width)+x] = colour;
} }
} }
@ -2194,7 +2194,7 @@ void Image::Fill( Rgb colour, int density, const Polygon &polygon )
int y1 = p1.Y(); int y1 = p1.Y();
int y2 = p2.Y(); int y2 = p2.Y();
Debug( 9, "x1:%d,y1:%d x2:%d,y2:%d", x1, y1, x2, y2 ); //Debug( 9, "x1:%d,y1:%d x2:%d,y2:%d", x1, y1, x2, y2 );
if ( y1 == y2 ) if ( y1 == y2 )
continue; continue;