[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] master 30fe5e7: [base] Replace left shifts with multiplicati
From: |
Werner LEMBERG |
Subject: |
[freetype2] master 30fe5e7: [base] Replace left shifts with multiplication (#46118). |
Date: |
Sun, 04 Oct 2015 11:08:36 +0000 |
branch: master
commit 30fe5e762e062612fdf4b56b50d813525a5aa311
Author: Werner Lemberg <address@hidden>
Commit: Werner Lemberg <address@hidden>
[base] Replace left shifts with multiplication (#46118).
* src/base/ftglyph.c (ft_bitmap_glyph_bbox, FT_Get_Glyph): Do it.
---
ChangeLog | 6 ++++++
src/base/ftglyph.c | 14 +++++++-------
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f5ca59f..2479af3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2015-10-04 Werner Lemberg <address@hidden>
+ [base] Replace left shifts with multiplication (#46118).
+
+ * src/base/ftglyph.c (ft_bitmap_glyph_bbox, FT_Get_Glyph): Do it.
+
+2015-10-04 Werner Lemberg <address@hidden>
+
* Version 2.6.1 released.
=========================
diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index cb7fc37..2778743 100644
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -125,10 +125,10 @@
FT_BitmapGlyph glyph = (FT_BitmapGlyph)bitmap_glyph;
- cbox->xMin = glyph->left << 6;
- cbox->xMax = cbox->xMin + (FT_Pos)( glyph->bitmap.width << 6 );
- cbox->yMax = glyph->top << 6;
- cbox->yMin = cbox->yMax - (FT_Pos)( glyph->bitmap.rows << 6 );
+ cbox->xMin = glyph->left * 64;
+ cbox->xMax = cbox->xMin + (FT_Pos)( glyph->bitmap.width * 64 );
+ cbox->yMax = glyph->top * 64;
+ cbox->yMin = cbox->yMax - (FT_Pos)( glyph->bitmap.rows * 64 );
}
@@ -403,9 +403,9 @@
if ( error )
goto Exit;
- /* copy advance while converting it to 16.16 format */
- glyph->advance.x = slot->advance.x << 10;
- glyph->advance.y = slot->advance.y << 10;
+ /* copy advance while converting 26.6 to 16.16 format */
+ glyph->advance.x = slot->advance.x * 1024;
+ glyph->advance.y = slot->advance.y * 1024;
/* now import the image from the glyph slot */
error = clazz->glyph_init( glyph, slot );
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] master 30fe5e7: [base] Replace left shifts with multiplication (#46118).,
Werner LEMBERG <=