The format

Each operation is one byte, then its fields. f is a 32-bit float, i a 32-bit integer, b a byte.

OperationCodeFields
SAVE1
RESTORE2
TRANSLATE4f dx, f dy
SCALE5f sx, f sy
ROTATE6f degrees
CONCAT79 f, Matrix.getValues() order
SET_MATRIX89 f, relative to the node's transform
CLIP_RECT10f left, top, right, bottom, b op (0 intersect, 1 difference)
CLIP_PATH11a path, b op
DRAW_COLOR12i color (ARGB), b blend
DRAW_PAINT13a paint
DRAW_RECT14f left, top, right, bottom, a paint
DRAW_RRECT15f left, top, right, bottom, rx, ry, a paint
DRAW_OVAL16f left, top, right, bottom, a paint
DRAW_CIRCLE17f cx, cy, radius, a paint
DRAW_ARC18f left, top, right, bottom, start, sweep, b useCenter, a paint
DRAW_LINES19i count, count f (x0, y0, x1, y1 for each line), a paint
DRAW_POINTS20i count, count f, a paint
DRAW_PATH21a path, a paint
DRAW_GLYPHS22i font, f size, scaleX, skew, b fakeBold, i n, n i glyph IDs, 2n f positions, a paint
DRAW_BITMAP23i bitmap, f source rectangle, f destination rectangle, a paint
SAVE_LAYER25f left, top, right, bottom, i alpha, b blend
NODE_BEGIN309 f transform in the parent, f alpha, width, height, b clipToBounds, the outline clip, the clip rectangle
NODE_END31

A path is b fillType (Path.FillType's order), i verbs, i floats, the verbs as bytes (move 0, line 1, quad 2, cubic 3, close 4), then the floats of their points.

A paint is i color, b style, cap, join, flags, f strokeWidth, miter, b blend (Skia's SkBlendMode numbers), b shader kind, filter kind, dash count. Then, when they are there:

The outline clip of a node is b 0 for none, 1 for a rounded rectangle (f left, top, right, bottom, radius) and 2 for a path. Its clip rectangle is b 0, or 1 and f left, top, right, bottom.


Made from docs/platforms/android-apps/hwui.md at 69237645142c. GPL-3.0-or-later.