#include <lazy_glyph_atlas.h>
Definition at line 18 of file lazy_glyph_atlas.h.
◆ LazyGlyphAtlas()
impeller::LazyGlyphAtlas::LazyGlyphAtlas |
( |
std::shared_ptr< TypographerContext > |
typographer_context | ) |
|
|
explicit |
Definition at line 19 of file lazy_glyph_atlas.cc.
21 : typographer_context_(std::move(typographer_context)),
22 alpha_context_(typographer_context_
23 ? typographer_context_->CreateGlyphAtlasContext()
24 : nullptr),
25 color_context_(typographer_context_
26 ? typographer_context_->CreateGlyphAtlasContext()
27 : nullptr) {}
◆ ~LazyGlyphAtlas()
impeller::LazyGlyphAtlas::~LazyGlyphAtlas |
( |
| ) |
|
|
default |
◆ AddTextFrame()
void impeller::LazyGlyphAtlas::AddTextFrame |
( |
const TextFrame & |
frame, |
|
|
Scalar |
scale |
|
) |
| |
Definition at line 31 of file lazy_glyph_atlas.cc.
31 {
32 FML_DCHECK(alpha_atlas_ ==
nullptr && color_atlas_ ==
nullptr);
34 frame.CollectUniqueFontGlyphPairs(alpha_glyph_map_,
scale);
35 } else {
36 frame.CollectUniqueFontGlyphPairs(color_glyph_map_,
scale);
37 }
38}
#define FML_DCHECK(condition)
◆ CreateOrGetGlyphAtlas()
Definition at line 47 of file lazy_glyph_atlas.cc.
49 {
50 {
52 return alpha_atlas_;
53 }
55 return color_atlas_;
56 }
57 }
58
59 if (!typographer_context_) {
60 VALIDATION_LOG <<
"Unable to render text because a TypographerContext has "
61 "not been set.";
63 }
64 if (!typographer_context_->IsValid()) {
66 << "Unable to render text because the TypographerContext is invalid.";
68 }
69
71 : color_glyph_map_;
72 const std::shared_ptr<GlyphAtlasContext>& atlas_context =
74 std::shared_ptr<GlyphAtlas>
atlas = typographer_context_->CreateGlyphAtlas(
75 context,
type, atlas_context, glyph_map);
76 if (!atlas || !
atlas->IsValid()) {
79 }
81 alpha_atlas_ = std::move(atlas);
82 return alpha_atlas_;
83 }
85 color_atlas_ = std::move(atlas);
86 return color_atlas_;
87 }
89}
#define FML_UNREACHABLE()
sk_sp< const SkImage > atlas
static const std::shared_ptr< GlyphAtlas > kNullGlyphAtlas
◆ ResetTextFrames()
void impeller::LazyGlyphAtlas::ResetTextFrames |
( |
| ) |
|
Definition at line 40 of file lazy_glyph_atlas.cc.
40 {
41 alpha_glyph_map_.clear();
42 color_glyph_map_.clear();
43 alpha_atlas_.reset();
44 color_atlas_.reset();
45}
The documentation for this class was generated from the following files: