20 std::shared_ptr<TypographerContext> typographer_context)
21 : typographer_context_(
std::move(typographer_context)),
22 alpha_context_(typographer_context_
23 ? typographer_context_->CreateGlyphAtlasContext(
26 color_context_(typographer_context_
27 ? typographer_context_->CreateGlyphAtlasContext(
37 FML_DCHECK(alpha_atlas_ ==
nullptr && color_atlas_ ==
nullptr);
48 alpha_glyph_map_.clear();
49 color_glyph_map_.clear();
67 if (!typographer_context_) {
68 VALIDATION_LOG <<
"Unable to render text because a TypographerContext has "
72 if (!typographer_context_->IsValid()) {
74 <<
"Unable to render text because the TypographerContext is invalid.";
80 const std::shared_ptr<GlyphAtlasContext>& atlas_context =
82 std::shared_ptr<GlyphAtlas>
atlas = typographer_context_->CreateGlyphAtlas(
83 context,
type, host_buffer, atlas_context, glyph_map);
89 alpha_atlas_ = std::move(
atlas);
93 color_atlas_ = std::move(
atlas);
To do anything rendering related with Impeller, you need a context.
A texture containing the bitmap representation of glyphs in different fonts along with the ability to...
Type
Describes how the glyphs are represented in the texture.
const std::shared_ptr< GlyphAtlas > & CreateOrGetGlyphAtlas(Context &context, HostBuffer &host_buffer, GlyphAtlas::Type type) const
void AddTextFrame(const TextFrame &frame, Scalar scale, Point offset, const GlyphProperties &properties)
LazyGlyphAtlas(std::shared_ptr< TypographerContext > typographer_context)
Represents a collection of shaped text runs.
#define FML_UNREACHABLE()
#define FML_DCHECK(condition)
sk_sp< const SkImage > atlas
static const std::shared_ptr< GlyphAtlas > kNullGlyphAtlas