freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype-demos][master] * graph/gblany.h, graph/gblblit.c


From: Alexei Podtelezhnikov
Subject: [Git][freetype/freetype-demos][master] * graph/gblany.h, graph/gblblit.c: Multiply by 0x010101U.
Date: Fri, 26 Feb 2021 03:44:12 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType Demo Programs

Commits:

3 changed files:

Changes:

  • ChangeLog
    1
    +2021-02-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
    
    2
    +
    
    3
    +	* graph/gblany.h, graph/gblblit.c: Multiply by 0x010101U.
    
    4
    +
    
    1 5
     2021-02-24  Alexei Podtelezhnikov  <apodtele@gmail.com>
    
    2 6
     
    
    3 7
     	PNG writing routines using GDI+.
    

  • graph/gblany.h
    ... ... @@ -175,9 +175,7 @@ GCONCAT( _gblender_blit_hrgb_, GDST_TYPE )( GBlenderBlit blit,
    175 175
           {
    
    176 176
             /* nothing */
    
    177 177
           }
    
    178
    -      else if ( aa == (((GBLENDER_SHADE_COUNT-1) << 16) |
    
    179
    -                       ((GBLENDER_SHADE_COUNT-1) << 8)  |
    
    180
    -                        (GBLENDER_SHADE_COUNT-1)        ) )
    
    178
    +      else if ( aa == (GBLENDER_SHADE_COUNT-1) * 0x010101U )
    
    181 179
           {
    
    182 180
             GDST_COPY(dst);
    
    183 181
           }
    
    ... ... @@ -239,9 +237,7 @@ GCONCAT( _gblender_blit_hbgr_, GDST_TYPE )( GBlenderBlit blit,
    239 237
           {
    
    240 238
             /* nothing */
    
    241 239
           }
    
    242
    -      else if ( aa == (((GBLENDER_SHADE_COUNT-1) << 16) |
    
    243
    -                       ((GBLENDER_SHADE_COUNT-1) << 8)  |
    
    244
    -                        (GBLENDER_SHADE_COUNT-1)        ) )
    
    240
    +      else if ( aa == (GBLENDER_SHADE_COUNT-1) * 0x010101U )
    
    245 241
           {
    
    246 242
             GDST_COPY(dst);
    
    247 243
           }
    
    ... ... @@ -304,9 +300,7 @@ GCONCAT( _gblender_blit_vrgb_, GDST_TYPE )( GBlenderBlit blit,
    304 300
           {
    
    305 301
             /* nothing */
    
    306 302
           }
    
    307
    -      else if ( aa == (((GBLENDER_SHADE_COUNT-1) << 16) |
    
    308
    -                       ((GBLENDER_SHADE_COUNT-1) << 8)  |
    
    309
    -                        (GBLENDER_SHADE_COUNT-1)        ) )
    
    303
    +      else if ( aa == (GBLENDER_SHADE_COUNT-1) * 0x010101U )
    
    310 304
           {
    
    311 305
             GDST_COPY(dst);
    
    312 306
           }
    
    ... ... @@ -369,9 +363,7 @@ GCONCAT( _gblender_blit_vbgr_, GDST_TYPE )( GBlenderBlit blit,
    369 363
           {
    
    370 364
             /* nothing */
    
    371 365
           }
    
    372
    -      else if ( aa == (((GBLENDER_SHADE_COUNT-1) << 16) |
    
    373
    -                       ((GBLENDER_SHADE_COUNT-1) << 8)  |
    
    374
    -                        (GBLENDER_SHADE_COUNT-1)        ) )
    
    366
    +      else if ( aa == (GBLENDER_SHADE_COUNT-1) * 0x010101U )
    
    375 367
           {
    
    376 368
             GDST_COPY(dst);
    
    377 369
           }
    

  • graph/gblblit.c
    ... ... @@ -71,7 +71,7 @@
    71 71
     
    
    72 72
     #define  GRGB_TO_GRAY8(r,g,b)  ( (unsigned char)( ( 3*(r) + 6*(g) + (b) ) / 10 ) )
    
    73 73
     
    
    74
    -#define  GGRAY8_TO_RGB24(p)    GRGB_PACK(p,p,p)
    
    74
    +#define  GGRAY8_TO_RGB24(p)   ( (p) * 0x010101U )
    
    75 75
     
    
    76 76
     #define  GRGB24_TO_GRAY8(p)   ( (unsigned char)( ( 3*( ((p) >> 16) & 0xFF ) +         \
    
    77 77
                                                        6*( ((p) >>  8) & 0xFF ) +         \
    


  • reply via email to

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