freetype-commit
[Top][All Lists]
Advanced

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

[freetype2-demos] master d328e9e 20/22: * graph/gblany.h, graph/gblblit.


From: Werner Lemberg
Subject: [freetype2-demos] master d328e9e 20/22: * graph/gblany.h, graph/gblblit.c: Multiply by 0x010101U.
Date: Fri, 5 Mar 2021 11:18:41 -0500 (EST)

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

    * graph/gblany.h, graph/gblblit.c: Multiply by 0x010101U.
---
 ChangeLog       |  4 ++++
 graph/gblany.h  | 16 ++++------------
 graph/gblblit.c |  2 +-
 3 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d29fceb..93136bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2021-02-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+       * graph/gblany.h, graph/gblblit.c: Multiply by 0x010101U.
+
 2021-02-24  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
        PNG writing routines using GDI+.
diff --git a/graph/gblany.h b/graph/gblany.h
index c95df78..e826915 100644
--- a/graph/gblany.h
+++ b/graph/gblany.h
@@ -175,9 +175,7 @@ GCONCAT( _gblender_blit_hrgb_, GDST_TYPE )( GBlenderBlit  
blit,
       {
         /* nothing */
       }
-      else if ( aa == (((GBLENDER_SHADE_COUNT-1) << 16) |
-                       ((GBLENDER_SHADE_COUNT-1) << 8)  |
-                        (GBLENDER_SHADE_COUNT-1)        ) )
+      else if ( aa == (GBLENDER_SHADE_COUNT-1) * 0x010101U )
       {
         GDST_COPY(dst);
       }
@@ -239,9 +237,7 @@ GCONCAT( _gblender_blit_hbgr_, GDST_TYPE )( GBlenderBlit  
blit,
       {
         /* nothing */
       }
-      else if ( aa == (((GBLENDER_SHADE_COUNT-1) << 16) |
-                       ((GBLENDER_SHADE_COUNT-1) << 8)  |
-                        (GBLENDER_SHADE_COUNT-1)        ) )
+      else if ( aa == (GBLENDER_SHADE_COUNT-1) * 0x010101U )
       {
         GDST_COPY(dst);
       }
@@ -304,9 +300,7 @@ GCONCAT( _gblender_blit_vrgb_, GDST_TYPE )( GBlenderBlit  
blit,
       {
         /* nothing */
       }
-      else if ( aa == (((GBLENDER_SHADE_COUNT-1) << 16) |
-                       ((GBLENDER_SHADE_COUNT-1) << 8)  |
-                        (GBLENDER_SHADE_COUNT-1)        ) )
+      else if ( aa == (GBLENDER_SHADE_COUNT-1) * 0x010101U )
       {
         GDST_COPY(dst);
       }
@@ -369,9 +363,7 @@ GCONCAT( _gblender_blit_vbgr_, GDST_TYPE )( GBlenderBlit  
blit,
       {
         /* nothing */
       }
-      else if ( aa == (((GBLENDER_SHADE_COUNT-1) << 16) |
-                       ((GBLENDER_SHADE_COUNT-1) << 8)  |
-                        (GBLENDER_SHADE_COUNT-1)        ) )
+      else if ( aa == (GBLENDER_SHADE_COUNT-1) * 0x010101U )
       {
         GDST_COPY(dst);
       }
diff --git a/graph/gblblit.c b/graph/gblblit.c
index 0bc81df..f626b16 100644
--- a/graph/gblblit.c
+++ b/graph/gblblit.c
@@ -71,7 +71,7 @@
 
 #define  GRGB_TO_GRAY8(r,g,b)  ( (unsigned char)( ( 3*(r) + 6*(g) + (b) ) / 10 
) )
 
-#define  GGRAY8_TO_RGB24(p)    GRGB_PACK(p,p,p)
+#define  GGRAY8_TO_RGB24(p)   ( (p) * 0x010101U )
 
 #define  GRGB24_TO_GRAY8(p)   ( (unsigned char)( ( 3*( ((p) >> 16) & 0xFF ) +  
       \
                                                    6*( ((p) >>  8) & 0xFF ) +  
       \



reply via email to

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