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:
@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user