swc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/swc
Log | Files | Refs | README | LICENSE

commit 720bf1c1e30dd193a6c72448dcd0d7080a20c084
parent 1c1bc119f035318ee4aa3c167717b2cf773c35ed
Author: Michael Forney <mforney@mforney.org>
Date:   Wed, 11 Sep 2013 01:12:56 -0700

output: Move geometry to a pixman_rectangle32_t

Diffstat:
Mlibswc/drm.c | 8++++----
Mlibswc/output.c | 14+++++++-------
Mlibswc/output.h | 3++-
3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/libswc/drm.c b/libswc/drm.c @@ -331,6 +331,9 @@ struct wl_list * swc_drm_create_outputs(struct swc_drm * drm) output = malloc(sizeof(struct swc_output)); + output->geometry.x = x; + output->geometry.y = 0; + if (!swc_output_initialize(output, drm, id, resources->crtcs[crtc_index], connector)) { @@ -339,14 +342,11 @@ struct wl_list * swc_drm_create_outputs(struct swc_drm * drm) continue; } - output->x = x; - output->y = 0; - taken_crtcs |= 1 << crtc_index; drm->taken_output_ids |= 1 << id; wl_list_insert(outputs, &output->link); - x += output->width; + x += output->geometry.width; } drmModeFreeConnector(connector); diff --git a/libswc/output.c b/libswc/output.c @@ -26,7 +26,7 @@ static void bind_output(struct wl_client * client, void * data, &swc_remove_resource); wl_list_insert(&output->resource_list, wl_resource_get_link(resource)); - wl_output_send_geometry(resource, output->x, output->y, + wl_output_send_geometry(resource, output->geometry.x, output->geometry.y, output->physical_width, output->physical_height, 0, "unknown", "unknown", WL_OUTPUT_TRANSFORM_NORMAL); @@ -90,19 +90,19 @@ bool swc_output_initialize(struct swc_output * output, struct swc_drm * drm, if (output->preferred_mode) output->current_mode = output->preferred_mode; - output->width = output->current_mode->width; - output->height = output->current_mode->height; + output->geometry.width = output->current_mode->width; + output->geometry.height = output->current_mode->height; /* Create output buffers */ - if (!swc_buffer_initialize(&output->buffers[0], drm, output->width, - output->height)) + if (!swc_buffer_initialize(&output->buffers[0], drm, output->geometry.width, + output->geometry.height)) { printf("could not initialize buffer 0 for output\n"); goto error_base; } - if (!swc_buffer_initialize(&output->buffers[1], drm, output->width, - output->height)) + if (!swc_buffer_initialize(&output->buffers[1], drm, output->geometry.width, + output->geometry.height)) { printf("could not initialize buffer 1 for output\n"); goto error_buffer0; diff --git a/libswc/output.h b/libswc/output.h @@ -4,6 +4,7 @@ #include "buffer.h" #include <stdint.h> +#include <pixman.h> #include <wayland-util.h> #include <wayland-server.h> #include <xf86drmMode.h> @@ -17,7 +18,7 @@ struct swc_output struct swc_drm * drm; /* The geometry of this output */ - uint32_t x, y, width, height; + pixman_rectangle32_t geometry; uint32_t physical_width, physical_height; struct wl_array modes;