summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2010-12-08 11:18:06 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-12-08 11:31:08 (GMT)
commiteb2bd43078c1bb43481aab795f92e105fa130860 (patch)
tree764f1cf8111d8d2fa6b4614324f0b8d666031039 /src
parentd5383440d1a3e0d96cfcfa754aaefe9d30f2e022 (diff)
downloadQt-eb2bd43078c1bb43481aab795f92e105fa130860.zip
Qt-eb2bd43078c1bb43481aab795f92e105fa130860.tar.gz
Qt-eb2bd43078c1bb43481aab795f92e105fa130860.tar.bz2
Revert "qgrayraster: Speed up rendering of small cubic splines."
This reverts commit a9c0fbd5e946ae6e90b6db6dd4aea64c824a4066. The subdivision code in the above commit messed up subdivision of cubic beziers, so we have to revert it. Task-number: QTBUG-15660 Reviewed-by: Andreas Kling
Diffstat (limited to 'src')
-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..5d665cd 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->x + 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 );