summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qgrayraster.c
diff options
context:
space:
mode:
authorGeir Vattekar <geir.vattekar@nokia.com>2010-12-09 11:43:04 (GMT)
committerGeir Vattekar <geir.vattekar@nokia.com>2010-12-09 11:43:04 (GMT)
commit3b20e58b9494549713b492e35af6531b4bc179c9 (patch)
tree9ae3fb2e2d02a78f6f2fe36adaad364170fd704c /src/gui/painting/qgrayraster.c
parentbd4ac06eb3c8ac3a9044689481873ce91aeb3180 (diff)
parent91518478d32a5d5ce188b02f92e744fc782dd687 (diff)
downloadQt-3b20e58b9494549713b492e35af6531b4bc179c9.zip
Qt-3b20e58b9494549713b492e35af6531b4bc179c9.tar.gz
Qt-3b20e58b9494549713b492e35af6531b4bc179c9.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-doc-team into 4.7
Diffstat (limited to 'src/gui/painting/qgrayraster.c')
-rw-r--r--src/gui/painting/qgrayraster.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/gui/painting/qgrayraster.c b/src/gui/painting/qgrayraster.c
index ec9ebeb..001345f 100644
--- a/src/gui/painting/qgrayraster.c
+++ b/src/gui/painting/qgrayraster.c
@@ -963,49 +963,53 @@
const QT_FT_Vector* control2,
const QT_FT_Vector* to )
{
+ TPos dx, dy, da, db;
int top, level;
int* levels;
QT_FT_Vector* arc;
- int mid_x = ( DOWNSCALE( ras.x ) + to->x +
- 3 * (control1->x + control2->x ) ) / 8;
- int mid_y = ( DOWNSCALE( ras.y ) + to->y +
- 3 * (control1->y + control2->y ) ) / 8;
- TPos dx = DOWNSCALE( ras.x ) + to->x - ( mid_x << 1 );
- TPos dy = DOWNSCALE( ras.y ) + to->y - ( mid_y << 1 );
+ dx = DOWNSCALE( ras.x ) + to->x - ( control1->x << 1 );
if ( dx < 0 )
dx = -dx;
+ dy = DOWNSCALE( ras.y ) + to->y - ( control1->y << 1 );
if ( dy < 0 )
dy = -dy;
if ( dx < dy )
dx = dy;
+ da = dx;
+
+ dx = DOWNSCALE( ras.x ) + to->x - 3 * ( control1->x + control2->x );
+ if ( dx < 0 )
+ dx = -dx;
+ dy = DOWNSCALE( ras.y ) + to->y - 3 * ( control1->y + control2->y );
+ if ( dy < 0 )
+ dy = -dy;
+ if ( dx < dy )
+ dx = dy;
+ db = dx;
level = 1;
- dx /= ras.cubic_level;
- while ( dx > 0 )
+ da = da / ras.cubic_level;
+ db = db / ras.conic_level;
+ while ( da > 0 || db > 0 )
{
- dx >>= 2;
+ da >>= 2;
+ db >>= 3;
level++;
}
if ( level <= 1 )
{
- TPos to_x, to_y;
+ TPos to_x, to_y, mid_x, mid_y;
to_x = UPSCALE( to->x );
to_y = UPSCALE( to->y );
-
- /* Recalculation of midpoint is needed only if */
- /* UPSCALE and DOWNSCALE have any effect. */
-
-#if ( PIXEL_BITS != 6 )
mid_x = ( ras.x + to_x +
3 * UPSCALE( control1->x + control2->x ) ) / 8;
mid_y = ( ras.y + to_y +
3 * UPSCALE( control1->y + control2->y ) ) / 8;
-#endif
gray_render_line( RAS_VAR_ mid_x, mid_y );
gray_render_line( RAS_VAR_ to_x, to_y );