MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / parseFrameRecord

Function parseFrameRecord

packages/core/src/debug/parsers.ts:158–200  ·  view source on GitHub ↗
(bytes: Uint8Array)

Source from the content-addressed store, hash-verified

156 * - _pad0: u32 (bytes 52-55)
157 */
158export function parseFrameRecord(bytes: Uint8Array): DebugParseResult<FrameRecord> {
159 if (bytes.byteLength < DEBUG_FRAME_RECORD_SIZE) {
160 return fail(
161 "ZR_TRUNCATED",
162 0,
163 `need ${DEBUG_FRAME_RECORD_SIZE} bytes for frame record but only ${bytes.byteLength} available`,
164 );
165 }
166
167 const r = new BinaryReader(bytes);
168
169 const frameId = readU64(r);
170 const cols = r.readU32();
171 const rows = r.readU32();
172 const drawlistBytes = r.readU32();
173 const drawlistCmds = r.readU32();
174 const diffBytesEmitted = r.readU32();
175 const dirtyLines = r.readU32();
176 const dirtyCells = r.readU32();
177 const damageRects = r.readU32();
178 const usDrawlist = r.readU32();
179 const usDiff = r.readU32();
180 const usWrite = r.readU32();
181 // Skip _pad0
182
183 return {
184 ok: true,
185 value: {
186 frameId,
187 cols,
188 rows,
189 drawlistBytes,
190 drawlistCmds,
191 diffBytesEmitted,
192 dirtyLines,
193 dirtyCells,
194 damageRects,
195 usDrawlist,
196 usDiff,
197 usWrite,
198 },
199 };
200}
201
202/**
203 * Parse an event record payload.

Callers 4

parsePayloadFunction · 0.85
getPayloadFunction · 0.85
processRecordsFunction · 0.85
parsers.test.tsFile · 0.85

Calls 3

readU32Method · 0.95
readU64Function · 0.85
failFunction · 0.70

Tested by

no test coverage detected