Make the font atlas use a color image #7298
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Splitting this out from the Parley work as requested. This removes
FontImage
and makes the font atlas use aColorImage
. It converts alpha to coverage at glyph-drawing time, not at delta-upload time.This doesn't do much now, but will allow for color emoji rendering once we start using Parley.
I've changed things around so that we pass in
text_alpha_to_coverage
to theFonts
the same way we do withpixels_per_point
andmax_texture_side
, reusing the existing code to check if the setting differs and recreating the font atlas if so. I'm not quite sure why this wasn't done in the first place.I've left
ImageData
as an enum for now, in case we want to add support for more texture pixel formats in the future (which I personally think would be worthwhile). If you'd like, I can just remove that enum entirely.