mirror of
https://github.com/brl/mutter.git
synced 2025-06-14 01:09:30 +00:00
wayland: Updates client side wayland support
This updates Wayland support in line with upstream changes to the Wayland API and protocol. This update means we no longer use the Cogl stub winsys so a lot of code that had to manually interact with EGL and implement a swap_buffers mechanism could be removed and instead we now depend on Cogl to handle those things for us. This update also adds an input device manager consistent with other clutter backends. Note: to use the client side "wayland" clutter backend you need to have built Cogl with --enable-wayland-egl-platform. If Cogl has been built with support for multiple winsys backends then you should run applications with COGL_RENDERER=EGL in the environment. Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright (C) 2010 Intel Corporation.
|
||||
* Copyright (C) 2010,2011 Intel Corporation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@ -34,14 +34,9 @@
|
||||
#include <glib-object.h>
|
||||
#include <clutter/clutter-stage.h>
|
||||
|
||||
#define MESA_EGL_NO_X11_HEADERS
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
#include "cogl/clutter-stage-cogl.h"
|
||||
|
||||
#include "clutter-backend-wayland.h"
|
||||
|
||||
|
||||
#define CLUTTER_TYPE_STAGE_WAYLAND (_clutter_stage_wayland_get_type ())
|
||||
#define CLUTTER_TYPE_STAGE_WAYLAND (clutter_stage_wayland_get_type ())
|
||||
#define CLUTTER_STAGE_WAYLAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_STAGE_WAYLAND, ClutterStageWayland))
|
||||
#define CLUTTER_IS_STAGE_WAYLAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_STAGE_WAYLAND))
|
||||
#define CLUTTER_STAGE_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_STAGE_WAYLAND, ClutterStageWaylandClass))
|
||||
@ -51,64 +46,16 @@
|
||||
typedef struct _ClutterStageWayland ClutterStageWayland;
|
||||
typedef struct _ClutterStageWaylandClass ClutterStageWaylandClass;
|
||||
|
||||
#define BUFFER_TYPE_DRM 1
|
||||
#define BUFFER_TYPE_SHM 2
|
||||
|
||||
typedef struct _ClutterStageWaylandWaylandBuffer
|
||||
{
|
||||
CoglHandle offscreen;
|
||||
struct wl_buffer *wayland_buffer;
|
||||
cairo_region_t *dirty_region;
|
||||
CoglHandle tex;
|
||||
guint type;
|
||||
} ClutterStageWaylandWaylandBuffer;
|
||||
|
||||
typedef struct _ClutterStageWaylandWaylandBufferDRM
|
||||
{
|
||||
ClutterStageWaylandWaylandBuffer buffer;
|
||||
EGLImageKHR drm_image;
|
||||
GLuint texture;
|
||||
} ClutterStageWaylandWaylandBufferDRM;
|
||||
|
||||
typedef struct _ClutterStageWaylandWaylandBufferSHM
|
||||
{
|
||||
ClutterStageWaylandWaylandBuffer buffer;
|
||||
CoglPixelFormat format;
|
||||
guint8 *data;
|
||||
size_t size;
|
||||
unsigned int stride;
|
||||
} ClutterStageWaylandWaylandBufferSHM;
|
||||
|
||||
struct _ClutterStageWayland
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
/* the stage wrapper */
|
||||
ClutterStage *wrapper;
|
||||
|
||||
/* back pointer to the backend */
|
||||
ClutterBackendWayland *backend;
|
||||
|
||||
cairo_rectangle_int_t allocation;
|
||||
cairo_rectangle_int_t save_allocation;
|
||||
cairo_rectangle_int_t pending_allocation;
|
||||
struct wl_surface *wayland_surface;
|
||||
int pending_swaps;
|
||||
|
||||
ClutterStageWaylandWaylandBuffer *front_buffer;
|
||||
ClutterStageWaylandWaylandBuffer *back_buffer;
|
||||
ClutterStageWaylandWaylandBuffer *pick_buffer;
|
||||
cairo_region_t *repaint_region;
|
||||
ClutterStageCogl parent_instance;
|
||||
};
|
||||
|
||||
struct _ClutterStageWaylandClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
ClutterStageCoglClass parent_class;
|
||||
};
|
||||
|
||||
GType _clutter_stage_wayland_get_type (void) G_GNUC_CONST;
|
||||
|
||||
void _clutter_stage_wayland_redraw (ClutterStageWayland *stage_wayland,
|
||||
ClutterStage *stage);
|
||||
GType clutter_stage_wayland_get_type (void) G_GNUC_CONST;
|
||||
|
||||
#endif /* __CLUTTER_STAGE_WAYLAND_H__ */
|
||||
|
Reference in New Issue
Block a user