ref: 85168499774b3b34f5be8a9fcecacfbb25bff18b
parent: fedd945c3ea10a86321c7503945b80454ce18956
author: Alexei Podtelezhnikov <apodtele@gmail.com>
date: Tue Mar 9 17:14:44 EST 2021
* src/smooth/ftgrays.c (gray_render_line): Rearrange conditionals. These produce faster or more optimizable code.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-03-09 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * src/smooth/ftgrays.c (gray_render_line): Rearrange conditionals.
+
+ These produce faster or more optimizable code.
+
2021-03-08 Tim-Philipp Müller <tim@centricular.com>
[meson] Fix 'mmap' handling on Windows.
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -912,8 +912,8 @@
/* also easily updated when moving from one cell to the next. */
do
{
- if ( prod <= 0 &&
- prod - dx * ONE_PIXEL > 0 ) /* left */
+ if ( prod - dx * ONE_PIXEL > 0 &&
+ prod <= 0 ) /* left */
{
fx2 = 0;
fy2 = FT_UDIV( -prod, -dx );
@@ -924,8 +924,8 @@
fy1 = fy2;
ex1--;
}
- else if ( prod - dx * ONE_PIXEL <= 0 &&
- prod - dx * ONE_PIXEL + dy * ONE_PIXEL > 0 ) /* up */
+ else if ( prod - dx * ONE_PIXEL + dy * ONE_PIXEL > 0 &&
+ prod - dx * ONE_PIXEL <= 0 ) /* up */
{
prod -= dx * ONE_PIXEL;
fx2 = FT_UDIV( -prod, dy );
@@ -936,8 +936,8 @@
fy1 = 0;
ey1++;
}
- else if ( prod - dx * ONE_PIXEL + dy * ONE_PIXEL <= 0 &&
- prod + dy * ONE_PIXEL >= 0 ) /* right */
+ else if ( prod + dy * ONE_PIXEL >= 0 &&
+ prod - dx * ONE_PIXEL + dy * ONE_PIXEL <= 0 ) /* right */
{
prod += dy * ONE_PIXEL;
fx2 = ONE_PIXEL;
@@ -948,8 +948,8 @@
fy1 = fy2;
ex1++;
}
- else /* ( prod + dy * ONE_PIXEL < 0 &&
- prod > 0 ) down */
+ else /* ( prod > 0 &&
+ prod + dy * ONE_PIXEL < 0 ) down */
{
fx2 = FT_UDIV( prod, -dy );
fy2 = 0;