Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
SkFontConfigInterface::FontIdentity Struct Reference

#include <SkFontConfigInterface.h>

Public Member Functions

 FontIdentity ()
 
bool operator== (const FontIdentity &other) const
 
bool operator!= (const FontIdentity &other) const
 
size_t writeToMemory (void *buffer=nullptr) const
 
size_t readFromMemory (const void *buffer, size_t length)
 

Public Attributes

uint32_t fID
 
int32_t fTTCIndex
 
SkString fString
 
SkFontStyle fStyle
 

Detailed Description

This should be treated as private to the impl of SkFontConfigInterface. Callers should not change or expect any particular values. It is meant to be a union of possible storage types to aid the impl.

Definition at line 45 of file SkFontConfigInterface.h.

Constructor & Destructor Documentation

◆ FontIdentity()

SkFontConfigInterface::FontIdentity::FontIdentity ( )
inline

Member Function Documentation

◆ operator!=()

bool SkFontConfigInterface::FontIdentity::operator!= ( const FontIdentity other) const
inline

Definition at line 53 of file SkFontConfigInterface.h.

53 {
54 return !(*this == other);
55 }

◆ operator==()

bool SkFontConfigInterface::FontIdentity::operator== ( const FontIdentity other) const
inline

Definition at line 48 of file SkFontConfigInterface.h.

48 {
49 return fID == other.fID &&
50 fTTCIndex == other.fTTCIndex &&
51 fString == other.fString;
52 }

◆ readFromMemory()

size_t SkFontConfigInterface::FontIdentity::readFromMemory ( const void *  buffer,
size_t  length 
)

Definition at line 85 of file SkFontConfigInterface_direct.cpp.

86 {
87 SkRBuffer buffer(addr, size);
88
89 (void)buffer.readU32(&fID);
90 (void)buffer.readS32(&fTTCIndex);
91 uint32_t strLen, weight, width;
92 (void)buffer.readU32(&strLen);
93 (void)buffer.readU32(&weight);
94 (void)buffer.readU32(&width);
95 uint8_t u8;
96 (void)buffer.readU8(&u8);
98 fStyle = SkFontStyle(weight, width, slant);
99 fString.resize(strLen);
100 (void)buffer.read(fString.data(), strLen);
101 buffer.skipToAlign4();
102
103 return buffer.pos(); // the actual number of bytes read
104}
const char * data() const
Definition SkString.h:132
void resize(size_t len)
Definition SkString.cpp:374
static const uint8_t buffer[]
int32_t width

◆ writeToMemory()

size_t SkFontConfigInterface::FontIdentity::writeToMemory ( void *  buffer = nullptr) const

Definition at line 64 of file SkFontConfigInterface_direct.cpp.

64 {
65 size_t size = sizeof(fID) + sizeof(fTTCIndex);
66 size += sizeof(int32_t) + sizeof(int32_t) + sizeof(uint8_t); // weight, width, italic
67 size += sizeof(int32_t) + fString.size(); // store length+data
68 if (addr) {
69 SkWBuffer buffer(addr, size);
70
71 buffer.write32(fID);
72 buffer.write32(fTTCIndex);
73 buffer.write32(fString.size());
74 buffer.write32(fStyle.weight());
75 buffer.write32(fStyle.width());
76 buffer.write8(fStyle.slant());
77 buffer.write(fString.c_str(), fString.size());
78 buffer.padToAlign4();
79
80 SkASSERT(buffer.pos() == size);
81 }
82 return size;
83}
#define SkASSERT(cond)
Definition SkAssert.h:116
Slant slant() const
Definition SkFontStyle.h:64
int width() const
Definition SkFontStyle.h:63
int weight() const
Definition SkFontStyle.h:62
size_t size() const
Definition SkString.h:131
const char * c_str() const
Definition SkString.h:133
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition switches.h:259

Member Data Documentation

◆ fID

uint32_t SkFontConfigInterface::FontIdentity::fID

Definition at line 57 of file SkFontConfigInterface.h.

◆ fString

SkString SkFontConfigInterface::FontIdentity::fString

Definition at line 59 of file SkFontConfigInterface.h.

◆ fStyle

SkFontStyle SkFontConfigInterface::FontIdentity::fStyle

Definition at line 60 of file SkFontConfigInterface.h.

◆ fTTCIndex

int32_t SkFontConfigInterface::FontIdentity::fTTCIndex

Definition at line 58 of file SkFontConfigInterface.h.


The documentation for this struct was generated from the following files: