Page MenuHomePhabricator

Bug 1595768 - Keep empty items in the texture cache.
ClosedPublic

Authored by nical on Dec 12 2019, 4:37 PM.

Details

Summary

Adds a notion of empty cache items in the texture cache, that are not uploaded into textures but have a cache entry and expire like other types of entries. The motivation for this is to avoid continuously requesting invalid glyphs to be re-rasterized. Currently if a page contains invalid glyphs we gracefully fail to reasterize it but since we don't keep a trace of it in the cache it appears new each frame which cause us to schedule work on the rayon thread pool every frame at great costs.

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

nical created this revision.Dec 12 2019, 4:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 12 2019, 4:37 PM
phab-bot requested review of this revision.Dec 12 2019, 4:37 PM
phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: Restricted Project.
nical updated this revision to Diff 206914.Dec 12 2019, 5:44 PM

Revision updated.

nical edited the summary of this revision. (Show Details)Dec 12 2019, 5:44 PM
nical added a reviewer: gw.Dec 12 2019, 5:45 PM
gw accepted this revision.Dec 13 2019, 4:55 AM

It seems a little odd to have the concept in the texture cache. It feels like maybe this should be handled at the font level?

This revision is now accepted and ready to land.Dec 13 2019, 4:55 AM
nical added a comment.Dec 13 2019, 9:18 AM

It's a bit odd because the texture cache deals with both storage and eviction of the items and we only need the latter here, but duplicating the code that manages eviction just for empty items turned out worse, so in my opinion this is better. We could split the texture cache into the two things to make things a little cleaner.