#include <SkDescriptor.h>
Definition at line 25 of file SkDescriptor.h.
◆ addEntry()
void * SkDescriptor::addEntry |
( |
uint32_t |
tag, |
|
|
size_t |
length, |
|
|
const void * |
data = nullptr |
|
) |
| |
Definition at line 35 of file SkDescriptor.cpp.
35 {
39
40 Entry* entry = (
Entry*)((
char*)
this + fLength);
41 entry->fTag = tag;
45 }
46
47 fCount += 1;
49 return (entry + 1);
50}
static constexpr T SkAlign4(T x)
constexpr uint32_t SkToU32(S x)
const void * findEntry(uint32_t tag, uint32_t *length) const
std::shared_ptr< const fml::Mapping > data
◆ Alloc()
std::unique_ptr< SkDescriptor > SkDescriptor::Alloc |
( |
size_t |
length | ) |
|
|
static |
◆ computeChecksum()
void SkDescriptor::computeChecksum |
( |
| ) |
|
Definition at line 52 of file SkDescriptor.cpp.
52 {
53 fChecksum = SkDescriptor::ComputeChecksum(this);
54}
◆ ComputeOverhead()
static size_t SkDescriptor::ComputeOverhead |
( |
int |
entryCount | ) |
|
|
inlinestatic |
◆ copy()
std::unique_ptr< SkDescriptor > SkDescriptor::copy |
( |
| ) |
const |
Definition at line 72 of file SkDescriptor.cpp.
72 {
74 memcpy(
desc.get(),
this, fLength);
76}
static std::unique_ptr< SkDescriptor > Alloc(size_t length)
◆ dumpRec()
SkString SkDescriptor::dumpRec |
( |
| ) |
const |
Definition at line 93 of file SkDescriptor.cpp.
93 {
96
98 result.appendf(
" Checksum: %x\n", fChecksum);
99 if (rec != nullptr) {
101 }
103}
#define kRec_SkDescriptorTag
◆ findEntry()
const void * SkDescriptor::findEntry |
( |
uint32_t |
tag, |
|
|
uint32_t * |
length |
|
) |
| const |
Definition at line 56 of file SkDescriptor.cpp.
56 {
59
60 while (--
count >= 0) {
61 if (entry->fTag == tag) {
64 }
65 return entry + 1;
66 }
67 entry = (
const Entry*)((
const char*)(entry + 1) + entry->fLen);
68 }
69 return nullptr;
70}
◆ flatten()
Definition at line 31 of file SkDescriptor.cpp.
31 {
32 buffer.writePad32(
static_cast<const void*
>(
this), this->fLength);
33}
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
◆ getChecksum()
uint32_t SkDescriptor::getChecksum |
( |
| ) |
const |
|
inline |
◆ getCount()
uint32_t SkDescriptor::getCount |
( |
| ) |
const |
|
inline |
◆ getLength()
uint32_t SkDescriptor::getLength |
( |
| ) |
const |
|
inline |
◆ isValid()
bool SkDescriptor::isValid |
( |
| ) |
const |
Definition at line 111 of file SkDescriptor.cpp.
111 {
112 uint32_t
count = fCount;
113 size_t lengthRemaining = this->fLength;
115 return false;
116 }
119
120 while (lengthRemaining > 0 &&
count > 0) {
121 if (lengthRemaining <
sizeof(
Entry)) {
122 return false;
123 }
124 lengthRemaining -=
sizeof(
Entry);
125
126 const Entry* entry = (
const Entry*)(
reinterpret_cast<const char*
>(
this) +
offset);
127
128 if (lengthRemaining < entry->fLen) {
129 return false;
130 }
131 lengthRemaining -= entry->fLen;
132
133
135 return false;
136 }
137
140 }
141 return lengthRemaining == 0 &&
count == 0;
142}
◆ operator delete()
void SkDescriptor::operator delete |
( |
void * |
p | ) |
|
◆ operator new() [1/2]
void * SkDescriptor::operator new |
( |
size_t |
| ) |
|
Definition at line 27 of file SkDescriptor.cpp.
27 {
28 SK_ABORT(
"Descriptors are created with placement new.");
29}
#define SK_ABORT(message,...)
◆ operator new() [2/2]
void * SkDescriptor::operator new |
( |
size_t |
, |
|
|
void * |
p |
|
) |
| |
|
inline |
◆ operator!=()
bool SkDescriptor::operator!= |
( |
const SkDescriptor & |
other | ) |
const |
|
inline |
◆ operator==()
bool SkDescriptor::operator== |
( |
const SkDescriptor & |
other | ) |
const |
Definition at line 78 of file SkDescriptor.cpp.
78 {
79
80
81
82
83 const uint32_t* aa = (const uint32_t*)this;
84 const uint32_t* bb = (const uint32_t*)&other;
85 const uint32_t* stop = (const uint32_t*)((const char*)aa + fLength);
86 do {
87 if (*aa++ != *bb++)
88 return false;
89 } while (aa < stop);
90 return true;
91}
◆ SkAutoDescriptor
◆ SkDescriptorTestHelper
The documentation for this class was generated from the following files: