bitmap: calc rowstride from width * bpp if 0
This updates cogl_bitmap_new_for_data() to calculate the rowstride from the width and bpp if the given rowstride is 0, to be consistent with how the texture apis work. Reviewed-by: Neil Roberts <neil@linux.intel.com> (cherry picked from commit 1c809210092a8c5e223edfcab1e378b205cf35d6)
This commit is contained in:
parent
1255d178e0
commit
7d2e23bd75
@ -178,6 +178,10 @@ cogl_bitmap_new_for_data (CoglContext *context,
|
||||
|
||||
g_return_val_if_fail (cogl_is_context (context), NULL);
|
||||
|
||||
/* Rowstride from width if not given */
|
||||
if (rowstride == 0)
|
||||
rowstride = width * _cogl_pixel_format_get_bytes_per_pixel (format);
|
||||
|
||||
bmp = g_slice_new (CoglBitmap);
|
||||
bmp->context = context;
|
||||
bmp->format = format;
|
||||
|
Loading…
Reference in New Issue
Block a user