Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
15namespace sktext::gpu {
16
17class Glyph {
18public:
20 switch (format) {
23 // fall through to kA8 -- we store BW and SDF glyphs in our 8-bit cache
25 return skgpu::MaskFormat::kA8;
27 return skgpu::MaskFormat::kA8; // ignore the mul and add planes, just use the mask
29 return skgpu::MaskFormat::kA565;
31 return skgpu::MaskFormat::kARGB;
32 }
33
35 }
36
37 Glyph(SkPackedGlyphID packedGlyphID) : fPackedID(packedGlyphID) {}
38
41};
42
43} // namespace sktext::gpu
44
45#endif // sktext_gpu_Glyph_DEFINED
#define SkUNREACHABLE
Definition SkAssert.h:135
skgpu::AtlasLocator fAtlasLocator
Definition Glyph.h:40
static skgpu::MaskFormat FormatFromSkGlyph(SkMask::Format format)
Definition Glyph.h:19
Glyph(SkPackedGlyphID packedGlyphID)
Definition Glyph.h:37
const SkPackedGlyphID fPackedID
Definition Glyph.h:39
uint32_t uint32_t * format
Format
Definition SkMask.h:26
@ k3D_Format
3 8bit per pixl planes: alpha, mul, add
Definition SkMask.h:29
@ kA8_Format
8bits per pixel mask (e.g. antialiasing)
Definition SkMask.h:28
@ kLCD16_Format
565 alpha for r/g/b
Definition SkMask.h:31
@ kARGB32_Format
SkPMColor.
Definition SkMask.h:30
@ kSDF_Format
8bits representing signed distance field
Definition SkMask.h:32
@ kBW_Format
1bit per pixel mask (e.g. monochrome)
Definition SkMask.h:27