Commit 6ab36880ce25ad0f67661609ac9ec9a3dcd4c992

Werner Lemberg 2019-02-23T11:18:39

* src/base/ftbitmap.c (FT_Bitmap_Blend): No fractional offsets. The function only provided a framework without an actual implementation, which this commits removes.

diff --git a/ChangeLog b/ChangeLog
index 5d4ba05..cc2dcb8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2019-02-23  Werner Lemberg  <wl@gnu.org>
 
+	* src/base/ftbitmap.c (FT_Bitmap_Blend): No fractional offsets.
+
+	The function only provided a framework without an actual
+	implementation, which this commits removes.
+
+2019-02-23  Werner Lemberg  <wl@gnu.org>
+
 	* src/tools/update-copyright-year: Insert `(C)'.
 
 2019-02-21  Armin Hasitzka  <prince.cherusker@gmail.com>
diff --git a/include/freetype/ftbitmap.h b/include/freetype/ftbitmap.h
index 0235eb8..a6acdb9 100644
--- a/include/freetype/ftbitmap.h
+++ b/include/freetype/ftbitmap.h
@@ -225,7 +225,8 @@ FT_BEGIN_HEADER
    *
    *   source_offset ::
    *     The offset vector to the upper left corner of the source bitmap in
-   *     26.6 pixel format.  This can be a fractional pixel value.
+   *     26.6 pixel format.  It should represent an integer offset; the
+   *     function will set the lowest six bits to zero to enforce that.
    *
    *   color ::
    *     The color used to draw `source` onto `target`.
diff --git a/src/base/ftbitmap.c b/src/base/ftbitmap.c
index e494d8f..3617beb 100644
--- a/src/base/ftbitmap.c
+++ b/src/base/ftbitmap.c
@@ -811,7 +811,6 @@
 
     FT_Vector  source_offset;
     FT_Vector  target_offset;
-    FT_Vector  frac_offset;
 
     FT_Bool  free_source_bitmap          = 0;
     FT_Bool  free_target_bitmap_on_error = 0;
@@ -845,16 +844,9 @@
     if ( !( source_->width && source_->rows ) )
       return FT_Err_Ok;               /* nothing to do */
 
-    /* we isolate a fractional shift of `source',        */
-    /* to be less than one pixel and always positive;    */
-    /* `source_offset' now holds full-pixel shift values */
+    /* assure integer pixel offset s */
     source_offset.x = FT_PIX_FLOOR( source_offset_.x );
-    frac_offset.x   = source_offset_.x - source_offset.x;
-
     source_offset.y = FT_PIX_FLOOR( source_offset_.y );
-    frac_offset.y   = source_offset_.y - source_offset.y;
-
-    /* assure integer pixel offset for target bitmap */
     target_offset.x = FT_PIX_FLOOR( atarget_offset->x );
     target_offset.y = FT_PIX_FLOOR( atarget_offset->y );
 
@@ -906,13 +898,6 @@
       target_ury = FT_LONG_MIN;
     }
 
-    /* move upper right corner up and to the right */
-    /* if we have a fractional offset              */
-    if ( source_urx >= target_urx && frac_offset.x )
-      source_urx += 64;
-    if ( source_ury >= target_ury && frac_offset.y )
-      source_ury += 64;
-
     /* compute final bitmap dimensions */
     final_llx = FT_MIN( source_llx, target_llx );
     final_lly = FT_MIN( source_lly, target_lly );
@@ -929,10 +914,6 @@
       source_urx / 64, source_ury / 64,
       source_->width, source_->rows ));
 
-    if ( frac_offset.x || frac_offset.y )
-      FT_TRACE5(( "    fractional offset: (%d/64, %d/64)\n",
-                  frac_offset.x, frac_offset.y ));
-
     if ( target->width && target->rows )
       FT_TRACE5(( "  target bitmap: (%d, %d) -- (%d, %d); %d x %d\n",
         target_llx / 64, target_lly / 64,
@@ -1070,8 +1051,6 @@
     x = source_llx >> 6;
     y = source_lly >> 6;
 
-    /* XXX handle `frac_offset' */
-
     /* the bitmap flow is from top to bottom, */
     /* but y is measured from bottom to top   */
     if ( target->pitch < 0 )