Flutter Engine
The Flutter Engine
typographer_context.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_TYPOGRAPHER_CONTEXT_H_
6#define FLUTTER_IMPELLER_TYPOGRAPHER_TYPOGRAPHER_CONTEXT_H_
7
8#include <memory>
9
12
13namespace impeller {
14
15//------------------------------------------------------------------------------
16/// @brief The graphics context necessary to render text.
17///
18/// This is necessary to create and reference resources related to
19/// rendering text on the GPU.
20///
21///
23 public:
25
26 virtual bool IsValid() const;
27
28 virtual std::shared_ptr<GlyphAtlasContext> CreateGlyphAtlasContext(
29 GlyphAtlas::Type type) const = 0;
30
31 virtual std::shared_ptr<GlyphAtlas> CreateGlyphAtlas(
32 Context& context,
34 HostBuffer& host_buffer,
35 const std::shared_ptr<GlyphAtlasContext>& atlas_context,
36 const FontGlyphMap& font_glyph_map) const = 0;
37
38 protected:
39 //----------------------------------------------------------------------------
40 /// @brief Create a new context to render text that talks to an
41 /// underlying graphics context.
42 ///
44
45 private:
46 bool is_valid_ = false;
47
49
50 TypographerContext& operator=(const TypographerContext&) = delete;
51};
52
53} // namespace impeller
54
55#endif // FLUTTER_IMPELLER_TYPOGRAPHER_TYPOGRAPHER_CONTEXT_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
The graphics context necessary to render text.
TypographerContext()
Create a new context to render text that talks to an underlying graphics context.
virtual std::shared_ptr< GlyphAtlasContext > CreateGlyphAtlasContext(GlyphAtlas::Type type) const =0
virtual 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 =0
std::unordered_map< ScaledFont, std::unordered_set< SubpixelGlyph > > FontGlyphMap