}
static void
-gsk_gl_glyph_library_begin_frame (GskGLTextureLibrary *library,
- gint64 frame_id,
- GPtrArray *removed_atlases)
+gsk_gl_glyph_library_clear_cache (GskGLTextureLibrary *library)
{
GskGLGlyphLibrary *self = (GskGLGlyphLibrary *)library;
+ g_assert (GSK_IS_GL_GLYPH_LIBRARY (self));
+
memset (self->front, 0, sizeof self->front);
}
object_class->finalize = gsk_gl_glyph_library_finalize;
- library_class->begin_frame = gsk_gl_glyph_library_begin_frame;
+ library_class->clear_cache = gsk_gl_glyph_library_clear_cache;
}
static void
GPtrArray *removed_atlases)
{
GHashTableIter iter;
+ gboolean drop_caches = FALSE;
g_return_if_fail (GSK_IS_GL_TEXTURE_LIBRARY (self));
if (dropped > 0)
g_message ("%s: Dropped %d items",
G_OBJECT_TYPE_NAME (self), dropped));
+
+ drop_caches |= dropped > 0;
}
if (frame_id % self->max_frame_age == 0)
g_hash_table_size (self->hash_table),
atlased,
g_hash_table_size (self->hash_table) - atlased));
+
+ drop_caches |= dropped > 0;
}
+
+ if (drop_caches && GSK_GL_TEXTURE_LIBRARY_GET_CLASS (self)->clear_cache)
+ GSK_GL_TEXTURE_LIBRARY_GET_CLASS (self)->clear_cache (self);
}
static GskGLTexture *
void (*begin_frame) (GskGLTextureLibrary *library,
gint64 frame_id,
GPtrArray *removed_atlases);
+ void (*clear_cache) (GskGLTextureLibrary *library);
} GskGLTextureLibraryClass;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GskGLTextureLibrary, g_object_unref)