Skip to content

PNT1 1/8: radius and shadow paint engines (paint-radius.ts, paint-shadow.ts, paint-aa.ts), vectors and host plumbing - #80

Open
thejackshelton wants to merge 2 commits into
masterfrom
pnt1-paint-engines
Open

thejackshelton wants to merge 2 commits into
masterfrom
pnt1-paint-engines

Conversation

@thejackshelton

Copy link
Copy Markdown
Contributor

PNT1 part 1 of 8 (T115; notes/T046-paint-spec.md §5.2): the radius and shadow paint engines. This is the reference code that the device runs translated, plus its host plumbing.

First of a stacked chain. Base: master. The later parts are stacked on review/<parent> branches. The chain lands as a PNT1 train after trains 1–4. It was split by theme from pnt1-shadow-v2 53ca9f7db2, whose sources parts 1–3 together equal.

What changed

  • packages/layout/src/paint-radius.ts: border-radius geometry as Blink 145 paints it:
    • CalcRadiiFor resolves against the layout border box.
    • gfx::SizeF's clamp, then ConstrainRadii.
    • The padding-edge radii.
  • paint-shadow.ts: box-shadow layers as Chrome composites them:
    • spread shapes and the blur mask;
    • each shadow onto its backdrop.
    • It runs on paint-aa.ts's port of Skia's analytic AA.
  • Tests: paint-radius.test, paint-shadow.test and paint-aa.test.
  • Paint vectors. The inputs come from scripts/gen-paint-inputs-radius.ts and gen-paint-inputs-shadow.ts, run by one paint-inputs regen step that has its .gitattributes lines. The harness gains its paint:radius and paint:shadow cases.
  • Host plumbing:
    • ExpectedEngine.paint (PaintEngine) and the layout border-box size in the expected dump's node geometry;
    • SampleBox.size.
  • Ports registry. docs/ports.json registers the cited Blink and Skia files. float_rounded_rect.cc's Adobe BSD notice is kept in paint-shadow.ts, and gen-third-party-notices.ts gets its title.
  • Tool: packages/dragon/test/tools/check-pnt1-additive.ts, the PNT1 additive check.

Changed tests (reasons)

  • layout/test/paint-seams.test.ts: the radius and shadow seams are now filled (FILLED, plus their index.ts export lines).
  • parity/test/samples.test.ts, paint-seams.test.ts and native-compare.test.ts: their SampleBox literals gain the new required size field. No assertion changes.
  • dragon/test/expected-dump.test.ts: the engine it builds passes the new paint field.

What passed

  • pnpm regen: fixed point after 3 passes. The outputs are in their own commit, 804faeb.
  • pnpm typecheck: clean.
  • pnpm test: 3598 passed, 12 failed, 1 skipped.

The 12 failing tests are the device-record checks (lanes.test, lanes-records.test, device-failures.test, p6a-promotion.test, lanes-concurrent.test). They fail only because the committed packages/parity/out/lanes.json is host-only: the device lanes run under the device lease at this branch's turn in the PNT1 train. No device run has been made for this branch.

🤖 Generated with Claude Code

…and shadow references the device runs translated, and their plumbing into the host. packages/layout/src/paint-radius.ts gives border-radius geometry as Blink 145 paints it (CalcRadiiFor against the layout border box, gfx::SizeF's clamp, ConstrainRadii, the padding-edge radii); paint-shadow.ts gives box-shadow layers as Chrome composites them (spread shapes, the blur mask, each shadow onto its backdrop), on paint-aa.ts's Skia analytic AA. Their tests; their paint-vector inputs from scripts/gen-paint-inputs-radius.ts and gen-paint-inputs-shadow.ts (one regen step, with .gitattributes lines); the harness's paint:radius and paint:shadow cases; the ports registry entries and the Adobe notice title; the expected dump's PaintEngine and layout border-box size, and the sample boxes' size; the PNT1 additive check tool. Split from pnt1-shadow-v2 53ca9f7db2
…egen: fixed point after 3 passes): the radius and shadow paint-vector inputs and vectors, the translated engine (PaintRadius, PaintShadow and their unions and strings in Swift and Kotlin), profiles, a host-only lanes.json

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant