diff --git a/cogl/cogl-texture-2d-private.h b/cogl/cogl-texture-2d-private.h index fc9db8148..33c71efe0 100644 --- a/cogl/cogl-texture-2d-private.h +++ b/cogl/cogl-texture-2d-private.h @@ -67,4 +67,15 @@ _cogl_texture_2d_new_from_bitmap (CoglHandle bmp_handle, CoglTextureFlags flags, 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 */ diff --git a/cogl/cogl-texture-2d.c b/cogl/cogl-texture-2d.c index a7bcbf322..3c33a7557 100644 --- a/cogl/cogl-texture-2d.c +++ b/cogl/cogl-texture-2d.c @@ -320,6 +320,15 @@ _cogl_texture_2d_new_from_bitmap (CoglHandle bmp_handle, 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 _cogl_texture_2d_get_max_waste (CoglTexture *tex) {