[cogl/cogl-latest-win: 9/27] cogl/deprecated: Mark public APIs for export
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/cogl-latest-win: 9/27] cogl/deprecated: Mark public APIs for export
- Date: Mon, 18 Oct 2021 10:53:47 +0000 (UTC)
commit 642c590164b7ac05138447e8820f62fc5b183e42
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Mon Feb 11 17:01:09 2019 +0800
cogl/deprecated: Mark public APIs for export
This way we can reduce maintenance burden for the cogl.symbols file by
using compiler directives to export public symbols. cogl.symbols is
still now kept as we still need to get rid of the private API calls
within Cogl-Pango and Cogl-Path.
cogl/deprecated/cogl-clutter-xlib.h | 2 +-
cogl/deprecated/cogl-clutter.h | 2 +-
cogl/deprecated/cogl-fixed.h | 78 ++++++++++++++++++++++++++++++-------
3 files changed, 65 insertions(+), 17 deletions(-)
---
diff --git a/cogl/deprecated/cogl-clutter-xlib.h b/cogl/deprecated/cogl-clutter-xlib.h
index 424ff49b..fcc1064b 100644
--- a/cogl/deprecated/cogl-clutter-xlib.h
+++ b/cogl/deprecated/cogl-clutter-xlib.h
@@ -38,7 +38,7 @@
COGL_BEGIN_DECLS
#define cogl_clutter_winsys_xlib_get_visual_info cogl_clutter_winsys_xlib_get_visual_info_CLUTTER
-XVisualInfo *
+COGL_API XVisualInfo *
cogl_clutter_winsys_xlib_get_visual_info (void);
COGL_END_DECLS
diff --git a/cogl/deprecated/cogl-clutter.h b/cogl/deprecated/cogl-clutter.h
index cc6c4464..4af662d9 100644
--- a/cogl/deprecated/cogl-clutter.h
+++ b/cogl/deprecated/cogl-clutter.h
@@ -46,7 +46,7 @@ CoglBool
cogl_clutter_winsys_has_feature (CoglWinsysFeature feature);
#define cogl_onscreen_clutter_backend_set_size cogl_onscreen_clutter_backend_set_size_CLUTTER
-void
+COGL_API void
cogl_onscreen_clutter_backend_set_size (int width, int height);
COGL_END_DECLS
diff --git a/cogl/deprecated/cogl-fixed.h b/cogl/deprecated/cogl-fixed.h
index aeb0528a..ef1300ef 100644
--- a/cogl/deprecated/cogl-fixed.h
+++ b/cogl/deprecated/cogl-fixed.h
@@ -479,7 +479,7 @@ COGL_BEGIN_DECLS
*
* Since: 1.0
*/
-CoglFixed
+COGL_API CoglFixed
cogl_fixed_sin (CoglFixed angle);
/**
@@ -492,7 +492,7 @@ cogl_fixed_sin (CoglFixed angle);
*
* Since: 1.0
*/
-CoglFixed
+COGL_API CoglFixed
cogl_fixed_tan (CoglFixed angle);
/**
@@ -505,6 +505,7 @@ cogl_fixed_tan (CoglFixed angle);
*
* Since: 1.0
*/
+COGL_API
CoglFixed cogl_fixed_cos (CoglFixed angle);
/**
@@ -517,7 +518,7 @@ CoglFixed cogl_fixed_cos (CoglFixed angle);
*
* Since: 1.0
*/
-CoglFixed
+COGL_API CoglFixed
cogl_fixed_atan (CoglFixed a);
/**
@@ -533,7 +534,7 @@ cogl_fixed_atan (CoglFixed a);
*
* Since: 1.0
*/
-CoglFixed
+COGL_API CoglFixed
cogl_fixed_atan2 (CoglFixed a,
CoglFixed b);
@@ -631,7 +632,7 @@ cogl_fixed_mul_div (CoglFixed a,
*
* Since: 1.0
*/
-CoglFixed
+COGL_API CoglFixed
cogl_fixed_sqrt (CoglFixed x);
/**
@@ -647,7 +648,7 @@ cogl_fixed_sqrt (CoglFixed x);
*
* Since: 1.0
*/
-CoglFixed
+COGL_API CoglFixed
cogl_fixed_log2 (unsigned int x);
/**
@@ -663,7 +664,7 @@ cogl_fixed_log2 (unsigned int x);
*
* Since: 1.0
*/
-unsigned int
+COGL_API unsigned int
cogl_fixed_pow2 (CoglFixed x);
/**
@@ -677,7 +678,7 @@ cogl_fixed_pow2 (CoglFixed x);
*
* Since: 1.0
*/
-unsigned int
+COGL_API unsigned int
cogl_fixed_pow (unsigned int x,
CoglFixed y);
@@ -697,7 +698,7 @@ cogl_fixed_pow (unsigned int x,
*
* Since: 1.0
*/
-int
+COGL_API int
cogl_sqrti (int x);
/**
@@ -751,7 +752,7 @@ cogl_sqrti (int x);
*
* Since: 1.0
*/
-CoglFixed
+COGL_API CoglFixed
cogl_angle_sin (CoglAngle angle);
/**
@@ -764,7 +765,7 @@ cogl_angle_sin (CoglAngle angle);
*
* Since: 1.0
*/
-CoglFixed
+COGL_API CoglFixed
cogl_angle_tan (CoglAngle angle);
/**
@@ -777,16 +778,63 @@ cogl_angle_tan (CoglAngle angle);
*
* Since: 1.0
*/
-CoglFixed
+COGL_API CoglFixed
cogl_angle_cos (CoglAngle angle);
-CoglFixed
+/*< private >*/
+
+#if defined (G_CAN_INLINE)
+G_INLINE_FUNC CoglFixed
+cogl_fixed_mul (CoglFixed a,
+ CoglFixed b)
+{
+# ifdef __arm__
+ int res_low, res_hi;
+
+ __asm__ ("smull %0, %1, %2, %3 \n"
+ "mov %0, %0, lsr %4 \n"
+ "add %1, %0, %1, lsl %5 \n"
+ : "=r"(res_hi), "=r"(res_low)\
+ : "r"(a), "r"(b), "i"(COGL_FIXED_Q), "i"(32 - COGL_FIXED_Q));
+
+ return (CoglFixed) res_low;
+# else
+ long long r = (long long) a * (long long) b;
+
+ return (unsigned int)(r >> COGL_FIXED_Q);
+# endif
+}
+#endif
+
+#if defined (G_CAN_INLINE)
+G_INLINE_FUNC CoglFixed
+cogl_fixed_div (CoglFixed a,
+ CoglFixed b)
+{
+ return (CoglFixed) ((((int64_t) a) << COGL_FIXED_Q) / b);
+}
+#endif
+
+#if defined(G_CAN_INLINE)
+G_INLINE_FUNC CoglFixed
+cogl_fixed_mul_div (CoglFixed a,
+ CoglFixed b,
+ CoglFixed c)
+{
+ CoglFixed ab = cogl_fixed_mul (a, b);
+ CoglFixed quo = cogl_fixed_div (ab, c);
+
+ return quo;
+}
+#endif
+
+COGL_API CoglFixed
cogl_double_to_fixed (double value);
-int
+COGL_API int
cogl_double_to_int (double value);
-unsigned int
+COGL_API unsigned int
cogl_double_to_uint (double value);
COGL_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]