aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-05-03 12:32:44 +0200
committerSimon Ser <contact@emersion.fr>2023-11-23 11:03:57 +0100
commit9e702e9cfe73f5aae665b5847cf470e66714e64a (patch)
tree30050050a24db3fb9f3ed97a72ad351149bbabe4
parenta3d22dbe972770f84ae71f7080fb7bc676c2ba7a (diff)
util/transform: move over wl_output_transform helpers
These aren't really tied to wlr_output.
-rw-r--r--backend/drm/drm.c1
-rw-r--r--examples/fullscreen-shell.c1
-rw-r--r--include/wlr/types/wlr_output.h15
-rw-r--r--include/wlr/util/transform.h28
-rw-r--r--render/gles2/pass.c1
-rw-r--r--types/meson.build1
-rw-r--r--types/output/cursor.c1
-rw-r--r--types/scene/surface.c1
-rw-r--r--types/scene/wlr_scene.c1
-rw-r--r--types/wlr_compositor.c1
-rw-r--r--types/wlr_screencopy_v1.c1
-rw-r--r--util/meson.build2
-rw-r--r--util/transform.c (renamed from types/output/transform.c)2
13 files changed, 38 insertions, 18 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index dc442f66..5fbcf32f 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -19,6 +19,7 @@
#include <wlr/types/wlr_matrix.h>
#include <wlr/util/box.h>
#include <wlr/util/log.h>
+#include <wlr/util/transform.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
#include "backend/drm/drm.h"
diff --git a/examples/fullscreen-shell.c b/examples/fullscreen-shell.c
index 70b7f676..5c36b8b1 100644
--- a/examples/fullscreen-shell.c
+++ b/examples/fullscreen-shell.c
@@ -16,6 +16,7 @@
#include <wlr/types/wlr_output.h>
#include <wlr/util/box.h>
#include <wlr/util/log.h>
+#include <wlr/util/transform.h>
/**
* A minimal fullscreen-shell server. It only supports rendering.
diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h
index 28a5ebcb..47c7672e 100644
--- a/include/wlr/types/wlr_output.h
+++ b/include/wlr/types/wlr_output.h
@@ -729,19 +729,4 @@ bool wlr_output_configure_primary_swapchain(struct wlr_output *output,
struct wlr_render_pass *wlr_output_begin_render_pass(struct wlr_output *output,
struct wlr_output_state *state, int *buffer_age, struct wlr_render_timer *timer);
-
-/**
- * Returns the transform that, when composed with `tr`, gives
- * `WL_OUTPUT_TRANSFORM_NORMAL`.
- */
-enum wl_output_transform wlr_output_transform_invert(
- enum wl_output_transform tr);
-
-/**
- * Returns a transform that, when applied, has the same effect as applying
- * sequentially `tr_a` and `tr_b`.
- */
-enum wl_output_transform wlr_output_transform_compose(
- enum wl_output_transform tr_a, enum wl_output_transform tr_b);
-
#endif
diff --git a/include/wlr/util/transform.h b/include/wlr/util/transform.h
new file mode 100644
index 00000000..d0ec5f53
--- /dev/null
+++ b/include/wlr/util/transform.h
@@ -0,0 +1,28 @@
+/*
+ * This an unstable interface of wlroots. No guarantees are made regarding the
+ * future consistency of this API.
+ */
+#ifndef WLR_USE_UNSTABLE
+#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
+#endif
+
+#ifndef WLR_UTIL_TRANSFORM_H
+#define WLR_UTIL_TRANSFORM_H
+
+#include <wayland-server-protocol.h>
+
+/**
+ * Returns the transform that, when composed with `tr`, gives
+ * `WL_OUTPUT_TRANSFORM_NORMAL`.
+ */
+enum wl_output_transform wlr_output_transform_invert(
+ enum wl_output_transform tr);
+
+/**
+ * Returns a transform that, when applied, has the same effect as applying
+ * sequentially `tr_a` and `tr_b`.
+ */
+enum wl_output_transform wlr_output_transform_compose(
+ enum wl_output_transform tr_a, enum wl_output_transform tr_b);
+
+#endif
diff --git a/render/gles2/pass.c b/render/gles2/pass.c
index 768e81de..4adad49f 100644
--- a/render/gles2/pass.c
+++ b/render/gles2/pass.c
@@ -4,6 +4,7 @@
#include <pixman.h>
#include <time.h>
#include <wlr/types/wlr_matrix.h>
+#include <wlr/util/transform.h>
#include "render/gles2.h"
#include "types/wlr_matrix.h"
diff --git a/types/meson.build b/types/meson.build
index e358cc33..8ae21b56 100644
--- a/types/meson.build
+++ b/types/meson.build
@@ -8,7 +8,6 @@ wlr_files += files(
'output/render.c',
'output/state.c',
'output/swapchain.c',
- 'output/transform.c',
'scene/drag_icon.c',
'scene/subsurface_tree.c',
'scene/surface.c',
diff --git a/types/output/cursor.c b/types/output/cursor.c
index 278b0d8a..8433b65d 100644
--- a/types/output/cursor.c
+++ b/types/output/cursor.c
@@ -8,6 +8,7 @@
#include <wlr/types/wlr_matrix.h>
#include <wlr/util/log.h>
#include <wlr/util/region.h>
+#include <wlr/util/transform.h>
#include "render/allocator/allocator.h"
#include "types/wlr_buffer.h"
#include "types/wlr_output.h"
diff --git a/types/scene/surface.c b/types/scene/surface.c
index b9f52211..4741dd6c 100644
--- a/types/scene/surface.c
+++ b/types/scene/surface.c
@@ -4,6 +4,7 @@
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_fractional_scale_v1.h>
#include <wlr/types/wlr_presentation_time.h>
+#include <wlr/util/transform.h>
#include "types/wlr_scene.h"
static void handle_scene_buffer_outputs_update(
diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c
index f81a8613..d8c7b841 100644
--- a/types/scene/wlr_scene.c
+++ b/types/scene/wlr_scene.c
@@ -13,6 +13,7 @@
#include <wlr/types/wlr_scene.h>
#include <wlr/util/log.h>
#include <wlr/util/region.h>
+#include <wlr/util/transform.h>
#include "types/wlr_buffer.h"
#include "types/wlr_output.h"
#include "types/wlr_scene.h"
diff --git a/types/wlr_compositor.c b/types/wlr_compositor.c
index 70c1f9cc..755d3760 100644
--- a/types/wlr_compositor.c
+++ b/types/wlr_compositor.c
@@ -10,6 +10,7 @@
#include <wlr/types/wlr_output.h>
#include <wlr/util/log.h>
#include <wlr/util/region.h>
+#include <wlr/util/transform.h>
#include "types/wlr_buffer.h"
#include "types/wlr_region.h"
#include "types/wlr_subcompositor.h"
diff --git a/types/wlr_screencopy_v1.c b/types/wlr_screencopy_v1.c
index 99ed7696..0e91abe1 100644
--- a/types/wlr_screencopy_v1.c
+++ b/types/wlr_screencopy_v1.c
@@ -9,6 +9,7 @@
#include <wlr/backend.h>
#include <wlr/util/box.h>
#include <wlr/util/log.h>
+#include <wlr/util/transform.h>
#include "wlr-screencopy-unstable-v1-protocol.h"
#include "render/pixel_format.h"
#include "render/wlr_renderer.h"
diff --git a/util/meson.build b/util/meson.build
index 5af2254f..053e2c5e 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -11,6 +11,6 @@ wlr_files += files(
'shm.c',
'time.c',
'token.c',
+ 'transform.c',
'utf8.c',
)
-
diff --git a/types/output/transform.c b/util/transform.c
index 2b18d487..4cc725fd 100644
--- a/types/output/transform.c
+++ b/util/transform.c
@@ -1,4 +1,4 @@
-#include <wlr/types/wlr_output.h>
+#include <wlr/util/transform.h>
enum wl_output_transform wlr_output_transform_invert(
enum wl_output_transform tr) {