8#ifndef SkRecord_DEFINED
9#define SkRecord_DEFINED
38 int count()
const {
return fCount; }
45 auto visit(
int i,
F&& f)
const ->
decltype(f(SkRecords::NoOp())) {
46 return fRecords[i].visit(f);
54 auto mutate(
int i,
F&& f) ->
decltype(f((SkRecords::NoOp*)
nullptr)) {
55 return fRecords[i].mutate(f);
63 alignas(
T)
char data[
sizeof(
T)];
65 fApproxBytesAllocated +=
count *
sizeof(
T) +
alignof(
T);
73 if (fCount == fReserved) {
76 return fRecords[fCount++].set(this->allocCommand<T>());
87 this->
mutate(i, destroyer);
89 return fRecords[i].set(this->allocCommand<T>());
118 template <
typename T>
119 void operator()(
T* record) { record->~T(); }
122 template <
typename T>
123 std::enable_if_t<std::is_empty<T>::value,
T*> allocCommand() {
124 static T singleton = {};
128 template <
typename T>
129 std::enable_if_t<!std::is_empty<T>::value,
T*> allocCommand() {
return this->alloc<T>(); }
139 template <
typename T>
143 SkASSERT(this->ptr() == ptr && this->
type() == T::kType);
148 void* ptr()
const {
return fPtr; }
151 template <
typename F>
152 auto visit(
F&& f)
const ->
decltype(
f(SkRecords::NoOp())) {
153 #define CASE(T) case SkRecords::T##_Type: return f(*(const SkRecords::T*)this->ptr());
157 static const SkRecords::NoOp
noop{};
162 template <
typename F>
163 auto mutate(
F&& f) ->
decltype(
f((SkRecords::NoOp*)
nullptr)) {
164 #define CASE(T) case SkRecords::T##_Type: return f((SkRecords::T*)this->ptr());
168 static const SkRecords::NoOp
noop{};
169 return f(
const_cast<SkRecords::NoOp*
>(&noop));
182 size_t fApproxBytesAllocated{0};
#define SkDEBUGFAIL(message)
#define SK_RECORD_TYPES(M)
T * makeArrayDefault(size_t count)
auto visit(int i, F &&f) const -> decltype(f(SkRecords::NoOp()))
T * alloc(size_t count=1)
auto mutate(int i, F &&f) -> decltype(f((SkRecords::NoOp *) nullptr))
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 set