Repository navigation
Commit 87ed050
committed
composite: the fast path for normal mode with an opacity too
Normal mode with an opacity went through __blend__, per channel in
floats with the blend function called for each. It is source over with
the source alpha scaled by the opacity: the fast path's formula. The
fast path also indexes by offsets incremented per pixel and copies
bytes instead of 32-bit words, which was no faster.
A 1100x680 layer (two thirds at alpha 150) onto an opaque image, median
of 100 runs: opacity 0.85 12.6 -> 7.6 ms, opacity 1 9.4 -> 7.6 ms; an
opaque layer 4.4 -> 4.2 ms. The results are byte-identical to __blend__
on random pixels at random opacities; at exact halves (opacity 0.5 of
opaque pixels) they now round like the fast path did, by 1 at most.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BsU2GDnECphmYTjLB5UeZv1 parent 7fb8511 commit 87ed050
2 files changed
Lines changed: 23 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1287 | 1287 | | |
1288 | 1288 | | |
1289 | 1289 | | |
1290 | | - | |
| 1290 | + | |
| 1291 | + | |
1291 | 1292 | | |
1292 | 1293 | | |
1293 | 1294 | | |
1294 | 1295 | | |
1295 | | - | |
1296 | | - | |
1297 | | - | |
1298 | 1296 | | |
1299 | 1297 | | |
1300 | | - | |
1301 | | - | |
| 1298 | + | |
1302 | 1299 | | |
1303 | 1300 | | |
1304 | 1301 | | |
1305 | | - | |
1306 | 1302 | | |
1307 | | - | |
1308 | | - | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
1309 | 1308 | | |
1310 | 1309 | | |
1311 | 1310 | | |
1312 | | - | |
1313 | | - | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
1314 | 1314 | | |
1315 | 1315 | | |
1316 | 1316 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
444 | 456 | | |
445 | 457 | | |
446 | 458 | | |
| |||
0 commit comments