Flutter Engine
The Flutter Engine
lazy_glyph_atlas.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_IMPELLER_TYPOGRAPHER_LAZY_GLYPH_ATLAS_H_
6#define FLUTTER_IMPELLER_TYPOGRAPHER_LAZY_GLYPH_ATLAS_H_
7
12
13namespace impeller {
14
16 public:
17 explicit LazyGlyphAtlas(
18 std::shared_ptr<TypographerContext> typographer_context);
19
21
22 void AddTextFrame(const TextFrame& frame,
25 const GlyphProperties& properties);
26
27 void ResetTextFrames();
28
29 const std::shared_ptr<GlyphAtlas>& CreateOrGetGlyphAtlas(
30 Context& context,
31 HostBuffer& host_buffer,
33
34 private:
35 std::shared_ptr<TypographerContext> typographer_context_;
36
37 FontGlyphMap alpha_glyph_map_;
38 FontGlyphMap color_glyph_map_;
39 std::shared_ptr<GlyphAtlasContext> alpha_context_;
40 std::shared_ptr<GlyphAtlasContext> color_context_;
41 mutable std::shared_ptr<GlyphAtlas> alpha_atlas_;
42 mutable std::shared_ptr<GlyphAtlas> color_atlas_;
43
44 LazyGlyphAtlas(const LazyGlyphAtlas&) = delete;
45
46 LazyGlyphAtlas& operator=(const LazyGlyphAtlas&) = delete;
47};
48
49} // namespace impeller
50
51#endif // FLUTTER_IMPELLER_TYPOGRAPHER_LAZY_GLYPH_ATLAS_H_
GLenum type
To do anything rendering related with Impeller, you need a context.
Definition: context.h:45
Type
Describes how the glyphs are represented in the texture.
Definition: glyph_atlas.h:31
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.
Definition: text_frame.h:19
double frame
Definition: examples.cpp:31
float Scalar
Definition: scalar.h:18
std::unordered_map< ScaledFont, std::unordered_set< SubpixelGlyph > > FontGlyphMap
const Scalar scale
SeparatedVector2 offset