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 
9 #include "third_party/skia/include/core/SkImageInfo.h"
10 
11 namespace impeller {
12 
14  public:
15  static std::shared_ptr<TypographerContext> Make();
16 
18 
20 
21  // |TypographerContext|
22  std::shared_ptr<GlyphAtlasContext> CreateGlyphAtlasContext(
23  GlyphAtlas::Type type) const override;
24 
25  // |TypographerContext|
26  std::shared_ptr<GlyphAtlas> CreateGlyphAtlas(
28  GlyphAtlas::Type type,
29  HostBuffer& host_buffer,
30  const std::shared_ptr<GlyphAtlasContext>& atlas_context,
31  const std::vector<RenderableText>& renderable_texts) const override;
32 
33  // Visible for testing.
34  static SkImageInfo GetImageInfo(const GlyphAtlas& atlas,
35  Size size,
36  bool support_light_glyphs);
37 
38  private:
39  static std::pair<std::vector<FontGlyphPair>, std::vector<Rect>>
40  CollectNewGlyphs(const std::shared_ptr<GlyphAtlas>& atlas,
41  const std::vector<RenderableText>& renderable_texts);
42 
44 
45  TypographerContextSkia& operator=(const TypographerContextSkia&) = delete;
46 };
47 
48 } // namespace impeller
49 
50 #endif // FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_SKIA_TYPOGRAPHER_CONTEXT_SKIA_H_
To do anything rendering related with Impeller, you need a context.
Definition: context.h:69
A texture containing the bitmap representation of glyphs in different fonts along with the ability to...
Definition: glyph_atlas.h:37
Type
Describes how the glyphs are represented in the texture.
Definition: glyph_atlas.h:41
The graphics context necessary to render text.
std::shared_ptr< GlyphAtlas > CreateGlyphAtlas(Context &context, GlyphAtlas::Type type, HostBuffer &host_buffer, const std::shared_ptr< GlyphAtlasContext > &atlas_context, const std::vector< RenderableText > &renderable_texts) const override
static SkImageInfo GetImageInfo(const GlyphAtlas &atlas, Size size, bool support_light_glyphs)
std::shared_ptr< GlyphAtlasContext > CreateGlyphAtlasContext(GlyphAtlas::Type type) const override
static std::shared_ptr< TypographerContext > Make()
std::shared_ptr< ContextGLES > context