1
0
Fork 0

[cogl-texture] Don't take ownership of the data in cogl_texture_new_from_bitmap

When creating a Cogl texture from a Cogl bitmap it would steal the
data by setting the bitmap_owner flag and clearing the data pointer
from the bitmap. The data would be freed by the time the
new_from_bitmap is finished. There is no reason to do this because the
data will be freed when the Cogl bitmap is unref'd and it is confusing
not to be able to reuse the bitmap for creating multiple textures.
This commit is contained in:
Neil Roberts 2009-06-02 18:01:18 +01:00
parent c73d340448
commit b184bd04e8

View file

@ -1345,8 +1345,7 @@ cogl_texture_new_from_bitmap (CoglHandle bmp_handle,
tex->auto_mipmap = ((flags & COGL_TEXTURE_AUTO_MIPMAP) != 0);
tex->bitmap = *bmp;
tex->bitmap_owner = TRUE;
bmp->data = NULL;
tex->bitmap_owner = FALSE;
tex->slice_x_spans = NULL;
tex->slice_y_spans = NULL;