[gtk/scroll-compression: 11/12] gdk: Shrink GdkTimeCoord



commit 693200f1eb9fb2784736c80a5ede9a60a1afa6a9
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jun 9 13:38:48 2020 -0400

    gdk: Shrink GdkTimeCoord
    
    There is really no need to store 128 doubles as axes,
    ever. We can do just fine with 10. At the same time,
    add a GdkAxisFlags member, so we can interpret the
    values without having to go chasing the right device
    for this information.

 gdk/gdkdevice.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/gdk/gdkdevice.h b/gdk/gdkdevice.h
index a45a3163fb..3dddf1e534 100644
--- a/gdk/gdkdevice.h
+++ b/gdk/gdkdevice.h
@@ -85,22 +85,20 @@ typedef enum {
   GDK_DEVICE_TYPE_FLOATING
 } GdkDeviceType;
 
-/* We don't allocate each coordinate this big, but we use it to
- * be ANSI compliant and avoid accessing past the defined limits.
- */
-#define GDK_MAX_TIMECOORD_AXES 128
 
 /**
  * GdkTimeCoord:
  * @time: The timestamp for this event.
- * @axes: the values of the device’s axes.
+ * @flags: Flags indicating what axes are present
+ * @axes: axis values
  *
  * A #GdkTimeCoord stores a single event in a motion history.
  */
 struct _GdkTimeCoord
 {
   guint32 time;
-  gdouble axes[GDK_MAX_TIMECOORD_AXES];
+  GdkAxisFlags flags;
+  double axes[GDK_AXIS_LAST];
 };
 
 GDK_AVAILABLE_IN_ALL


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]