-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] cache even more text frame data to skip lookups. #56798
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,8 +58,9 @@ class GlyphAtlas { | |
| /// @brief Create an empty glyph atlas. | ||
| /// | ||
| /// @param[in] type How the glyphs are represented in the texture. | ||
| /// @param[in] initial_generation the atlas generation. | ||
| /// | ||
| explicit GlyphAtlas(Type type); | ||
| GlyphAtlas(Type type, size_t initial_generation); | ||
|
|
||
| ~GlyphAtlas(); | ||
|
|
||
|
|
@@ -142,9 +143,22 @@ class GlyphAtlas { | |
| /// | ||
| FontGlyphAtlas* GetOrCreateFontGlyphAtlas(const ScaledFont& scaled_font); | ||
|
|
||
| //---------------------------------------------------------------------------- | ||
| /// @brief Retrieve the generation id for this glyph atlas. | ||
| /// | ||
| /// The generation id is used to match with a TextFrame to | ||
| /// determine if the frame is guaranteed to already be populated | ||
| /// in the atlas. | ||
| size_t GetAtlasGeneration() const; | ||
|
|
||
| //---------------------------------------------------------------------------- | ||
| /// @brief Update the atlas generation. | ||
| void SetAtlasGeneration(size_t value); | ||
|
|
||
| private: | ||
| const Type type_; | ||
| std::shared_ptr<Texture> texture_; | ||
| size_t generation_ = 0; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think we should use std::optional here to signify atlases that have not had their generations set? Or maybe put the generation in the constructor?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. an atlas always have a generation though.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It does, but an atlas that has been created but hasn't had
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
|
||
| std::unordered_map<ScaledFont, | ||
| FontGlyphAtlas, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.