summaryrefslogtreecommitdiff
path: root/src/wayland/meta-wayland-surface.c
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2014-02-01 17:21:11 -0500
committerJasper St. Pierre <jstpierre@mecheye.net>2014-02-19 10:24:38 -0500
commit2210c30cbae29a8c43e6992a61de259ee52e666a (patch)
treeb0ad301a75a4474e02b576579042c06440182d9c /src/wayland/meta-wayland-surface.c
parent6b98ac3d1fed4415790682bf93226a1259719559 (diff)
downloadmutter-wip/surface-content.tar.gz
window-actor: Split into two subclasses of MetaSurfaceActorwip/surface-content
The rendering logic before was somewhat complex. We had three independent cases to take into account when doing rendering: * X11 compositor. In this case, we're a traditional X11 compositor, not a Wayland compositor. We use XCompositeNameWindowPixmap to get the backing pixmap for the window, and deal with the COMPOSITE extension messiness. In this case, meta_is_wayland_compositor() is FALSE. * Wayland clients. In this case, we're a Wayland compositor managing Wayland surfaces. The rendering for this is fairly straightforward, as Cogl handles most of the complexity with EGL and SHM buffers... Wayland clients give us the input and opaque regions through wl_surface. In this case, meta_is_wayland_compositor() is TRUE and priv->window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND. * XWayland clients. In this case, we're a Wayland compositor, like above, and XWayland hands us Wayland surfaces. XWayland handles the COMPOSITE extension messiness for us, and hands us a buffer like any other Wayland client. We have to fetch the input and opaque regions from the X11 window ourselves. In this case, meta_is_wayland_compositor() is TRUE and priv->window->client_type == META_WINDOW_CLIENT_TYPE_X11. We now split the rendering logic into two subclasses, which are: * MetaSurfaceActorX11, which handles the X11 compositor case, in that it uses XCompositeNameWindowPixmap to get the backing pixmap, and deal with all the COMPOSITE extension messiness. * MetaSurfaceActorWayland, which handles the Wayland compositor case for both native Wayland clients and XWayland clients. XWayland handles COMPOSITE for us, and handles pushing a surface over through the xf86-video-wayland DDX. Frame sync is still in MetaWindowActor, as it needs to work for both the X11 compositor and XWayland client cases. When Wayland's video display protocol lands, this will need to be significantly overhauled, as it would have to work for any wl_surface, including subsurfaces, so we would need surface-level discretion. https://bugzilla.gnome.org/show_bug.cgi?id=720631
Diffstat (limited to 'src/wayland/meta-wayland-surface.c')
-rw-r--r--src/wayland/meta-wayland-surface.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 7d9257367..0783316fe 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -44,11 +44,11 @@
#include "meta-wayland-private.h"
#include "meta-xwayland-private.h"
#include "meta-wayland-stage.h"
-#include "meta-surface-actor.h"
#include "meta-wayland-seat.h"
#include "meta-wayland-keyboard.h"
#include "meta-wayland-pointer.h"
#include "meta-wayland-data-device.h"
+
#include "meta-cursor-tracker-private.h"
#include "display-private.h"
#include "window-private.h"
@@ -58,6 +58,9 @@
#include "meta-idle-monitor-private.h"
#include "monitor-private.h"
+#include "meta-surface-actor.h"
+#include "meta-surface-actor-wayland.h"
+
typedef enum
{
META_WAYLAND_SUBSURFACE_PLACEMENT_ABOVE,
@@ -114,8 +117,8 @@ surface_process_damage (MetaWaylandSurface *surface,
{
cairo_rectangle_int_t rect;
cairo_region_get_rectangle (region, i, &rect);
- meta_surface_actor_damage_area (surface->surface_actor,
- rect.x, rect.y, rect.width, rect.height);
+ meta_surface_actor_process_damage (surface->surface_actor,
+ rect.x, rect.y, rect.width, rect.height);
}
}
@@ -295,7 +298,7 @@ actor_surface_commit (MetaWaylandSurface *surface,
if (buffer_changed)
{
ensure_buffer_texture (buffer);
- meta_surface_actor_attach_wayland_buffer (surface_actor, buffer);
+ meta_surface_actor_wayland_set_buffer (META_SURFACE_ACTOR_WAYLAND (surface->surface_actor), buffer);
}
surface_process_damage (surface, pending->damage);
@@ -645,7 +648,7 @@ meta_wayland_surface_create (MetaWaylandCompositor *compositor,
wl_resource_set_implementation (surface->resource, &meta_wayland_surface_interface, surface, wl_surface_destructor);
surface->buffer_destroy_listener.notify = surface_handle_buffer_destroy;
- surface->surface_actor = g_object_ref_sink (meta_surface_actor_new (surface));
+ surface->surface_actor = g_object_ref_sink (meta_surface_actor_wayland_new (surface));
clutter_actor_set_reactive (CLUTTER_ACTOR (surface->surface_actor), TRUE);
double_buffered_state_init (&surface->pending);