cogl-bitmap: Add a public accessor for the underlying pixel buffer

This adds a small cogl_bitmap_get_buffer public function. Note that
this can return NULL if the bitmap was not created with a pixel
buffer. It might be nice to change this eventually so that all bitmaps
have a pixel buffer.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
This commit is contained in:
Neil Roberts
2012-02-25 20:28:50 +00:00
parent 7114588884
commit 76c2bd8420
2 changed files with 24 additions and 0 deletions

View File

@ -330,6 +330,15 @@ cogl_bitmap_get_rowstride (CoglBitmap *bitmap)
return bitmap->rowstride;
}
CoglPixelBuffer *
cogl_bitmap_get_buffer (CoglBitmap *bitmap)
{
while (bitmap->shared_bmp)
bitmap = bitmap->shared_bmp;
return COGL_PIXEL_BUFFER (bitmap->buffer);
}
GQuark
cogl_bitmap_error_quark (void)
{