freetype-commit
[Top][All Lists]
Advanced

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

[freetype2-demos] master 3f3293d 11/22: [graph] Decouple the legacy and


From: Werner Lemberg
Subject: [freetype2-demos] master 3f3293d 11/22: [graph] Decouple the legacy and alpha blenders.
Date: Fri, 5 Mar 2021 11:18:39 -0500 (EST)

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

    [graph] Decouple the legacy and alpha blenders.
    
    * graph/grblit.c (grBlitGlyphToBitmap): Do not call
    `grBlitGlyphToSurface'.
    * src/*: s/grBlitGlyphToBitmap/grBlitGlyphToSurface/.
---
 ChangeLog      |  8 ++++++++
 graph/grblit.c | 10 ----------
 src/ftcommon.c | 12 ++++++------
 src/ftdiff.c   |  4 ++--
 src/ftgrid.c   |  6 +++---
 src/ftmulti.c  |  4 ++--
 6 files changed, 21 insertions(+), 23 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e068033..808c655 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2021-01-26  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
+       [graph] Decouple the legacy and alpha blenders.
+
+       * graph/grblit.c (grBlitGlyphToBitmap): Do not call
+       `grBlitGlyphToSurface'.
+       * src/*: s/grBlitGlyphToBitmap/grBlitGlyphToSurface/.
+
+2021-01-26  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
        * graph/grfont.c (gr_charcell): Minor.
 
 2021-01-25  Alexei Podtelezhnikov  <apodtele@gmail.com>
diff --git a/graph/grblit.c b/graph/grblit.c
index 1beb23e..3589736 100644
--- a/graph/grblit.c
+++ b/graph/grblit.c
@@ -10,7 +10,6 @@
 /****************************************************************************/
 
 #include "grblit.h"
-#include "gblblit.h"
 
 #define  GRAY8
 
@@ -1800,15 +1799,6 @@
       return 0;
     }
 
-    /* short cut to alpha blender for certain glyph types */
-    switch ( grBlitGlyphToSurface( (grSurface*)target, glyph, x, y, color ) )
-    {
-    case 1:
-      return 1;
-    case 0:
-      return 0;
-    }
-
     /* set up blitter and compute clipping.  Return immediately if needed */
     blit.source = *glyph;
     blit.target = *target;
diff --git a/src/ftcommon.c b/src/ftcommon.c
index f9372ed..0d1f89c 100644
--- a/src/ftcommon.c
+++ b/src/ftcommon.c
@@ -1693,8 +1693,8 @@
       return error;
 
     /* now render the bitmap into the display surface */
-    grBlitGlyphToBitmap( display->bitmap, &bit3, *pen_x + left,
-                         *pen_y - top, display->fore_color );
+    grBlitGlyphToSurface( display->surface, &bit3, *pen_x + left,
+                          *pen_y - top, display->fore_color );
 
     if ( glyf )
       FT_Done_Glyph( glyf );
@@ -1728,8 +1728,8 @@
     }
 
     /* now render the bitmap into the display surface */
-    grBlitGlyphToBitmap( display->bitmap, &bit3, *pen_x + left,
-                         *pen_y - top, color );
+    grBlitGlyphToSurface( display->surface, &bit3, *pen_x + left,
+                          *pen_y - top, color );
 
     if ( glyf )
       FT_Done_Glyph( glyf );
@@ -2060,8 +2060,8 @@
           top = display->bitmap->rows - top;
 
           /* now render the bitmap into the display surface */
-          grBlitGlyphToBitmap( display->bitmap, &bit3, left, top,
-                               display->fore_color );
+          grBlitGlyphToSurface( display->surface, &bit3, left, top,
+                                display->fore_color );
 
           if ( glyf )
             FT_Done_Glyph( glyf );
diff --git a/src/ftdiff.c b/src/ftdiff.c
index 829159a..51c2651 100644
--- a/src/ftdiff.c
+++ b/src/ftdiff.c
@@ -1090,8 +1090,8 @@
     else if ( mode == DISPLAY_MODE_LCD )
       glyph.mode = gr_pixel_mode_lcd;
 
-    grBlitGlyphToBitmap( display->bitmap, &glyph,
-                         x, y, display->fore_color );
+    grBlitGlyphToSurface( display->surface, &glyph,
+                          x, y, display->fore_color );
   }
 
 
diff --git a/src/ftgrid.c b/src/ftgrid.c
index f88b29f..f86f022 100644
--- a/src/ftgrid.c
+++ b/src/ftgrid.c
@@ -579,9 +579,9 @@
       {
         bitmap_scale( st, &bitg, scale );
 
-        grBlitGlyphToBitmap( display->bitmap, &bitg,
-                             ox + left * scale, oy - top * scale,
-                             st->axis_color );
+        grBlitGlyphToSurface( display->surface, &bitg,
+                              ox + left * scale, oy - top * scale,
+                              st->axis_color );
 
         free( bitg.buffer );
 
diff --git a/src/ftmulti.c b/src/ftmulti.c
index 5790e7a..761da20 100644
--- a/src/ftmulti.c
+++ b/src/ftmulti.c
@@ -345,8 +345,8 @@
     x_top = x_offset + glyph->bitmap_left;
     y_top = y_offset - glyph->bitmap_top;
 
-    grBlitGlyphToBitmap( bit, &bit3,
-                         x_top, y_top, fore_color );
+    grBlitGlyphToSurface( surface, &bit3,
+                          x_top, y_top, fore_color );
 
     return 0;
   }



reply via email to

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