Flutter Engine
The Flutter Engine
impeller
typographer
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 "
impeller/renderer/context.h
"
9
#include "
impeller/typographer/glyph_atlas.h
"
10
#include "
impeller/typographer/text_frame.h
"
11
#include "
impeller/typographer/typographer_context.h
"
12
13
namespace
impeller
{
14
15
class
LazyGlyphAtlas
{
16
public
:
17
explicit
LazyGlyphAtlas
(
18
std::shared_ptr<TypographerContext> typographer_context);
19
20
~LazyGlyphAtlas
();
21
22
void
AddTextFrame
(
const
TextFrame
&
frame
,
23
Scalar
scale
,
24
Point
offset
,
25
const
GlyphProperties
& properties);
26
27
void
ResetTextFrames
();
28
29
const
std::shared_ptr<GlyphAtlas>&
CreateOrGetGlyphAtlas
(
30
Context
& context,
31
HostBuffer
& host_buffer,
32
GlyphAtlas::Type
type
)
const
;
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_
type
GLenum type
Definition:
blit_command_gles.cc:126
impeller::Context
To do anything rendering related with Impeller, you need a context.
Definition:
context.h:45
impeller::GlyphAtlas::Type
Type
Describes how the glyphs are represented in the texture.
Definition:
glyph_atlas.h:31
impeller::HostBuffer
Definition:
host_buffer.h:28
impeller::LazyGlyphAtlas
Definition:
lazy_glyph_atlas.h:15
impeller::LazyGlyphAtlas::CreateOrGetGlyphAtlas
const std::shared_ptr< GlyphAtlas > & CreateOrGetGlyphAtlas(Context &context, HostBuffer &host_buffer, GlyphAtlas::Type type) const
Definition:
lazy_glyph_atlas.cc:54
impeller::LazyGlyphAtlas::~LazyGlyphAtlas
~LazyGlyphAtlas()
impeller::LazyGlyphAtlas::ResetTextFrames
void ResetTextFrames()
Definition:
lazy_glyph_atlas.cc:47
impeller::LazyGlyphAtlas::AddTextFrame
void AddTextFrame(const TextFrame &frame, Scalar scale, Point offset, const GlyphProperties &properties)
Definition:
lazy_glyph_atlas.cc:33
impeller::LazyGlyphAtlas::LazyGlyphAtlas
LazyGlyphAtlas(std::shared_ptr< TypographerContext > typographer_context)
Definition:
lazy_glyph_atlas.cc:19
impeller::TextFrame
Represents a collection of shaped text runs.
Definition:
text_frame.h:19
frame
double frame
Definition:
examples.cpp:31
glyph_atlas.h
context.h
impeller
Definition:
texture.h:18
impeller::Scalar
float Scalar
Definition:
scalar.h:18
impeller::FontGlyphMap
std::unordered_map< ScaledFont, std::unordered_set< SubpixelGlyph > > FontGlyphMap
Definition:
font_glyph_pair.h:54
scale
const Scalar scale
Definition:
stroke_path_geometry.cc:308
offset
SeparatedVector2 offset
Definition:
stroke_path_geometry.cc:311
impeller::GlyphProperties
Definition:
font_glyph_pair.h:19
impeller::TPoint< Scalar >
text_frame.h
typographer_context.h
Generated on Sun Jun 23 2024 21:55:05 for Flutter Engine by
1.9.4