freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] master f27b483: * src/raster/ftraster.c (Render_Single_Pass)


From: Werner Lemberg
Subject: [freetype2] master f27b483: * src/raster/ftraster.c (Render_Single_Pass): Simplify `band_stack'.
Date: Wed, 30 Jun 2021 10:55:37 -0400 (EDT)

branch: master
commit f27b4834b7dcf9d667fd5173106be0cddb0ec1c2
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>

    * src/raster/ftraster.c (Render_Single_Pass): Simplify `band_stack'.
---
 ChangeLog             |  4 ++++
 src/raster/ftraster.c | 26 +++++---------------------
 2 files changed, 9 insertions(+), 21 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9a2cabc..a1de346 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2021-06-30  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       * src/raster/ftraster.c (Render_Single_Pass): Simplify `band_stack'.
+
 2021-06-29  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
        [raster] Do not skip the second pass without dropout control.
diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index 74c2908..fbcf8d2 100644
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -366,16 +366,6 @@
   typedef PProfile*  PProfileList;
 
 
-  /* Simple record used to implement a stack of bands, required */
-  /* by the sub-banding mechanism                               */
-  typedef struct  black_TBand_
-  {
-    Int  y_min;   /* band's minimum */
-    Int  y_max;   /* band's maximum */
-
-  } black_TBand;
-
-
 #define AlignProfileSize \
   ( ( sizeof ( TProfile ) + sizeof ( Alignment ) - 1 ) / sizeof ( Long ) )
 
@@ -3027,9 +3017,7 @@
   {
     Int  y_mid;
     Int  band_top = 0;
-
-    black_TBand  band_stack[16];    /* band stack used for sub-banding     */
-                                    /* enough for signed short bands       */
+    Int  band_stack[32];  /* enough to bisect 32-bit int bands */
 
 
     while ( 1 )
@@ -3053,12 +3041,8 @@
 
         y_mid = ( y_min + y_max ) >> 1;
 
-        band_stack[band_top].y_min = y_min;
-        band_stack[band_top].y_max = y_mid;
-
-        band_top++;
-
-        y_min = y_mid + 1;
+        band_stack[band_top++] = y_min;
+        y_min                  = y_mid + 1;
       }
       else
       {
@@ -3069,8 +3053,8 @@
         if ( --band_top < 0 )
           break;
 
-        y_min = band_stack[band_top].y_min;
-        y_max = band_stack[band_top].y_max;
+        y_max = y_min - 1;
+        y_min = band_stack[band_top];
       }
     }
 



reply via email to

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