wayland/actor-surface: Set geometry scale in surface actor

Now that MetaShapedTexture is a ClutterContent implemetation that
is aware of its own buffer scale, it is possible to simplify the
event translation routines.

Set the geometry scale in MetaSurfaceActor, and stop adjusting the
surface scale when translating points. Also remove the now obsoleted
meta_wayland_actor_surface_calculate_scale() function.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/409
This commit is contained in:
Georges Basile Stavracas Neto
2019-07-09 12:29:37 -03:00
committed by Jonas Ådahl
parent 75cffd0ec4
commit d3f30d9ece
4 changed files with 11 additions and 27 deletions

View File

@ -153,8 +153,7 @@ meta_wayland_shell_surface_surface_commit (MetaWaylandSurfaceRole *surface_role
MetaWaylandSurfaceRoleClass *surface_role_class;
MetaWindow *window;
MetaWaylandBuffer *buffer;
CoglTexture *texture;
double scale;
double geometry_scale;
surface_role_class =
META_WAYLAND_SURFACE_ROLE_CLASS (meta_wayland_shell_surface_parent_class);
@ -168,11 +167,12 @@ meta_wayland_shell_surface_surface_commit (MetaWaylandSurfaceRole *surface_role
if (!window)
return;
scale = meta_wayland_actor_surface_calculate_scale (actor_surface);
texture = meta_wayland_surface_get_texture (surface);
geometry_scale = meta_wayland_actor_surface_get_geometry_scale (actor_surface);
window->buffer_rect.width = cogl_texture_get_width (texture) * scale;
window->buffer_rect.height = cogl_texture_get_height (texture) * scale;
window->buffer_rect.width =
meta_wayland_surface_get_width (surface) * geometry_scale;
window->buffer_rect.height =
meta_wayland_surface_get_height (surface) * geometry_scale;
}
static void