1
0
Fork 0

cogl: Port Bitmap away from CoglObject

We still need to use set_qdata_full as CoglBitmapPixbuf would free
the data itself by unrefing the pixbuf

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3193>
This commit is contained in:
Bilal Elmoussaoui 2023-08-18 11:28:05 +02:00 committed by Marge Bot
parent 3c6c6a0ea5
commit c1e6948e42
23 changed files with 109 additions and 112 deletions

View file

@ -129,7 +129,7 @@ clutter_canvas_finalize (GObject *gobject)
if (priv->buffer != NULL)
{
cogl_object_unref (priv->buffer);
g_object_unref (priv->buffer);
priv->buffer = NULL;
}
@ -445,7 +445,7 @@ clutter_canvas_invalidate (ClutterContent *content)
if (priv->buffer != NULL)
{
cogl_object_unref (priv->buffer);
g_object_unref (priv->buffer);
priv->buffer = NULL;
}

View file

@ -2824,7 +2824,7 @@ clutter_stage_paint_to_buffer (ClutterStage *stage,
COGL_READ_PIXELS_COLOR_BUFFER,
bitmap);
cogl_object_unref (bitmap);
g_object_unref (bitmap);
g_object_unref (framebuffer);
return TRUE;
@ -2928,7 +2928,7 @@ clutter_stage_capture_view_into (ClutterStage *stage,
COGL_READ_PIXELS_COLOR_BUFFER,
bitmap);
cogl_object_unref (bitmap);
g_object_unref (bitmap);
}
/**

View file

@ -556,7 +556,7 @@ _cogl_atlas_texture_convert_bitmap_for_upload (CoglAtlasTexture *atlas_tex,
cogl_bitmap_get_height (upload_bmp),
cogl_bitmap_get_rowstride (upload_bmp));
cogl_object_unref (upload_bmp);
g_object_unref (upload_bmp);
return override_bmp;
}
@ -599,7 +599,7 @@ _cogl_atlas_texture_set_region (CoglTexture *tex,
upload_bmp,
error);
cogl_object_unref (upload_bmp);
g_object_unref (upload_bmp);
return ret;
}
@ -836,7 +836,7 @@ allocate_from_bitmap (CoglAtlasTexture *atlas_tex,
internal_format,
error))
{
cogl_object_unref (upload_bmp);
g_object_unref (upload_bmp);
return FALSE;
}
@ -853,11 +853,11 @@ allocate_from_bitmap (CoglAtlasTexture *atlas_tex,
error))
{
_cogl_atlas_texture_remove_from_atlas (atlas_tex);
cogl_object_unref (upload_bmp);
g_object_unref (upload_bmp);
return FALSE;
}
cogl_object_unref (upload_bmp);
g_object_unref (upload_bmp);
_cogl_texture_set_allocated (tex, internal_format, width, height);
@ -891,11 +891,11 @@ cogl_atlas_texture_new_from_bitmap (CoglBitmap *bmp)
{
CoglTextureLoader *loader;
g_return_val_if_fail (cogl_is_bitmap (bmp), NULL);
g_return_val_if_fail (COGL_IS_BITMAP (bmp), NULL);
loader = _cogl_texture_create_loader ();
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_BITMAP;
loader->src.bitmap.bitmap = cogl_object_ref (bmp);
loader->src.bitmap.bitmap = g_object_ref (bmp);
return _cogl_atlas_texture_create_base (_cogl_bitmap_get_context (bmp),
cogl_bitmap_get_width (bmp),
@ -933,7 +933,7 @@ cogl_atlas_texture_new_from_data (CoglContext *ctx,
atlas_tex = cogl_atlas_texture_new_from_bitmap (bmp);
cogl_object_unref (bmp);
g_object_unref (bmp);
if (atlas_tex &&
!cogl_texture_allocate (COGL_TEXTURE (atlas_tex), error))

View file

@ -333,7 +333,7 @@ _cogl_atlas_create_texture (CoglAtlas *atlas,
tex = NULL;
}
cogl_object_unref (clear_bmp);
g_object_unref (clear_bmp);
g_free (clear_data);
}

View file

@ -527,7 +527,7 @@ _cogl_bitmap_convert (CoglBitmap *src_bmp,
if (!_cogl_bitmap_convert_into_bitmap (src_bmp, dst_bmp, error))
{
cogl_object_unref (dst_bmp);
g_object_unref (dst_bmp);
return NULL;
}
@ -596,7 +596,7 @@ _cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp,
return NULL;
}
else
dst_bmp = cogl_object_ref (src_bmp);
dst_bmp = g_object_ref (src_bmp);
}
else
{
@ -612,7 +612,7 @@ _cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp,
if (closest_format != src_format)
dst_bmp = _cogl_bitmap_convert (src_bmp, closest_format, error);
else
dst_bmp = cogl_object_ref (src_bmp);
dst_bmp = g_object_ref (src_bmp);
}
return dst_bmp;

View file

@ -32,13 +32,12 @@
#include <glib.h>
#include "cogl/cogl-object-private.h"
#include "cogl/cogl-buffer.h"
#include "cogl/cogl-bitmap.h"
struct _CoglBitmap
{
CoglObject _parent;
GObject parent_instance;
/* Pointer back to the context that this bitmap was created with */
CoglContext *context;

View file

@ -37,28 +37,42 @@
#include "cogl/cogl-buffer-private.h"
#include "cogl/cogl-pixel-buffer.h"
#include "cogl/cogl-context-private.h"
#include "cogl/cogl-gtype-private.h"
#include <string.h>
static void _cogl_bitmap_free (CoglBitmap *bmp);
static GQuark bitmap_free_key = 0;
COGL_OBJECT_DEFINE (Bitmap, bitmap);
COGL_GTYPE_DEFINE_CLASS (Bitmap, bitmap);
G_DEFINE_TYPE (CoglBitmap, cogl_bitmap, G_TYPE_OBJECT);
static void
_cogl_bitmap_free (CoglBitmap *bmp)
cogl_bitmap_dispose (GObject *object)
{
CoglBitmap *bmp = COGL_BITMAP (object);
g_assert (!bmp->mapped);
g_assert (!bmp->bound);
if (bmp->shared_bmp)
cogl_object_unref (bmp->shared_bmp);
g_object_unref (bmp->shared_bmp);
if (bmp->buffer)
cogl_object_unref (bmp->buffer);
g_free (bmp);
G_OBJECT_CLASS (cogl_bitmap_parent_class)->dispose (object);
}
static void
cogl_bitmap_init (CoglBitmap *bitmap)
{
}
static void
cogl_bitmap_class_init (CoglBitmapClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
object_class->dispose = cogl_bitmap_dispose;
}
gboolean
@ -106,7 +120,7 @@ _cogl_bitmap_copy (CoglBitmap *src_bmp,
width, height,
error))
{
cogl_object_unref (dst_bmp);
g_object_unref (dst_bmp);
return NULL;
}
@ -182,7 +196,7 @@ cogl_bitmap_new_for_data (CoglContext *context,
if (rowstride == 0)
rowstride = width * cogl_pixel_format_get_bytes_per_pixel (format, 0);
bmp = g_new0 (CoglBitmap, 1);
bmp = g_object_new (COGL_TYPE_BITMAP, NULL);
bmp->context = context;
bmp->format = format;
bmp->width = width;
@ -194,7 +208,7 @@ cogl_bitmap_new_for_data (CoglContext *context,
bmp->shared_bmp = NULL;
bmp->buffer = NULL;
return _cogl_bitmap_object_new (bmp);
return bmp;
}
CoglBitmap *
@ -204,7 +218,7 @@ _cogl_bitmap_new_with_malloc_buffer (CoglContext *context,
CoglPixelFormat format,
GError **error)
{
static CoglUserDataKey bitmap_free_key;
bitmap_free_key = g_quark_from_static_string ("-cogl-bitmap-malloc-buffer-key");
int bpp;
int rowstride;
uint8_t *data;
@ -231,10 +245,10 @@ _cogl_bitmap_new_with_malloc_buffer (CoglContext *context,
format,
rowstride,
data);
cogl_object_set_user_data (COGL_OBJECT (bitmap),
&bitmap_free_key,
data,
g_free);
g_object_set_qdata_full (G_OBJECT (bitmap),
bitmap_free_key,
data,
g_free);
return bitmap;
}
@ -254,7 +268,7 @@ _cogl_bitmap_new_shared (CoglBitmap *shared_bmp,
rowstride,
NULL /* data */);
bmp->shared_bmp = cogl_object_ref (shared_bmp);
bmp->shared_bmp = g_object_ref (shared_bmp);
return bmp;
}

View file

@ -49,23 +49,22 @@ typedef struct _CoglBitmap CoglBitmap;
G_BEGIN_DECLS
/**
* cogl_bitmap_get_gtype:
* CoglBitmap:
*
* Returns: a #GType that can be used with the GLib type system.
*/
COGL_EXPORT
GType cogl_bitmap_get_gtype (void);
/**
* SECTION:cogl-bitmap
* @short_description: Functions for loading images
* Functions for loading images
*
* Cogl allows loading image data into memory as CoglBitmaps without
* loading them immediately into GPU textures.
*
* #CoglBitmap is available since Cogl 1.0
*/
#define COGL_TYPE_BITMAP (cogl_bitmap_get_type ())
COGL_EXPORT
G_DECLARE_FINAL_TYPE (CoglBitmap,
cogl_bitmap,
COGL,
BITMAP,
GObject)
/**
* cogl_bitmap_new_from_buffer: (skip)
@ -197,18 +196,6 @@ cogl_bitmap_get_rowstride (CoglBitmap *bitmap);
COGL_EXPORT CoglPixelBuffer *
cogl_bitmap_get_buffer (CoglBitmap *bitmap);
/**
* cogl_is_bitmap:
* @object: a #CoglObject pointer
*
* Checks whether @object is a #CoglBitmap
*
* Return value: %TRUE if the passed @object represents a bitmap,
* and %FALSE otherwise
*/
COGL_EXPORT gboolean
cogl_is_bitmap (void *object);
/**
* COGL_BITMAP_ERROR:
*

View file

@ -1559,7 +1559,7 @@ cogl_framebuffer_read_pixels (CoglFramebuffer *framebuffer,
COGL_READ_PIXELS_COLOR_BUFFER,
bitmap,
NULL);
cogl_object_unref (bitmap);
g_object_unref (bitmap);
return ret;
}

View file

@ -1251,7 +1251,7 @@ cogl_framebuffer_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
* x, y,
* COGL_READ_PIXELS_COLOR_BUFFER,
* bitmap);
* cogl_object_unref (bitmap);
* g_object_unref (bitmap);
* ]|
*
* Return value: %TRUE if the read succeeded or %FALSE otherwise.

View file

@ -270,12 +270,12 @@ _cogl_texture_2d_sliced_set_waste (CoglTexture2DSliced *tex_2ds,
0, /* level */
error))
{
cogl_object_unref (waste_bmp);
g_object_unref (waste_bmp);
_cogl_bitmap_unmap (source_bmp);
return FALSE;
}
cogl_object_unref (waste_bmp);
g_object_unref (waste_bmp);
}
if (need_y)
@ -330,12 +330,12 @@ _cogl_texture_2d_sliced_set_waste (CoglTexture2DSliced *tex_2ds,
0, /* level */
error))
{
cogl_object_unref (waste_bmp);
g_object_unref (waste_bmp);
_cogl_bitmap_unmap (source_bmp);
return FALSE;
}
cogl_object_unref (waste_bmp);
g_object_unref (waste_bmp);
}
_cogl_bitmap_unmap (source_bmp);
@ -891,11 +891,11 @@ cogl_texture_2d_sliced_new_from_bitmap (CoglBitmap *bmp,
{
CoglTextureLoader *loader;
g_return_val_if_fail (cogl_is_bitmap (bmp), NULL);
g_return_val_if_fail (COGL_IS_BITMAP (bmp), NULL);
loader = _cogl_texture_create_loader ();
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_BITMAP;
loader->src.bitmap.bitmap = cogl_object_ref (bmp);
loader->src.bitmap.bitmap = g_object_ref (bmp);
return _cogl_texture_2d_sliced_create_base (_cogl_bitmap_get_context (bmp),
cogl_bitmap_get_width (bmp),
@ -935,7 +935,7 @@ cogl_texture_2d_sliced_new_from_data (CoglContext *ctx,
tex_2ds = cogl_texture_2d_sliced_new_from_bitmap (bmp, max_waste);
cogl_object_unref (bmp);
g_object_unref (bmp);
if (tex_2ds &&
!cogl_texture_allocate (COGL_TEXTURE (tex_2ds), error))
@ -1008,7 +1008,7 @@ allocate_from_bitmap (CoglTexture2DSliced *tex_2ds,
internal_format,
error))
{
cogl_object_unref (upload_bmp);
g_object_unref (upload_bmp);
return FALSE;
}
@ -1017,11 +1017,11 @@ allocate_from_bitmap (CoglTexture2DSliced *tex_2ds,
error))
{
free_slices (tex_2ds);
cogl_object_unref (upload_bmp);
g_object_unref (upload_bmp);
return FALSE;
}
cogl_object_unref (upload_bmp);
g_object_unref (upload_bmp);
_cogl_texture_set_allocated (tex, internal_format, width, height);
@ -1256,7 +1256,7 @@ _cogl_texture_2d_sliced_set_region (CoglTexture *tex,
dst_width, dst_height,
upload_bmp,
error);
cogl_object_unref (upload_bmp);
g_object_unref (upload_bmp);
return status;
}

View file

@ -168,7 +168,7 @@ cogl_texture_2d_new_from_bitmap (CoglBitmap *bmp)
loader = _cogl_texture_create_loader ();
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_BITMAP;
loader->src.bitmap.bitmap = cogl_object_ref (bmp);
loader->src.bitmap.bitmap = g_object_ref (bmp);
return _cogl_texture_2d_create_base (_cogl_bitmap_get_context (bmp),
cogl_bitmap_get_width (bmp),
@ -206,7 +206,7 @@ cogl_texture_2d_new_from_data (CoglContext *ctx,
tex_2d = cogl_texture_2d_new_from_bitmap (bmp);
cogl_object_unref (bmp);
g_object_unref (bmp);
if (tex_2d &&
!cogl_texture_allocate (COGL_TEXTURE (tex_2d), error))

View file

@ -152,7 +152,7 @@ _cogl_texture_free_loader (CoglTexture *texture)
case COGL_TEXTURE_SOURCE_TYPE_EGL_IMAGE_EXTERNAL:
break;
case COGL_TEXTURE_SOURCE_TYPE_BITMAP:
cogl_object_unref (loader->src.bitmap.bitmap);
g_object_unref (loader->src.bitmap.bitmap);
break;
}
g_free (loader);
@ -457,7 +457,7 @@ _cogl_texture_set_region (CoglTexture *texture,
level,
error);
cogl_object_unref (source_bmp);
g_object_unref (source_bmp);
return ret;
}
@ -594,7 +594,7 @@ get_texture_bits_via_offscreen (CoglTexture *meta_texture,
g_clear_error (&ignore_error);
cogl_object_unref (bitmap);
g_object_unref (bitmap);
g_object_unref (framebuffer);
@ -876,7 +876,7 @@ cogl_texture_get_data (CoglTexture *texture,
*/
if (!tg_data.success)
{
cogl_object_unref (target_bmp);
g_object_unref (target_bmp);
return 0;
}
@ -902,10 +902,10 @@ cogl_texture_get_data (CoglTexture *texture,
byte_size = 0;
}
cogl_object_unref (new_bmp);
g_object_unref (new_bmp);
}
cogl_object_unref (target_bmp);
g_object_unref (target_bmp);
return byte_size;
}

View file

@ -547,7 +547,7 @@ cogl_gl_framebuffer_read_pixels_into_bitmap (CoglFramebufferDriver *driver,
_cogl_bitmap_set_format (bitmap, format);
cogl_object_unref (tmp_bmp);
g_object_unref (tmp_bmp);
if (!succeeded)
goto EXIT;
@ -578,7 +578,7 @@ cogl_gl_framebuffer_read_pixels_into_bitmap (CoglFramebufferDriver *driver,
width, height,
rowstride);
else
shared_bmp = cogl_object_ref (bitmap);
shared_bmp = g_object_ref (bitmap);
bpp = cogl_pixel_format_get_bytes_per_pixel (bmp_format, 0);
@ -596,7 +596,7 @@ cogl_gl_framebuffer_read_pixels_into_bitmap (CoglFramebufferDriver *driver,
* to know if there was a problem */
if (internal_error)
{
cogl_object_unref (shared_bmp);
g_object_unref (shared_bmp);
g_propagate_error (error, internal_error);
goto EXIT;
}
@ -615,7 +615,7 @@ cogl_gl_framebuffer_read_pixels_into_bitmap (CoglFramebufferDriver *driver,
_cogl_bitmap_convert_premult_status (shared_bmp, format, error))
succeeded = TRUE;
cogl_object_unref (shared_bmp);
g_object_unref (shared_bmp);
if (!succeeded)
goto EXIT;

View file

@ -245,13 +245,13 @@ allocate_from_bitmap (CoglTexture2D *tex_2d,
gl_type,
error))
{
cogl_object_unref (upload_bmp);
g_object_unref (upload_bmp);
return FALSE;
}
tex_2d->gl_internal_format = gl_intformat;
cogl_object_unref (upload_bmp);
g_object_unref (upload_bmp);
tex_2d->internal_format = internal_format;
@ -606,7 +606,7 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d,
gl_type,
error);
cogl_object_unref (upload_bmp);
g_object_unref (upload_bmp);
return status;
}

View file

@ -164,7 +164,7 @@ prepare_bitmap_alignment_for_upload (CoglContext *ctx,
if (_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_UNPACK_SUBIMAGE) ||
src_rowstride == 0)
return cogl_object_ref (src_bmp);
return g_object_ref (src_bmp);
/* Work out the alignment of the source rowstride */
alignment = 1 << (ffs (src_rowstride) - 1);
@ -173,7 +173,7 @@ prepare_bitmap_alignment_for_upload (CoglContext *ctx,
/* If the aligned data equals the rowstride then we can upload from
the bitmap directly using GL_UNPACK_ALIGNMENT */
if (((width * bpp + alignment - 1) & ~(alignment - 1)) == src_rowstride)
return cogl_object_ref (src_bmp);
return g_object_ref (src_bmp);
/* Otherwise we need to copy the bitmap to pack the alignment
because GLES has no GL_ROW_LENGTH */
else
@ -238,7 +238,7 @@ _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx,
width, height,
error))
{
cogl_object_unref (slice_bmp);
g_object_unref (slice_bmp);
return FALSE;
}
@ -264,7 +264,7 @@ _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx,
if (internal_error)
{
g_propagate_error (error, internal_error);
cogl_object_unref (slice_bmp);
g_object_unref (slice_bmp);
return FALSE;
}
@ -330,7 +330,7 @@ _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx,
_cogl_bitmap_gl_unbind (slice_bmp);
cogl_object_unref (slice_bmp);
g_object_unref (slice_bmp);
return status;
}
@ -382,7 +382,7 @@ _cogl_texture_driver_upload_to_gl (CoglContext *ctx,
* problems... */
if (internal_error)
{
cogl_object_unref (bmp);
g_object_unref (bmp);
g_propagate_error (error, internal_error);
return FALSE;
}
@ -403,7 +403,7 @@ _cogl_texture_driver_upload_to_gl (CoglContext *ctx,
_cogl_bitmap_gl_unbind (bmp);
cogl_object_unref (bmp);
g_object_unref (bmp);
return status;
}

View file

@ -865,7 +865,7 @@ copy_shared_framebuffer_cpu (CoglOnscreen *onscreen,
dumb_bitmap))
g_warning ("Failed to CPU-copy to a secondary GPU output");
cogl_object_unref (dumb_bitmap);
g_object_unref (dumb_bitmap);
secondary_gpu_state->cpu.current_dumb_fb = buffer_dumb;

View file

@ -1,6 +1,8 @@
#include <clutter/clutter.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
static GQuark pixbuf_key = 0;
static inline ClutterActor *
clutter_test_utils_create_texture_from_file (const char *filename,
GError **error)
@ -34,7 +36,7 @@ clutter_test_create_bitmap_from_file (CoglContext *ctx,
const char *filename,
GError **error)
{
static CoglUserDataKey pixbuf_key;
pixbuf_key = g_quark_from_static_string ("-cogl-bitmap-pixbuf-key");
GdkPixbuf *pixbuf;
gboolean has_alpha;
GdkColorspace color_space;
@ -101,10 +103,10 @@ clutter_test_create_bitmap_from_file (CoglContext *ctx,
rowstride,
gdk_pixbuf_get_pixels (pixbuf));
cogl_object_set_user_data (COGL_OBJECT (bmp),
&pixbuf_key,
pixbuf,
g_object_unref);
g_object_set_qdata_full (G_OBJECT (bmp),
pixbuf_key,
pixbuf,
g_object_unref);
return bmp;
}
@ -125,7 +127,7 @@ clutter_test_texture_2d_sliced_new_from_file (CoglContext *ctx,
tex_2ds = cogl_texture_2d_sliced_new_from_bitmap (bmp, COGL_TEXTURE_MAX_WASTE);
cogl_object_unref (bmp);
g_object_unref (bmp);
return tex_2ds;
}
@ -146,7 +148,7 @@ clutter_test_texture_2d_new_from_file (CoglContext *ctx,
tex_2d = cogl_texture_2d_new_from_bitmap (bmp);
cogl_object_unref (bmp);
g_object_unref (bmp);
return tex_2d;
}

View file

@ -342,7 +342,7 @@ test_utils_texture_new_from_data (CoglContext *ctx,
tex = test_utils_texture_new_from_bitmap (bmp, flags, TRUE);
cogl_object_unref (bmp);
g_object_unref (bmp);
return tex;
}

View file

@ -149,7 +149,7 @@ test_pixel_buffer_map (void)
-1.0f, 1.0f,
1.0f, -1.0f);
cogl_object_unref (bitmap);
g_object_unref (bitmap);
cogl_object_unref (texture);
cogl_object_unref (pipeline);
@ -194,7 +194,7 @@ test_pixel_buffer_set_data (void)
-1.0f, 1.0f,
1.0f, -1.0f);
cogl_object_unref (bitmap);
g_object_unref (bitmap);
cogl_object_unref (texture);
cogl_object_unref (pipeline);
@ -255,7 +255,7 @@ test_pixel_buffer_sub_region (void)
-1.0f, 1.0f,
1.0f, -1.0f);
cogl_object_unref (bitmap);
g_object_unref (bitmap);
cogl_object_unref (texture);
cogl_object_unref (pipeline);

View file

@ -49,7 +49,6 @@ make_texture (uint32_t color,
CoglPixelFormat src_format,
MakeTextureFlags flags)
{
static CoglUserDataKey bitmap_free_key;
CoglTexture2D *tex_2d;
guchar *tex_data = gen_tex_data (color);
CoglBitmap *bmp = cogl_bitmap_new_for_data (test_ctx,
@ -58,10 +57,6 @@ make_texture (uint32_t color,
src_format,
QUAD_WIDTH * 4,
tex_data);
cogl_object_set_user_data (COGL_OBJECT (bmp),
&bitmap_free_key,
tex_data,
g_free);
tex_2d = cogl_texture_2d_new_from_bitmap (bmp);
@ -70,7 +65,7 @@ make_texture (uint32_t color,
else if (flags & TEXTURE_FLAG_SET_UNPREMULTIPLIED)
cogl_texture_set_premultiplied (tex_2d, FALSE);
cogl_object_unref (bmp);
g_object_unref (bmp);
return tex_2d;
}

View file

@ -258,7 +258,7 @@ capture_view_into (ClutterStageView *view,
COGL_READ_PIXELS_COLOR_BUFFER,
bitmap);
cogl_object_unref (bitmap);
g_object_unref (bitmap);
}
typedef struct

View file

@ -403,7 +403,7 @@ shm_buffer_attach (MetaWaylandBuffer *buffer,
}
}
cogl_object_unref (bitmap);
g_object_unref (bitmap);
wl_shm_buffer_end_access (shm_buffer);