aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-03-09 15:28:17 +0100
committerdec05eba <dec05eba@protonmail.com>2024-03-09 15:36:45 +0100
commit5e05bbbbcbd45298c48af2b56a33da93d15b8f44 (patch)
treeac5ba627a63a34bfce2977e3d62344cfab46dba5 /src/utils.c
parent3d9a7065280e64797c5a68c794a04d60fb3f767c (diff)
Refactor xcomposite
Move common code between cuda/vaapi implementations into xcomposite file. This also fixes limited/full range colors on nvidia.
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/utils.c b/src/utils.c
index a464d52..c342f6e 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -9,13 +9,6 @@
#include <stdlib.h>
#include <X11/Xatom.h>
-typedef enum {
- X11_ROT_0 = 1 << 0,
- X11_ROT_90 = 1 << 1,
- X11_ROT_180 = 1 << 2,
- X11_ROT_270 = 1 << 3
-} X11Rotation;
-
double clock_get_monotonic_seconds(void) {
struct timespec ts;
ts.tv_sec = 0;
@@ -32,12 +25,12 @@ static const XRRModeInfo* get_mode_info(const XRRScreenResources *sr, RRMode id)
return NULL;
}
-static gsr_monitor_rotation x11_rotation_to_gsr_rotation(X11Rotation rot) {
+static gsr_monitor_rotation x11_rotation_to_gsr_rotation(int rot) {
switch(rot) {
- case X11_ROT_0: return GSR_MONITOR_ROT_0;
- case X11_ROT_90: return GSR_MONITOR_ROT_90;
- case X11_ROT_180: return GSR_MONITOR_ROT_180;
- case X11_ROT_270: return GSR_MONITOR_ROT_270;
+ case RR_Rotate_0: return GSR_MONITOR_ROT_0;
+ case RR_Rotate_90: return GSR_MONITOR_ROT_90;
+ case RR_Rotate_180: return GSR_MONITOR_ROT_180;
+ case RR_Rotate_270: return GSR_MONITOR_ROT_270;
}
return GSR_MONITOR_ROT_0;
}