Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
impeller
typographer
backends
stb
glyph_atlas_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_GLYPH_ATLAS_CONTEXT_STB_H_
6
#define FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_STB_GLYPH_ATLAS_CONTEXT_STB_H_
7
8
#include "
impeller/base/backend_cast.h
"
9
#include "
impeller/typographer/glyph_atlas.h
"
10
11
namespace
impeller
{
12
13
class
BitmapSTB
{
14
public
:
15
BitmapSTB
();
16
17
~BitmapSTB
();
18
19
BitmapSTB
(
size_t
width
,
size_t
height
,
size_t
bytes_per_pixel
);
20
21
uint8_t*
GetPixels
();
22
23
uint8_t*
GetPixelAddress
(
TPoint<size_t>
coords);
24
25
size_t
GetRowBytes
()
const
;
26
27
size_t
GetWidth
()
const
;
28
29
size_t
GetHeight
()
const
;
30
31
size_t
GetSize
()
const
;
32
33
private
:
34
size_t
width_ = 0;
35
size_t
height_ = 0;
36
size_t
bytes_per_pixel_ = 0;
37
std::vector<uint8_t> pixels_;
38
};
39
40
class
GlyphAtlasContextSTB
41
:
public
GlyphAtlasContext
,
42
public
BackendCast
<GlyphAtlasContextSTB, GlyphAtlasContext> {
43
public
:
44
GlyphAtlasContextSTB
();
45
46
~GlyphAtlasContextSTB
()
override
;
47
48
//----------------------------------------------------------------------------
49
/// @brief Retrieve the previous (if any) BitmapSTB instance.
50
std::shared_ptr<BitmapSTB>
GetBitmap
()
const
;
51
52
void
UpdateBitmap
(std::shared_ptr<BitmapSTB>
bitmap
);
53
54
private
:
55
std::shared_ptr<BitmapSTB> bitmap_;
56
57
GlyphAtlasContextSTB
(
const
GlyphAtlasContextSTB
&) =
delete
;
58
59
GlyphAtlasContextSTB
& operator=(
const
GlyphAtlasContextSTB
&) =
delete
;
60
};
61
62
}
// namespace impeller
63
64
#endif
// FLUTTER_IMPELLER_TYPOGRAPHER_BACKENDS_STB_GLYPH_ATLAS_CONTEXT_STB_H_
backend_cast.h
impeller::BackendCast
Definition
backend_cast.h:11
impeller::BitmapSTB
Definition
glyph_atlas_context_stb.h:13
impeller::BitmapSTB::GetPixelAddress
uint8_t * GetPixelAddress(TPoint< size_t > coords)
Definition
glyph_atlas_context_stb.cc:23
impeller::BitmapSTB::GetPixels
uint8_t * GetPixels()
Definition
glyph_atlas_context_stb.cc:19
impeller::BitmapSTB::BitmapSTB
BitmapSTB()
impeller::BitmapSTB::GetWidth
size_t GetWidth() const
Definition
glyph_atlas_context_stb.cc:34
impeller::BitmapSTB::~BitmapSTB
~BitmapSTB()
impeller::BitmapSTB::GetSize
size_t GetSize() const
Definition
glyph_atlas_context_stb.cc:42
impeller::BitmapSTB::GetHeight
size_t GetHeight() const
Definition
glyph_atlas_context_stb.cc:38
impeller::BitmapSTB::GetRowBytes
size_t GetRowBytes() const
Definition
glyph_atlas_context_stb.cc:30
impeller::GlyphAtlasContextSTB
Definition
glyph_atlas_context_stb.h:42
impeller::GlyphAtlasContextSTB::GlyphAtlasContextSTB
GlyphAtlasContextSTB()
impeller::GlyphAtlasContextSTB::UpdateBitmap
void UpdateBitmap(std::shared_ptr< BitmapSTB > bitmap)
Definition
glyph_atlas_context_stb.cc:54
impeller::GlyphAtlasContextSTB::GetBitmap
std::shared_ptr< BitmapSTB > GetBitmap() const
Retrieve the previous (if any) BitmapSTB instance.
Definition
glyph_atlas_context_stb.cc:50
impeller::GlyphAtlasContextSTB::~GlyphAtlasContextSTB
~GlyphAtlasContextSTB() override
impeller::GlyphAtlasContext
A container for caching a glyph atlas across frames.
Definition
glyph_atlas.h:146
glyph_atlas.h
bitmap
Definition
bitmap.py:1
impeller
Definition
texture.h:18
height
int32_t height
Definition
serialization_callbacks.cc:1
width
int32_t width
Definition
serialization_callbacks.cc:0
bytes_per_pixel
static size_t bytes_per_pixel(skcms_PixelFormat fmt)
Definition
skcms.cc:2449
impeller::TPoint
Definition
point.h:27
Generated on Fri Apr 26 2024 06:14:15 for Flutter Engine by
1.9.8