freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master b070264: * src/smooth/ftgrays.c (gray_hline): Simplif


From: Werner Lemberg
Subject: [freetype2] master b070264: * src/smooth/ftgrays.c (gray_hline): Simplify even-odd computations.
Date: Mon, 10 May 2021 22:07:29 -0400 (EDT)

branch: master
commit b070264521386666dd0cbbedec469c84b26489ba
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: 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.
---
 ChangeLog            | 6 ++++++
 src/smooth/ftgrays.c | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ead7ae2..a8542d2 100644
--- 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.
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index dc25669..94169a0 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -1182,10 +1182,10 @@ typedef ptrdiff_t  FT_PtrDist;
     /* 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 */
     {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]