mirror of
https://github.com/brl/mutter.git
synced 2025-03-29 06:33:46 +00:00
surface-actor-wayland: Pass in a CoglTexture, as well
This makes it so that MetaSurfaceActorWayland is effectively just a wrapper actor around MetaShapedTexture with some extra scaling. I think the MetaSurfaceActor subclassing was a bad idea -- we really should have these abstractions in much higher levels in the stack than the compositor.
This commit is contained in:
parent
55331a0678
commit
dc0437a5b5
@ -183,7 +183,7 @@ meta_surface_actor_wayland_dispose (GObject *object)
|
|||||||
{
|
{
|
||||||
MetaSurfaceActorWayland *self = META_SURFACE_ACTOR_WAYLAND (object);
|
MetaSurfaceActorWayland *self = META_SURFACE_ACTOR_WAYLAND (object);
|
||||||
|
|
||||||
meta_surface_actor_wayland_set_buffer (self, NULL);
|
meta_surface_actor_wayland_set_texture (self, NULL);
|
||||||
|
|
||||||
G_OBJECT_CLASS (meta_surface_actor_wayland_parent_class)->dispose (object);
|
G_OBJECT_CLASS (meta_surface_actor_wayland_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
@ -230,18 +230,10 @@ meta_surface_actor_wayland_new (MetaWaylandSurface *surface)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_surface_actor_wayland_set_buffer (MetaSurfaceActorWayland *self,
|
meta_surface_actor_wayland_set_texture (MetaSurfaceActorWayland *self,
|
||||||
MetaWaylandBuffer *buffer)
|
CoglTexture *texture)
|
||||||
{
|
{
|
||||||
MetaSurfaceActorWaylandPrivate *priv = meta_surface_actor_wayland_get_instance_private (self);
|
|
||||||
MetaShapedTexture *stex = meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
|
MetaShapedTexture *stex = meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
|
||||||
CoglTexture *texture;
|
|
||||||
|
|
||||||
if (buffer)
|
|
||||||
texture = buffer->texture;
|
|
||||||
else
|
|
||||||
texture = NULL;
|
|
||||||
|
|
||||||
meta_shaped_texture_set_texture (stex, texture);
|
meta_shaped_texture_set_texture (stex, texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,8 +58,8 @@ GType meta_surface_actor_wayland_get_type (void);
|
|||||||
MetaSurfaceActor * meta_surface_actor_wayland_new (MetaWaylandSurface *surface);
|
MetaSurfaceActor * meta_surface_actor_wayland_new (MetaWaylandSurface *surface);
|
||||||
MetaWaylandSurface * meta_surface_actor_wayland_get_surface (MetaSurfaceActorWayland *self);
|
MetaWaylandSurface * meta_surface_actor_wayland_get_surface (MetaSurfaceActorWayland *self);
|
||||||
|
|
||||||
void meta_surface_actor_wayland_set_buffer (MetaSurfaceActorWayland *self,
|
void meta_surface_actor_wayland_set_texture (MetaSurfaceActorWayland *self,
|
||||||
MetaWaylandBuffer *buffer);
|
CoglTexture *texture);
|
||||||
|
|
||||||
double meta_surface_actor_wayland_get_scale (MetaSurfaceActorWayland *actor);
|
double meta_surface_actor_wayland_get_scale (MetaSurfaceActorWayland *actor);
|
||||||
|
|
||||||
|
@ -413,7 +413,7 @@ commit_pending_state (MetaWaylandSurface *surface,
|
|||||||
if (pending->buffer)
|
if (pending->buffer)
|
||||||
{
|
{
|
||||||
ensure_buffer_texture (pending->buffer);
|
ensure_buffer_texture (pending->buffer);
|
||||||
meta_surface_actor_wayland_set_buffer (META_SURFACE_ACTOR_WAYLAND (surface->surface_actor), pending->buffer);
|
meta_surface_actor_wayland_set_texture (META_SURFACE_ACTOR_WAYLAND (surface->surface_actor), pending->buffer->texture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user