compositor: Add flags parameter to wlsc_output_init

Currently available flags:
 - WL_OUTPUT_FLIPPED
dev
Benjamin Franzke 14 years ago
parent faa0a9dfa9
commit 1b765ffb8c
  1. 2
      compositor/compositor-drm.c
  2. 2
      compositor/compositor-wayland.c
  3. 2
      compositor/compositor-x11.c
  4. 9
      compositor/compositor.c
  5. 6
      compositor/compositor.h

@ -208,7 +208,7 @@ create_output_for_connector(struct drm_compositor *ec,
memset(output, 0, sizeof *output); memset(output, 0, sizeof *output);
wlsc_output_init(&output->base, &ec->base, 0, 0, wlsc_output_init(&output->base, &ec->base, 0, 0,
mode->hdisplay, mode->vdisplay); mode->hdisplay, mode->vdisplay, 0);
output->crtc_id = resources->crtcs[i]; output->crtc_id = resources->crtcs[i];
output->connector_id = connector->connector_id; output->connector_id = connector->connector_id;

@ -233,7 +233,7 @@ wayland_compositor_create_output(struct wayland_compositor *c,
return -1; return -1;
memset(output, 0, sizeof *output); memset(output, 0, sizeof *output);
wlsc_output_init(&output->base, &c->base, 0, 0, width, height); wlsc_output_init(&output->base, &c->base, 0, 0, width, height, 0);
output->parent.surface = output->parent.surface =
wl_compositor_create_surface(c->parent.compositor); wl_compositor_create_surface(c->parent.compositor);
wl_surface_set_user_data(output->parent.surface, output); wl_surface_set_user_data(output->parent.surface, output);

@ -363,7 +363,7 @@ x11_compositor_create_output(struct x11_compositor *c, int width, int height)
return -1; return -1;
memset(output, 0, sizeof *output); memset(output, 0, sizeof *output);
wlsc_output_init(&output->base, &c->base, 0, 0, width, height); wlsc_output_init(&output->base, &c->base, 0, 0, width, height, 0);
values[1] = c->null_cursor; values[1] = c->null_cursor;
output->window = xcb_generate_id(c->conn); output->window = xcb_generate_id(c->conn);

@ -1288,8 +1288,10 @@ init_shaders(struct wlsc_compositor *ec)
void void
wlsc_output_init(struct wlsc_output *output, struct wlsc_compositor *c, wlsc_output_init(struct wlsc_output *output, struct wlsc_compositor *c,
int x, int y, int width, int height) int x, int y, int width, int height, uint32_t flags)
{ {
int flip;
output->compositor = c; output->compositor = c;
output->x = x; output->x = x;
output->y = y; output->y = y;
@ -1305,8 +1307,11 @@ wlsc_output_init(struct wlsc_output *output, struct wlsc_compositor *c,
wlsc_matrix_translate(&output->matrix, wlsc_matrix_translate(&output->matrix,
-output->x - output->width / 2.0, -output->x - output->width / 2.0,
-output->y - output->height / 2.0, 0); -output->y - output->height / 2.0, 0);
flip = (flags & WL_OUTPUT_FLIPPED) ? -1 : 1;
wlsc_matrix_scale(&output->matrix, wlsc_matrix_scale(&output->matrix,
2.0 / output->width, 2.0 / output->height, 1); 2.0 / output->width,
flip * 2.0 / output->height, 1);
output->object.interface = &wl_output_interface; output->object.interface = &wl_output_interface;
wl_display_add_object(c->wl_display, &output->object); wl_display_add_object(c->wl_display, &output->object);

@ -130,6 +130,10 @@ struct wlsc_compositor {
#define MODIFIER_ALT (1 << 9) #define MODIFIER_ALT (1 << 9)
#define MODIFIER_SUPER (1 << 10) #define MODIFIER_SUPER (1 << 10)
enum wlsc_output_flags {
WL_OUTPUT_FLIPPED = 0x01
};
struct wlsc_vector { struct wlsc_vector {
GLfloat f[4]; GLfloat f[4];
}; };
@ -215,7 +219,7 @@ int
wlsc_compositor_init(struct wlsc_compositor *ec, struct wl_display *display); wlsc_compositor_init(struct wlsc_compositor *ec, struct wl_display *display);
void void
wlsc_output_init(struct wlsc_output *output, struct wlsc_compositor *c, wlsc_output_init(struct wlsc_output *output, struct wlsc_compositor *c,
int x, int y, int width, int height); int x, int y, int width, int height, uint32_t flags);
void void
wlsc_input_device_init(struct wlsc_input_device *device, wlsc_input_device_init(struct wlsc_input_device *device,
struct wlsc_compositor *ec); struct wlsc_compositor *ec);

Loading…
Cancel
Save