/** *SkRPCtxUtils::Packwillcheckifthepassed-instructissmallenoughtofitdirectlyinthe *contextfield.Ifso,itwillreturnthedatabit-castedintoavoidpointer.Ifnot,it *allocatesacopyofthestructinsidetheallocandthenreturnsapointertothecopy.
*/ template <typename T>
[[maybe_unused]] staticvoid* Pack(const T& ctx, SkArenaAlloc* alloc) { // If the context is small enough to fit in a pointer, bit-cast it; if not, alloc a copy. if constexpr (sizeof(T) <= sizeof(void*)) { return sk_bit_cast<void*>(ctx);
} else { return alloc->make<T>(ctx);
}
}
/** *SkRPCtxUtils::Unpackperformsthereverseoperation:eitherun-bitcastingtheobjectbacktoits *originalform,orreturningthepointeras-is,dependingonthesizeofthetype.
*/ template <typename T>
[[maybe_unused]] static UnpackedType<T> Unpack(const T* ctx) { // If the context struct fits in a pointer, reinterpret the bits; if it doesn't, return // a reference. This can vary based on the architecture (32-bit pointers vs 64-bit) so we // let the compiler decide which is right, rather than hard-coding it. if constexpr (sizeof(T) <= sizeof(void*)) { return sk_bit_cast<T>(ctx);
} else { return *ctx;
}
}
} // namespace SkRPCtxUtils
#endif// SkRasterPipelineContextUtils_DEFINED
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-08-26)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.