wayland: Make the MetaWaylandRegion type opaque
This commit is contained in:
parent
ead0e902ed
commit
9f5c38d121
4 changed files with 19 additions and 8 deletions
|
@ -26,6 +26,12 @@
|
|||
|
||||
#include "meta-wayland-region.h"
|
||||
|
||||
struct _MetaWaylandRegion
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
cairo_region_t *region;
|
||||
};
|
||||
|
||||
static void
|
||||
wl_region_destroy (struct wl_client *client,
|
||||
struct wl_resource *resource)
|
||||
|
@ -91,3 +97,9 @@ meta_wayland_region_create (MetaWaylandCompositor *compositor,
|
|||
|
||||
return region;
|
||||
}
|
||||
|
||||
cairo_region_t *
|
||||
meta_wayland_region_peek_cairo_region (MetaWaylandRegion *region)
|
||||
{
|
||||
return region->region;
|
||||
}
|
||||
|
|
|
@ -30,15 +30,11 @@
|
|||
#include <wayland-server.h>
|
||||
#include "meta-wayland-types.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
cairo_region_t *region;
|
||||
} MetaWaylandRegion;
|
||||
|
||||
MetaWaylandRegion * meta_wayland_region_create (MetaWaylandCompositor *compositor,
|
||||
struct wl_client *client,
|
||||
struct wl_resource *compositor_resource,
|
||||
guint32 id);
|
||||
|
||||
cairo_region_t * meta_wayland_region_peek_cairo_region (MetaWaylandRegion *region);
|
||||
|
||||
#endif /* META_WAYLAND_REGION_H */
|
||||
|
|
|
@ -540,7 +540,8 @@ wl_surface_set_opaque_region (struct wl_client *client,
|
|||
if (region_resource)
|
||||
{
|
||||
MetaWaylandRegion *region = wl_resource_get_user_data (region_resource);
|
||||
surface->pending.opaque_region = cairo_region_copy (region->region);
|
||||
cairo_region_t *cr_region = meta_wayland_region_peek_cairo_region (region);
|
||||
surface->pending.opaque_region = cairo_region_copy (cr_region);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -559,7 +560,8 @@ wl_surface_set_input_region (struct wl_client *client,
|
|||
if (region_resource)
|
||||
{
|
||||
MetaWaylandRegion *region = wl_resource_get_user_data (region_resource);
|
||||
surface->pending.input_region = cairo_region_copy (region->region);
|
||||
cairo_region_t *cr_region = meta_wayland_region_peek_cairo_region (region);
|
||||
surface->pending.input_region = cairo_region_copy (cr_region);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ typedef struct _MetaWaylandDataSource MetaWaylandDataSource;
|
|||
typedef struct _MetaWaylandDataDevice MetaWaylandDataDevice;
|
||||
|
||||
typedef struct _MetaWaylandBuffer MetaWaylandBuffer;
|
||||
typedef struct _MetaWaylandRegion MetaWaylandRegion;
|
||||
|
||||
typedef struct _MetaWaylandSurface MetaWaylandSurface;
|
||||
|
||||
|
|
Loading…
Reference in a new issue