gl: Interleave cache aging
authorMatthias Clasen <mclasen@redhat.com>
Sat, 12 Oct 2019 16:33:43 +0000 (12:33 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 12 Oct 2019 16:37:11 +0000 (12:37 -0400)
Every few frames, we do extra work for the
cache aging. Arrange for the glyph and icon
caches to not cause extra work on the same
frame, to smooth things out.

gsk/gl/gskglglyphcache.c

index ee34e611c0aab2c3a940877673448009183e0730..33ef45279e7f788282e8d1a4a00cfaf84f17ee3d 100644 (file)
@@ -341,7 +341,7 @@ gsk_gl_glyph_cache_begin_frame (GskGLGlyphCache *self,
       GSK_NOTE(GLYPH_CACHE, if (dropped > 0) g_message ("Dropped %d glyphs", dropped));
     }
 
-  if (self->timestamp % MAX_FRAME_AGE == 0)
+  if (self->timestamp % MAX_FRAME_AGE == 30)
     {
       g_hash_table_iter_init (&iter, self->hash_table);
       while (g_hash_table_iter_next (&iter, (gpointer *)&key, (gpointer *)&value))