[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 d960ce46e5
commit f4a431a947

View File

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