From 464d895c9997d35c223899165586f1d3a276f054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 28 Sep 2010 14:53:01 +0200 Subject: Small optimizations the gray raster for 64-bit. The gray raster uses long to ensure having 32-bit integers since it was originally designed to work on 16-bit platforms as well. On 64-bit platforms switching to use int instead of long gives a performance boost of ~10 % or so depending on the use case. Reviewed-by: Yoann Lopes --- src/gui/painting/qgrayraster.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/painting/qgrayraster.c b/src/gui/painting/qgrayraster.c index 94039fb..f348f7f 100644 --- a/src/gui/painting/qgrayraster.c +++ b/src/gui/painting/qgrayraster.c @@ -233,7 +233,7 @@ /* new algorithms */ typedef int TCoord; /* integer scanline/pixel coordinate */ - typedef long TPos; /* sub-pixel coordinate */ + typedef int TPos; /* sub-pixel coordinate */ /* determine the type used to store cell areas. This normally takes at */ /* least PIXEL_BITS*2 + 1 bits. On 16-bit systems, we need to use */ @@ -538,7 +538,7 @@ TCoord y2 ) { TCoord ex1, ex2, fx1, fx2, delta; - long p, first, dx; + int p, first, dx; int incr, lift, mod, rem; @@ -643,7 +643,7 @@ { TCoord ey1, ey2, fy1, fy2; TPos dx, dy, x, x2; - long p, first; + int p, first; int delta, rem, mod, lift, incr; @@ -1670,7 +1670,7 @@ { PCell cells_max; int yindex; - long cell_start, cell_end, cell_mod; + int cell_start, cell_end, cell_mod; ras.ycells = (PCell*)ras.buffer; -- cgit v0.12