Flutter Engine
The Flutter Engine
third_party
skia
src
text
gpu
Glyph.h
Go to the documentation of this file.
1
/*
2
* Copyright 2010 Google Inc.
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#ifndef sktext_gpu_Glyph_DEFINED
9
#define sktext_gpu_Glyph_DEFINED
10
11
#include "
src/core/SkGlyph.h
"
12
#include "
src/core/SkMask.h
"
13
#include "
src/gpu/AtlasTypes.h
"
14
15
namespace
sktext::gpu
{
16
17
class
Glyph
{
18
public
:
19
static
skgpu::MaskFormat
FormatFromSkGlyph
(
SkMask::Format
format
) {
20
switch
(
format
) {
21
case
SkMask::kBW_Format
:
22
case
SkMask::kSDF_Format
:
23
// fall through to kA8 -- we store BW and SDF glyphs in our 8-bit cache
24
case
SkMask::kA8_Format
:
25
return
skgpu::MaskFormat::kA8
;
26
case
SkMask::k3D_Format
:
27
return
skgpu::MaskFormat::kA8
;
// ignore the mul and add planes, just use the mask
28
case
SkMask::kLCD16_Format
:
29
return
skgpu::MaskFormat::kA565
;
30
case
SkMask::kARGB32_Format
:
31
return
skgpu::MaskFormat::kARGB
;
32
}
33
34
SkUNREACHABLE
;
35
}
36
37
Glyph
(
SkPackedGlyphID
packedGlyphID) :
fPackedID
(packedGlyphID) {}
38
39
const
SkPackedGlyphID
fPackedID
;
40
skgpu::AtlasLocator
fAtlasLocator
;
41
};
42
43
}
// namespace sktext::gpu
44
45
#endif
// sktext_gpu_Glyph_DEFINED
AtlasTypes.h
SkUNREACHABLE
#define SkUNREACHABLE
Definition:
SkAssert.h:135
SkGlyph.h
SkMask.h
skgpu::AtlasLocator
Definition:
AtlasTypes.h:292
sktext::gpu::Glyph
Definition:
Glyph.h:17
sktext::gpu::Glyph::fAtlasLocator
skgpu::AtlasLocator fAtlasLocator
Definition:
Glyph.h:40
sktext::gpu::Glyph::FormatFromSkGlyph
static skgpu::MaskFormat FormatFromSkGlyph(SkMask::Format format)
Definition:
Glyph.h:19
sktext::gpu::Glyph::Glyph
Glyph(SkPackedGlyphID packedGlyphID)
Definition:
Glyph.h:37
sktext::gpu::Glyph::fPackedID
const SkPackedGlyphID fPackedID
Definition:
Glyph.h:39
format
uint32_t uint32_t * format
Definition:
fl_texture_registrar_test.cc:41
skgpu::MaskFormat
MaskFormat
Definition:
AtlasTypes.h:98
skgpu::MaskFormat::kA565
@ kA565
2-bytes per pixel, RGB represent 3-channel LCD coverage
skgpu::MaskFormat::kA8
@ kA8
1-byte per pixel
skgpu::MaskFormat::kARGB
@ kARGB
4-bytes per pixel, color format
sktext::gpu
Definition:
SkCanvas.h:81
SkMask::Format
Format
Definition:
SkMask.h:26
SkMask::k3D_Format
@ k3D_Format
3 8bit per pixl planes: alpha, mul, add
Definition:
SkMask.h:29
SkMask::kA8_Format
@ kA8_Format
8bits per pixel mask (e.g. antialiasing)
Definition:
SkMask.h:28
SkMask::kLCD16_Format
@ kLCD16_Format
565 alpha for r/g/b
Definition:
SkMask.h:31
SkMask::kARGB32_Format
@ kARGB32_Format
SkPMColor.
Definition:
SkMask.h:30
SkMask::kSDF_Format
@ kSDF_Format
8bits representing signed distance field
Definition:
SkMask.h:32
SkMask::kBW_Format
@ kBW_Format
1bit per pixel mask (e.g. monochrome)
Definition:
SkMask.h:27
SkPackedGlyphID
Definition:
SkGlyph.h:46
Generated on Sun Jun 23 2024 21:56:36 for Flutter Engine by
1.9.4