Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
8#include <unordered_map>
9
10#include "flutter/fml/macros.h"
15
16namespace impeller {
17
19 public:
20 explicit LazyGlyphAtlas(
21 std::shared_ptr<TypographerContext> typographer_context);
22
24
26
27 void ResetTextFrames();
28
29 const std::shared_ptr<GlyphAtlas>& CreateOrGetGlyphAtlas(
30 Context& context,
32
33 private:
34 std::shared_ptr<TypographerContext> typographer_context_;
35
36 FontGlyphMap alpha_glyph_map_;
37 FontGlyphMap color_glyph_map_;
38 std::shared_ptr<GlyphAtlasContext> alpha_context_;
39 std::shared_ptr<GlyphAtlasContext> color_context_;
40 mutable std::shared_ptr<GlyphAtlas> alpha_atlas_;
41 mutable std::shared_ptr<GlyphAtlas> color_atlas_;
42
43 LazyGlyphAtlas(const LazyGlyphAtlas&) = delete;
44
45 LazyGlyphAtlas& operator=(const LazyGlyphAtlas&) = delete;
46};
47
48} // namespace impeller
49
50#endif // FLUTTER_IMPELLER_TYPOGRAPHER_LAZY_GLYPH_ATLAS_H_
To do anything rendering related with Impeller, you need a context.
Definition context.h:46
Type
Describes how the glyphs are represented in the texture.
Definition glyph_atlas.h:32
void AddTextFrame(const TextFrame &frame, Scalar scale)
const std::shared_ptr< GlyphAtlas > & CreateOrGetGlyphAtlas(Context &context, GlyphAtlas::Type type) const
Represents a collection of shaped text runs.
Definition text_frame.h:20
double frame
Definition examples.cpp:31
float Scalar
Definition scalar.h:18
std::unordered_map< ScaledFont, std::unordered_set< Glyph > > FontGlyphMap
const Scalar scale