| Flutter Impeller |

typographer_context_stb.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_BACKENDS_STB_TYPOGRAPHER_CONTEXT_STB_H_
6 #define FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_STB_TYPOGRAPHER_CONTEXT_STB_H_
7
8 #include "impeller/typographer/glyph_atlas.h"
9 #include "impeller/typographer/typographer_context.h"
10
11 #include <memory>
12
13 namespace impeller {
14
15 class TypographerContextSTB : public TypographerContext {
16 public:
17 static std::unique_ptr<TypographerContext> Make();
18
19 TypographerContextSTB();
20
21 ~TypographerContextSTB() override;
22
23 // |TypographerContext|
24 std::shared_ptr<GlyphAtlasContext> CreateGlyphAtlasContext(
25 GlyphAtlas::Type type) const override;
26
27 // |TypographerContext|
28 std::shared_ptr<GlyphAtlas> CreateGlyphAtlas(
29 Context& context,
30 GlyphAtlas::Type type,
31 HostBuffer& host_buffer,
32 const std::shared_ptr<GlyphAtlasContext>& atlas_context,
33 const FontGlyphMap& font_glyph_map) const override;
34
35 private:
36 TypographerContextSTB(const TypographerContextSTB&) = delete;
37
38 TypographerContextSTB& operator=(const TypographerContextSTB&) = delete;
39 };
40
41 } // namespace impeller
42
43 #endif // FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_STB_TYPOGRAPHER_CONTEXT_STB_H_
impeller::TypographerContextSTB::CreateGlyphAtlasContext
std::shared_ptr< GlyphAtlasContext > CreateGlyphAtlasContext(GlyphAtlas::Type type) const override
Definition: typographer_context_stb.cc:41
impeller::TypographerContext
The graphics context necessary to render text.
Definition: typographer_context.h:22
impeller::FontGlyphMap
std::unordered_map< ScaledFont, std::unordered_set< SubpixelGlyph, SubpixelGlyph::Hash, SubpixelGlyph::Equal >, ScaledFont::Hash, ScaledFont::Equal > FontGlyphMap
Definition: font_glyph_pair.h:108
impeller::TypographerContextSTB::TypographerContextSTB
TypographerContextSTB()
Definition: typographer_context_stb.cc:36
impeller::HostBuffer
Definition: host_buffer.h:28
typographer_context.h
impeller::TypographerContextSTB::CreateGlyphAtlas
std::shared_ptr< GlyphAtlas > CreateGlyphAtlas(Context &context, GlyphAtlas::Type type, HostBuffer &host_buffer, const std::shared_ptr< GlyphAtlasContext > &atlas_context, const FontGlyphMap &font_glyph_map) const override
Definition: typographer_context_stb.cc:399
impeller::TypographerContextSTB::~TypographerContextSTB
~TypographerContextSTB() override
impeller::GlyphAtlas::Type
Type
Describes how the glyphs are represented in the texture.
Definition: glyph_atlas.h:31
impeller::TypographerContextSTB::Make
static std::unique_ptr< TypographerContext > Make()
Definition: typographer_context_stb.cc:32
type
GLenum type
Definition: blit_command_gles.cc:127
impeller::TypographerContextSTB
Definition: typographer_context_stb.h:15
impeller::Context
To do anything rendering related with Impeller, you need a context.
Definition: context.h:46
glyph_atlas.h
impeller
Definition: allocation.cc:12