shithub: freetype+ttf2subf

Download patch

ref: b070264521386666dd0cbbedec469c84b26489ba
parent: 967a34eee3fd34f496366ed1283ab5268d23690a
author: Alexei Podtelezhnikov <apodtele@gmail.com>
date: Mon May 10 18:06:01 EDT 2021

* src/smooth/ftgrays.c (gray_hline): Simplify even-odd computations.

It is too bad the even-odd rule is not used much.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-05-10  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+	* src/smooth/ftgrays.c (gray_hline): Simplify even-odd computations.
+
+	It is too bad the even-odd rule is not used much.
+
 2021-05-07  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
 	[type1] Avoid MM memory zeroing.
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -1182,10 +1182,10 @@
     /* compute the line's coverage depending on the outline fill rule */
     if ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL )
     {
-      coverage &= 511;
+      if ( coverage & 256 )  /* odd bit */
+        coverage = ~coverage;
 
-      if ( coverage >= 256 )
-        coverage = 511 - coverage;
+      /* higher bits discarded below */
     }
     else  /* default non-zero winding rule */
     {