Add _cogl_texture_2d_externally_modified

_cogl_texture_2d_externally_modified is a function specific to the
CoglTexture2D texture backend that should be called whenever the
contents of the texture are modified without the backend knowing about
it. It simply marks the mipmap tree as invalid.
This commit is contained in:
Neil Roberts 2010-06-03 15:06:47 +01:00
parent 5a5b3914ba
commit f9f2f6bc6c
2 changed files with 20 additions and 0 deletions

View File

@ -67,4 +67,15 @@ _cogl_texture_2d_new_from_bitmap (CoglHandle bmp_handle,
CoglTextureFlags flags, CoglTextureFlags flags,
CoglPixelFormat internal_format); CoglPixelFormat internal_format);
/*
* _cogl_texture_2d_externally_modified:
* @handle: A handle to a 2D texture
*
* This should be called whenever the texture is modified other than
* by using cogl_texture_set_region. It will cause the mipmaps to be
* invalidated
*/
void
_cogl_texture_2d_externally_modified (CoglHandle handle);
#endif /* __COGL_TEXTURE_2D_H */ #endif /* __COGL_TEXTURE_2D_H */

View File

@ -320,6 +320,15 @@ _cogl_texture_2d_new_from_bitmap (CoglHandle bmp_handle,
return _cogl_texture_2d_handle_new (tex_2d); return _cogl_texture_2d_handle_new (tex_2d);
} }
void
_cogl_texture_2d_externally_modified (CoglHandle handle)
{
if (!cogl_is_texture_2d (handle))
return;
COGL_TEXTURE_2D (handle)->mipmaps_dirty = TRUE;
}
static int static int
_cogl_texture_2d_get_max_waste (CoglTexture *tex) _cogl_texture_2d_get_max_waste (CoglTexture *tex)
{ {