commit 720bf1c
Michael Forney
·
2013-09-11 08:12:56 +0000 UTC
parent 1c1bc11
output: Move geometry to a pixman_rectangle32_t
3 files changed,
+13,
-12
+4,
-4
1@@ -331,6 +331,9 @@ struct wl_list * swc_drm_create_outputs(struct swc_drm * drm)
2
3 output = malloc(sizeof(struct swc_output));
4
5+ output->geometry.x = x;
6+ output->geometry.y = 0;
7+
8 if (!swc_output_initialize(output, drm, id,
9 resources->crtcs[crtc_index], connector))
10 {
11@@ -339,14 +342,11 @@ struct wl_list * swc_drm_create_outputs(struct swc_drm * drm)
12 continue;
13 }
14
15- output->x = x;
16- output->y = 0;
17-
18 taken_crtcs |= 1 << crtc_index;
19 drm->taken_output_ids |= 1 << id;
20
21 wl_list_insert(outputs, &output->link);
22- x += output->width;
23+ x += output->geometry.width;
24 }
25
26 drmModeFreeConnector(connector);
+7,
-7
1@@ -26,7 +26,7 @@ static void bind_output(struct wl_client * client, void * data,
2 &swc_remove_resource);
3 wl_list_insert(&output->resource_list, wl_resource_get_link(resource));
4
5- wl_output_send_geometry(resource, output->x, output->y,
6+ wl_output_send_geometry(resource, output->geometry.x, output->geometry.y,
7 output->physical_width, output->physical_height, 0, "unknown",
8 "unknown", WL_OUTPUT_TRANSFORM_NORMAL);
9
10@@ -90,19 +90,19 @@ bool swc_output_initialize(struct swc_output * output, struct swc_drm * drm,
11 if (output->preferred_mode)
12 output->current_mode = output->preferred_mode;
13
14- output->width = output->current_mode->width;
15- output->height = output->current_mode->height;
16+ output->geometry.width = output->current_mode->width;
17+ output->geometry.height = output->current_mode->height;
18
19 /* Create output buffers */
20- if (!swc_buffer_initialize(&output->buffers[0], drm, output->width,
21- output->height))
22+ if (!swc_buffer_initialize(&output->buffers[0], drm, output->geometry.width,
23+ output->geometry.height))
24 {
25 printf("could not initialize buffer 0 for output\n");
26 goto error_base;
27 }
28
29- if (!swc_buffer_initialize(&output->buffers[1], drm, output->width,
30- output->height))
31+ if (!swc_buffer_initialize(&output->buffers[1], drm, output->geometry.width,
32+ output->geometry.height))
33 {
34 printf("could not initialize buffer 1 for output\n");
35 goto error_buffer0;
+2,
-1
1@@ -4,6 +4,7 @@
2 #include "buffer.h"
3
4 #include <stdint.h>
5+#include <pixman.h>
6 #include <wayland-util.h>
7 #include <wayland-server.h>
8 #include <xf86drmMode.h>
9@@ -17,7 +18,7 @@ struct swc_output
10 struct swc_drm * drm;
11
12 /* The geometry of this output */
13- uint32_t x, y, width, height;
14+ pixman_rectangle32_t geometry;
15 uint32_t physical_width, physical_height;
16
17 struct wl_array modes;