backends/native: Switch the pressurecurve points to graphene points

No functional changes but a little bit of type-safety for future
patches.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3399>
This commit is contained in:
Peter Hutterer 2023-11-15 13:44:15 +10:00 committed by Marge Bot
parent 5ec67a8e90
commit 4d6add290e
2 changed files with 10 additions and 9 deletions

View File

@ -102,10 +102,10 @@ meta_input_device_tool_native_set_pressure_curve_in_impl (ClutterInputDeviceTool
curve[3] >= 0 && curve[3] <= 1);
evdev_tool = META_INPUT_DEVICE_TOOL_NATIVE (tool);
evdev_tool->pressure_curve[0] = curve[0];
evdev_tool->pressure_curve[1] = curve[1];
evdev_tool->pressure_curve[2] = curve[2];
evdev_tool->pressure_curve[3] = curve[3];
evdev_tool->pressure_curve[0].x = curve[0];
evdev_tool->pressure_curve[0].y = curve[1];
evdev_tool->pressure_curve[1].x = curve[2];
evdev_tool->pressure_curve[1].y = curve[3];
}
void
@ -162,10 +162,10 @@ meta_input_device_tool_native_translate_pressure_in_impl (ClutterInputDeviceTool
evdev_tool = META_INPUT_DEVICE_TOOL_NATIVE (tool);
return calculate_bezier_position (CLAMP (pressure, 0, 1),
evdev_tool->pressure_curve[0],
evdev_tool->pressure_curve[1],
evdev_tool->pressure_curve[2],
evdev_tool->pressure_curve[3]);
evdev_tool->pressure_curve[0].x,
evdev_tool->pressure_curve[0].y,
evdev_tool->pressure_curve[1].x,
evdev_tool->pressure_curve[1].y);
}
uint32_t

View File

@ -23,6 +23,7 @@
#error "This header cannot be included directly. Use "backends/native/meta-input-thread.h""
#endif /* META_INPUT_THREAD_H_INSIDE */
#include <graphene.h>
#include <libinput.h>
#include "clutter/clutter.h"
@ -59,7 +60,7 @@ struct _MetaInputDeviceToolNative
ClutterInputDeviceTool parent_instance;
struct libinput_tablet_tool *tool;
GHashTable *button_map;
double pressure_curve[4];
graphene_point_t pressure_curve[2];
};
struct _MetaInputDeviceToolNativeClass