diff options
author | Anurag Thakur <anurag105csec21@bpitindia.edu.in> | 2022-10-19 00:51:07 +0530 |
---|---|---|
committer | Anurag Thakur <anurag105csec21@bpitindia.edu.in> | 2022-10-19 00:51:07 +0530 |
commit | 467ba66539d6f6ce69151e9ef68bc8c2b6062587 (patch) | |
tree | f6d17ecae2d921e13fd6b29dac8feefd47f03e2c | |
parent | 17d14a6cefd8909666890e9082f54b2f5a2680f2 (diff) | |
download | freetype2-467ba66539d6f6ce69151e9ef68bc8c2b6062587.tar.gz |
Add fontdue optimization
-rw-r--r-- | src/dense/ftdense.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/dense/ftdense.c b/src/dense/ftdense.c index b81eaf447..f86d92aab 100644 --- a/src/dense/ftdense.c +++ b/src/dense/ftdense.c @@ -133,6 +133,51 @@ dense_render_line( dense_worker* worker, TPos tox, TPos toy ) } + if(deltax == 0){ + FT26D6 x = from_x; + int x0i = x>>6; + FT26D6 x0floor = x0i<<6; + + // y-coordinate of first pixel of line + int y0 = from_y>>6; + + // y-coordinate of last pixel of line + int y_limit = (to_y + 0x3f)>>6; + FT20D12* m_a = worker->m_a; + + + + for ( int y = y0; y < y_limit; y++ ) + { + int linestart = y * worker->m_w; + + FT26D6 dy = min( (y + 1)<<6, to_y ) - max( y<<6, from_y ); + + m_a[linestart + x0i] += dir*dy*(64 - x + x0floor); + m_a[linestart + ( x0i + 1 )] += dir*dy*(x-x0floor); + + } + + // int y = y0; + + // int linestart = y * worker->m_w; + + // FT26D6 dy1 = min( (y + 1)<<6, to_y ) - max( y<<6, from_y ); + // m_a[linestart + x0i] += dir*dy1*(64 - x + x0floor); + // m_a[linestart + ( x0i + 1 )] += dir*dy1*(x-x0floor); + + // y = y_limit -1; + + // linestart = y * worker->m_w; + + // FT26D6 dy2 = min( (y + 1)<<6, to_y ) - max( y<<6, from_y ); + // m_a[linestart + x0i] += dir*dy2*(64 - x + x0floor); + // m_a[linestart + ( x0i + 1 )] += dir*dy2*(x-x0floor); + + + + }else{ + FT26D6 x = from_x; // y-coordinate of first pixel of line @@ -230,6 +275,7 @@ dense_render_line( dense_worker* worker, TPos tox, TPos toy ) } x = xnext; } + } } static int |