[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] master 300458e: Miscellaneous macro updates.
From: |
Alexei Podtelezhnikov |
Subject: |
[freetype2] master 300458e: Miscellaneous macro updates. |
Date: |
Fri, 3 May 2019 23:17:15 -0400 (EDT) |
branch: master
commit 300458eb949f71a486710b69bb6b704139765b26
Author: Alexei Podtelezhnikov <address@hidden>
Commit: Alexei Podtelezhnikov <address@hidden>
Miscellaneous macro updates.
* src/base/ftoutln.c (SCALED): Updated.
* src/smooth/ftgrays.c (SCALED): Ditto.
(FLOOR, ROUND, CEILING): Removed.
* src/psaux/psfixed.h (cf2_fracToFixed): Updated.
---
ChangeLog | 9 +++++++++
src/base/ftoutln.c | 3 +--
src/psaux/psfixed.h | 3 +--
src/smooth/ftgrays.c | 10 +---------
4 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 172e165..56db60a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2019-05-03 Alexei Podtelezhnikov <address@hidden>
+
+ Miscellaneous macro updates.
+
+ * src/base/ftoutln.c (SCALED): Updated.
+ * src/smooth/ftgrays.c (SCALED): Ditto.
+ (FLOOR, ROUND, CEILING): Removed.
+ * src/psaux/psfixed.h (cf2_fracToFixed): Updated.
+
2019-05-02 Alexei Podtelezhnikov <address@hidden>
Tweak LCD filtering.
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index 86fa1c2..0e2ba34 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -46,8 +46,7 @@
void* user )
{
#undef SCALED
-#define SCALED( x ) ( ( (x) < 0 ? -( -(x) << shift ) \
- : ( (x) << shift ) ) - delta )
+#define SCALED( x ) ( (x) * ( 1L << shift ) - delta )
FT_Vector v_last;
FT_Vector v_control;
diff --git a/src/psaux/psfixed.h b/src/psaux/psfixed.h
index fd3460f..7dff9ef 100644
--- a/src/psaux/psfixed.h
+++ b/src/psaux/psfixed.h
@@ -72,8 +72,7 @@ FT_BEGIN_HEADER
#define cf2_fixedFraction( x ) \
( (x) - cf2_fixedFloor( x ) )
#define cf2_fracToFixed( x ) \
- ( (x) < 0 ? -( ( -(x) + 0x2000 ) >> 14 ) \
- : ( ( (x) + 0x2000 ) >> 14 ) )
+ ( ( (x) + 0x2000 - ( (x) < 0 ) ) >> 14 )
/* signed numeric types */
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 72ab546..e39f00b 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -327,17 +327,9 @@ typedef ptrdiff_t FT_PtrDist;
/* must be at least 6 bits! */
#define PIXEL_BITS 8
-#undef FLOOR
-#undef CEILING
-#undef TRUNC
-#undef SCALED
-
#define ONE_PIXEL ( 1 << PIXEL_BITS )
#define TRUNC( x ) ( (TCoord)( (x) >> PIXEL_BITS ) )
#define SUBPIXELS( x ) ( (TPos)(x) * ONE_PIXEL )
-#define FLOOR( x ) ( (x) & -ONE_PIXEL )
-#define CEILING( x ) ( ( (x) + ONE_PIXEL - 1 ) & -ONE_PIXEL )
-#define ROUND( x ) ( ( (x) + ONE_PIXEL / 2 ) & -ONE_PIXEL )
#if PIXEL_BITS >= 6
#define UPSCALE( x ) ( (x) * ( ONE_PIXEL >> 6 ) )
@@ -1337,7 +1329,7 @@ typedef ptrdiff_t FT_PtrDist;
void* user )
{
#undef SCALED
-#define SCALED( x ) ( ( (x) << shift ) - delta )
+#define SCALED( x ) ( (x) * ( 1L << shift ) - delta )
FT_Vector v_last;
FT_Vector v_control;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] master 300458e: Miscellaneous macro updates.,
Alexei Podtelezhnikov <=