| Flutter Impeller |

typographer_context_skia.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_SKIA_TYPOGRAPHER_CONTEXT_SKIA_H_
6 #define FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_TYPOGRAPHER_CONTEXT_SKIA_H_
7
8 #include "impeller/typographer/typographer_context.h"
9
10 namespace impeller {
11
12 class TypographerContextSkia : public TypographerContext {
13 public:
14 static std::shared_ptr<TypographerContext> Make();
15
16 TypographerContextSkia();
17
18 ~TypographerContextSkia() override;
19
20 // |TypographerContext|
21 std::shared_ptr<GlyphAtlasContext> CreateGlyphAtlasContext(
22 GlyphAtlas::Type type) const override;
23
24 // |TypographerContext|
25 std::shared_ptr<GlyphAtlas> CreateGlyphAtlas(
26 Context& context,
27 GlyphAtlas::Type type,
28 HostBuffer& host_buffer,
29 const std::shared_ptr<GlyphAtlasContext>& atlas_context,
30 const std::vector<std::shared_ptr<TextFrame>>& text_frames)
31 const override;
32
33 private:
34 static std::pair<std::vector<FontGlyphPair>, std::vector<Rect>>
35 CollectNewGlyphs(const std::shared_ptr<GlyphAtlas>& atlas,
36 const std::vector<std::shared_ptr<TextFrame>>& text_frames);
37
38 TypographerContextSkia(const TypographerContextSkia&) = delete;
39
40 TypographerContextSkia& operator=(const TypographerContextSkia&) = delete;
41 };
42
43 } // namespace impeller
44
45 #endif // FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_TYPOGRAPHER_CONTEXT_SKIA_H_
type
GLenum type
Definition: blit_command_gles.cc:153
impeller::Context
To do anything rendering related with Impeller, you need a context.
Definition: context.h:65
impeller::GlyphAtlas::Type
Type
Describes how the glyphs are represented in the texture.
Definition: glyph_atlas.h:41
impeller::HostBuffer
Definition: host_buffer.h:26
impeller::TypographerContext
The graphics context necessary to render text.
Definition: typographer_context.h:23
impeller::TypographerContextSkia
Definition: typographer_context_skia.h:12
impeller::TypographerContextSkia::TypographerContextSkia
TypographerContextSkia()
impeller::TypographerContextSkia::~TypographerContextSkia
~TypographerContextSkia() override
impeller::TypographerContextSkia::CreateGlyphAtlasContext
std::shared_ptr< GlyphAtlasContext > CreateGlyphAtlasContext(GlyphAtlas::Type type) const override
Definition: typographer_context_skia.cc:85
impeller::TypographerContextSkia::Make
static std::shared_ptr< TypographerContext > Make()
Definition: typographer_context_skia.cc:76
impeller::TypographerContextSkia::CreateGlyphAtlas
std::shared_ptr< GlyphAtlas > CreateGlyphAtlas(Context &context, GlyphAtlas::Type type, HostBuffer &host_buffer, const std::shared_ptr< GlyphAtlasContext > &atlas_context, const std::vector< std::shared_ptr< TextFrame >> &text_frames) const override
Definition: typographer_context_skia.cc:503
impeller
Definition: allocation.cc:12
typographer_context.h