26void PaintParamsKeyBuilder::checkReset() {
32void PaintParamsKeyBuilder::pushStack(int32_t codeSnippetID) {
33 SkASSERT(fDict->isValidID(codeSnippetID));
35 if (!fStack.empty()) {
36 fStack.back().fNumActualChildren++;
37 SkASSERT(fStack.back().fNumActualChildren <= fStack.back().fNumExpectedChildren);
40 const ShaderSnippet* snippet = fDict->getEntry(codeSnippetID);
41 fStack.push_back({codeSnippetID, snippet->fNumChildren});
44void PaintParamsKeyBuilder::popStack() {
46 SkASSERT(fStack.back().fNumActualChildren == fStack.back().fNumExpectedChildren);
66 const int32_t index = (*currentIndex)++;
67 const int32_t
id = fData[index];
80 const int storedDataLengthIdx = (*currentIndex)++;
82 const int dataLength = fData[storedDataLengthIdx];
83 SkASSERT(storedDataLengthIdx + dataLength < SkTo<int>(fData.
size()));
86 dataSpan = fData.
subspan(storedDataLengthIdx + 1, dataLength);
88 *currentIndex += dataLength;
94 const ShaderNode* child = this->createNode(dict, currentIndex, arena);
98 childArray[
i] = child;
101 return arena->
make<ShaderNode>(entry,
102 SkSpan(childArray, entry->fNumChildren),
114 const int keySize = SkTo<int>(fData.
size());
118 int currentIndex = 0;
119 while (currentIndex < keySize) {
120 const ShaderNode*
root = this->createNode(dict, ¤tIndex, arena);
129 memcpy(rootSpan,
roots.data(),
roots.size_bytes());
140 uint32_t
id = keyData[currentIndex++];
143 str->
append(
"UnknownCodeSnippetID:");
151 name.remove_suffix(6);
157 const int dataLength = keyData[currentIndex++];
158 SkASSERT(currentIndex + dataLength < SkTo<int>(keyData.
size()));
160 str->
append(
" fData(size: ");
166 for (
int i = 0;
i < dataLength;
i++) {
173 currentIndex += dataLength;
179 currentIndex =
key_to_string(str, dict, keyData, currentIndex, includeData);
190 const int keySize = SkTo<int>(fData.
size());
191 for (
int currentIndex = 0; currentIndex < keySize;) {
192 currentIndex =
key_to_string(&str, dict, fData, currentIndex, includeData);
207 int32_t
id = keyData[currentIndex++];
210 SkDebugf(
"[%d] unknown block!\n",
id);
216 currentIndex = dump_node(dict, keyData, currentIndex, indent + 1);
221 const int dataLength = keyData[currentIndex++];
222 SkASSERT(currentIndex + dataLength < SkTo<int>(keyData.
size()));
223 SkDebugf(
"%*c", (2 * indent + 1),
' ');
224 SkDebugf(
"Snippet data (size: %i): ", dataLength);
226 if (dataLength == 0) {
229 for (
int i = currentIndex;
i < dataLength;
i++) {
230 SkDebugf(
"%d ", keyData[currentIndex +
i]);
233 currentIndex += dataLength;
240 const int keySize = SkTo<int>(fData.
size());
242 SkDebugf(
"--------------------------------------\n");
243 SkDebugf(
"%u PaintParamsKey (keySize: %d):\n",
id.asUInt(), keySize);
245 int currentIndex = 0;
246 while (currentIndex < keySize) {
247 currentIndex = dump_node(dict, fData, currentIndex, 1);
#define SKGPU_LOG_E(fmt,...)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
SkSpan(Container &&) -> SkSpan< std::remove_pointer_t< decltype(std::data(std::declval< Container >()))> >
static void dump(const float m[20], SkYUVColorSpace cs, bool rgb2yuv)
T * makeArrayDefault(size_t count)
T * makeArray(size_t count)
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
constexpr SkSpan< T > subspan(size_t offset) const
constexpr T * data() const
constexpr size_t size_bytes() const
constexpr size_t size() const
void append(const char text[])
void appendS32(int32_t value)
void appendU32(uint32_t value)
constexpr PaintParamsKey(const PaintParamsKey &)=default
PaintParamsKey clone(SkArenaAlloc *) const
SkString toString(const ShaderCodeDictionary *dict, bool includeData) const
SkSpan< const ShaderNode * > getRootNodes(const ShaderCodeDictionary *, SkArenaAlloc *) const
const ShaderSnippet * getEntry(int codeSnippetID) const SK_EXCLUDES(fSpinLock)
DEF_SWITCHES_START aot vmservice shared library name
static int key_to_string(SkString *str, const ShaderCodeDictionary *dict, SkSpan< const uint32_t > keyData, int currentIndex, bool includeData)
constexpr bool ends_with(std::string_view str, std::string_view suffix)
const char * fStaticFunctionName