summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/include/freetype/internal/ftcalc.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/freetype/include/freetype/internal/ftcalc.h')
-rw-r--r--src/3rdparty/freetype/include/freetype/internal/ftcalc.h50
1 files changed, 42 insertions, 8 deletions
diff --git a/src/3rdparty/freetype/include/freetype/internal/ftcalc.h b/src/3rdparty/freetype/include/freetype/internal/ftcalc.h
index e6a87db94e..d9aea23602 100644
--- a/src/3rdparty/freetype/include/freetype/internal/ftcalc.h
+++ b/src/3rdparty/freetype/include/freetype/internal/ftcalc.h
@@ -4,7 +4,7 @@
*
* Arithmetic computations (specification).
*
- * Copyright (C) 1996-2022 by
+ * Copyright (C) 1996-2023 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -278,6 +278,40 @@ FT_BEGIN_HEADER
FT_Long c );
+ /**************************************************************************
+ *
+ * @function:
+ * FT_MulAddFix
+ *
+ * @description:
+ * Compute `(s[0] * f[0] + s[1] * f[1] + ...) / 0x10000`, where `s[n]` is
+ * usually a 16.16 scalar.
+ *
+ * @input:
+ * s ::
+ * The array of scalars.
+ * f ::
+ * The array of factors.
+ * count ::
+ * The number of entries in the array.
+ *
+ * @return:
+ * The result of `(s[0] * f[0] + s[1] * f[1] + ...) / 0x10000`.
+ *
+ * @note:
+ * This function is currently used for the scaled delta computation of
+ * variation stores. It internally uses 64-bit data types when
+ * available, otherwise it emulates 64-bit math by using 32-bit
+ * operations, which produce a correct result but most likely at a slower
+ * performance in comparison to the implementation base on `int64_t`.
+ *
+ */
+ FT_BASE( FT_Int32 )
+ FT_MulAddFix( FT_Fixed* s,
+ FT_Int32* f,
+ FT_UInt count );
+
+
/*
* A variant of FT_Matrix_Multiply which scales its result afterwards. The
* idea is that both `a' and `b' are scaled by factors of 10 so that the
@@ -298,9 +332,9 @@ FT_BEGIN_HEADER
* Based on geometric considerations we use the following inequality to
* identify a degenerate matrix.
*
- * 50 * abs(xx*yy - xy*yx) < xx^2 + xy^2 + yx^2 + yy^2
+ * 32 * abs(xx*yy - xy*yx) < xx^2 + xy^2 + yx^2 + yy^2
*
- * Value 50 is heuristic.
+ * Value 32 is heuristic.
*/
FT_BASE( FT_Bool )
FT_Matrix_Check( const FT_Matrix* matrix );
@@ -413,11 +447,11 @@ FT_BEGIN_HEADER
extern __inline FT_Int32
FT_MSB_i386( FT_UInt32 x );
-#pragma aux FT_MSB_i386 = \
- "bsr eax, eax" \
- parm [eax] nomemory \
- value [eax] \
- modify exact [eax] nomemory;
+#pragma aux FT_MSB_i386 = \
+ "bsr eax, eax" \
+ __parm [__eax] __nomemory \
+ __value [__eax] \
+ __modify __exact [__eax] __nomemory;
#define FT_MSB( x ) FT_MSB_i386( x )