From f6a6a44fe7e7561558a375b780ba17b0dfa1e842 Mon Sep 17 00:00:00 2001 From: nobled Date: Mon, 31 Jan 2011 02:14:17 +0000 Subject: [PATCH] wayland: clean up buffer creation code The height was being set from the ClutterGeometry in some parts and from the stage in others. And since both callers of this function pass &stage_wayland->allocation as the geometry anyway, the stage argument isn't really even needed. --- clutter/wayland/clutter-stage-wayland.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/clutter/wayland/clutter-stage-wayland.c b/clutter/wayland/clutter-stage-wayland.c index dac3b63a6..6011b9d40 100644 --- a/clutter/wayland/clutter-stage-wayland.c +++ b/clutter/wayland/clutter-stage-wayland.c @@ -60,8 +60,7 @@ G_DEFINE_TYPE_WITH_CODE (ClutterStageWayland, clutter_stage_window_iface_init)); static ClutterStageWaylandWaylandBuffer * -wayland_create_buffer (ClutterStageWayland *stage_wayland, - ClutterGeometry *geom) +wayland_create_buffer (ClutterGeometry *geom) { ClutterBackend *backend = clutter_get_default_backend (); ClutterBackendWayland *backend_wayland = CLUTTER_BACKEND_WAYLAND (backend); @@ -104,8 +103,8 @@ wayland_create_buffer (ClutterStageWayland *stage_wayland, buffer->wayland_buffer = wl_drm_create_buffer (backend_wayland->wayland_drm, name, - stage_wayland->allocation.width, - stage_wayland->allocation.height, + geom->width, + geom->height, stride, visual); rect.x = geom->x; @@ -171,7 +170,7 @@ clutter_stage_wayland_realize (ClutterStageWindow *stage_window) wl_surface_set_user_data (stage_wayland->wayland_surface, stage_wayland); stage_wayland->pick_buffer = - wayland_create_buffer (stage_wayland, &stage_wayland->allocation); + wayland_create_buffer (&stage_wayland->allocation); return TRUE; } @@ -502,7 +501,7 @@ _clutter_stage_wayland_redraw (ClutterStageWayland *stage_wayland, if (!stage_wayland->back_buffer) stage_wayland->back_buffer = - wayland_create_buffer (stage_wayland, &stage_wayland->allocation); + wayland_create_buffer (&stage_wayland->allocation); cogl_set_framebuffer (stage_wayland->back_buffer->offscreen); _clutter_stage_maybe_setup_viewport (stage_wayland->wrapper);