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.
This commit is contained in:
parent
7e4a8fd907
commit
f6a6a44fe7
1 changed files with 5 additions and 6 deletions
|
@ -60,8 +60,7 @@ G_DEFINE_TYPE_WITH_CODE (ClutterStageWayland,
|
||||||
clutter_stage_window_iface_init));
|
clutter_stage_window_iface_init));
|
||||||
|
|
||||||
static ClutterStageWaylandWaylandBuffer *
|
static ClutterStageWaylandWaylandBuffer *
|
||||||
wayland_create_buffer (ClutterStageWayland *stage_wayland,
|
wayland_create_buffer (ClutterGeometry *geom)
|
||||||
ClutterGeometry *geom)
|
|
||||||
{
|
{
|
||||||
ClutterBackend *backend = clutter_get_default_backend ();
|
ClutterBackend *backend = clutter_get_default_backend ();
|
||||||
ClutterBackendWayland *backend_wayland = CLUTTER_BACKEND_WAYLAND (backend);
|
ClutterBackendWayland *backend_wayland = CLUTTER_BACKEND_WAYLAND (backend);
|
||||||
|
@ -104,8 +103,8 @@ wayland_create_buffer (ClutterStageWayland *stage_wayland,
|
||||||
buffer->wayland_buffer =
|
buffer->wayland_buffer =
|
||||||
wl_drm_create_buffer (backend_wayland->wayland_drm,
|
wl_drm_create_buffer (backend_wayland->wayland_drm,
|
||||||
name,
|
name,
|
||||||
stage_wayland->allocation.width,
|
geom->width,
|
||||||
stage_wayland->allocation.height,
|
geom->height,
|
||||||
stride, visual);
|
stride, visual);
|
||||||
|
|
||||||
rect.x = geom->x;
|
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);
|
wl_surface_set_user_data (stage_wayland->wayland_surface, stage_wayland);
|
||||||
|
|
||||||
stage_wayland->pick_buffer =
|
stage_wayland->pick_buffer =
|
||||||
wayland_create_buffer (stage_wayland, &stage_wayland->allocation);
|
wayland_create_buffer (&stage_wayland->allocation);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -502,7 +501,7 @@ _clutter_stage_wayland_redraw (ClutterStageWayland *stage_wayland,
|
||||||
|
|
||||||
if (!stage_wayland->back_buffer)
|
if (!stage_wayland->back_buffer)
|
||||||
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);
|
cogl_set_framebuffer (stage_wayland->back_buffer->offscreen);
|
||||||
_clutter_stage_maybe_setup_viewport (stage_wayland->wrapper);
|
_clutter_stage_maybe_setup_viewport (stage_wayland->wrapper);
|
||||||
|
|
Loading…
Reference in a new issue