From: Benjamin Franzke Date: Fri, 18 Feb 2011 15:51:37 +0000 (+0100) Subject: compositor: Add flags parameter to wlsc_output_init X-Git-Tag: 0.85.0~577 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b765ffb8c22c22cde09145b76d1f3727da90ae6;p=platform%2Fupstream%2Fweston.git compositor: Add flags parameter to wlsc_output_init Currently available flags: - WL_OUTPUT_FLIPPED --- diff --git a/compositor/compositor-drm.c b/compositor/compositor-drm.c index 83fc744..806afc6 100644 --- a/compositor/compositor-drm.c +++ b/compositor/compositor-drm.c @@ -208,7 +208,7 @@ create_output_for_connector(struct drm_compositor *ec, memset(output, 0, sizeof *output); 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->connector_id = connector->connector_id; diff --git a/compositor/compositor-wayland.c b/compositor/compositor-wayland.c index 11320d8..1793089 100644 --- a/compositor/compositor-wayland.c +++ b/compositor/compositor-wayland.c @@ -233,7 +233,7 @@ wayland_compositor_create_output(struct wayland_compositor *c, return -1; 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 = wl_compositor_create_surface(c->parent.compositor); wl_surface_set_user_data(output->parent.surface, output); diff --git a/compositor/compositor-x11.c b/compositor/compositor-x11.c index f4cb129..27b7cd9 100644 --- a/compositor/compositor-x11.c +++ b/compositor/compositor-x11.c @@ -363,7 +363,7 @@ x11_compositor_create_output(struct x11_compositor *c, int width, int height) return -1; 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; output->window = xcb_generate_id(c->conn); diff --git a/compositor/compositor.c b/compositor/compositor.c index 2fcbb70..e3989d5 100644 --- a/compositor/compositor.c +++ b/compositor/compositor.c @@ -1288,8 +1288,10 @@ init_shaders(struct wlsc_compositor *ec) void 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->x = x; output->y = y; @@ -1305,8 +1307,11 @@ wlsc_output_init(struct wlsc_output *output, struct wlsc_compositor *c, wlsc_matrix_translate(&output->matrix, -output->x - output->width / 2.0, -output->y - output->height / 2.0, 0); + + flip = (flags & WL_OUTPUT_FLIPPED) ? -1 : 1; 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; wl_display_add_object(c->wl_display, &output->object); diff --git a/compositor/compositor.h b/compositor/compositor.h index b0901e8..1279e76 100644 --- a/compositor/compositor.h +++ b/compositor/compositor.h @@ -130,6 +130,10 @@ struct wlsc_compositor { #define MODIFIER_ALT (1 << 9) #define MODIFIER_SUPER (1 << 10) +enum wlsc_output_flags { + WL_OUTPUT_FLIPPED = 0x01 +}; + struct wlsc_vector { GLfloat f[4]; }; @@ -215,7 +219,7 @@ int wlsc_compositor_init(struct wlsc_compositor *ec, struct wl_display *display); void 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 wlsc_input_device_init(struct wlsc_input_device *device, struct wlsc_compositor *ec);