)]}'
{
  "commit": "357f9df2d7723ccddca8effab7a48f2b14850a50",
  "tree": "0d1d4bd95156cfdff42cdc5007daba8d098c4195",
  "parents": [
    "970096001202a73f65ff0803706f45ff8824238b"
  ],
  "author": {
    "name": "Behdad Esfahbod",
    "email": "behdad@behdad.org",
    "time": "Fri Nov 20 21:52:10 2026 -0600"
  },
  "committer": {
    "name": "Behdad Esfahbod",
    "email": "behdad@behdad.org",
    "time": "Fri Nov 20 22:08:21 2026 -0600"
  },
  "message": "[vector] Pad a PDF gradient in the color of the outer stop at its end\n\nA color line that pads goes on before its first stop in that stop\u0027s\ncolor, and after its last stop in that one\u0027s.  Two stops can share\nthe first offset, or the last: red before the gradient, say, and blue\nright from where it starts.\n\nhb-vector wrote that as a shading whose function has a piece of no\nlength at its end, and a shading that extends goes on in what its\nfunction gives at 0 and at 1.  In pdfium, MuPDF and poppler that is\nthe color of the inner one of the two stops, so the padding on that\nside was the wrong color; Ghostscript had the start right and the end\nwrong.  The SVG output has both right.\n\nLengthen such a color line by a stretch in the outer stop\u0027s color,\nand move that end of the shading out with it.  The stretch is a\nfifteenth of the length, which puts the two stops a sixteenth in from\nthe end: pdfium samples the function at every 256th, and has a sample\nthere.  A radial gradient is lengthened no further than halfway to a\nradius of zero; one that starts or ends there paints nothing beyond,\nand is written without the outer stop.\n\nTesting: a new test checks what is written for linear and radial\ngradients with such stops, and fails without the change.  Replaying\nthe same paint calls on hb-raster and hb-vector for 300 random scenes\nof them, the pixels are the same in:\n\n                  before  after\n  pdfium             145    300\n  MuPDF              145    300\n  poppler cairo      144    300\n  poppler Splash     144    300\n  Ghostscript        207    296\n\nand in Chrome and librsvg in all 300 before and after.  Of the four\nthat Ghostscript still differs on, the two that were reduced are a\nlinear gradient under a rotation, which it gets wrong whatever the\ncolor line.  Scenes of other gradients, 1500 of them, are written\nbyte for byte as before, and so are all 1553 mapped glyphs of the\nCOLR test fonts.\n\nFound with a font of random COLR glyphs.  The test and the vector\nfuzzer are clean under ASan and UBSan, and the test under MSan; three\nminutes of fuzzing with coverage and failing allocations (6 jobs, 241\nthousand runs) found nothing.  Full test suite passes.\n\nCo-Authored-By: Claude Fable 5.2 \u003cnoreply@anthropic.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e8d09879ee18fa30a7a5d099d83572a708d795d2",
      "old_mode": 33188,
      "old_path": "src/hb-vector-paint-pdf.cc",
      "new_id": "05ebdfd9654fe773ce56b2ce395da1c5e1fe4d14",
      "new_mode": 33188,
      "new_path": "src/hb-vector-paint-pdf.cc"
    },
    {
      "type": "modify",
      "old_id": "b1975c58188a16de70c22b64be351cafa44572c4",
      "old_mode": 33188,
      "old_path": "test/vector/meson.build",
      "new_id": "6c648fed553a256927e3d9ef13e618ae8ae372f8",
      "new_mode": 33188,
      "new_path": "test/vector/meson.build"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "85895ea7ef271b4a4e31aacb9f0b5c11776a0ef7",
      "new_mode": 33188,
      "new_path": "test/vector/test-vector-pdf-pad.c"
    }
  ]
}
