[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] gsoc-anurag-2022 467ba6653 1/2: Add fontdue optimization
From: |
Werner Lemberg |
Subject: |
[freetype2] gsoc-anurag-2022 467ba6653 1/2: Add fontdue optimization |
Date: |
Tue, 18 Oct 2022 16:23:44 -0400 (EDT) |
branch: gsoc-anurag-2022
commit 467ba66539d6f6ce69151e9ef68bc8c2b6062587
Author: Anurag Thakur <anurag105csec21@bpitindia.edu.in>
Commit: Anurag Thakur <anurag105csec21@bpitindia.edu.in>
Add fontdue optimization
---
src/dense/ftdense.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] gsoc-anurag-2022 467ba6653 1/2: Add fontdue optimization,
Werner Lemberg <=