Commit e2d97af
committed
displayio: step the TileGrid tile terms along the row
TileGrid.fill_area computed the tile index, the position inside the tile
and the tile's place in the bitmap with nine integer divides per pixel.
All divisors are constant for the call, and five of the divides depend
only on the row. On cores without a divide instruction each one is a
library call.
- The row terms are computed once per row.
- The x terms are stepped along the row.
- The tile's position in the bitmap is recomputed only when the tile
changes.
- Bitmap.get_pixel computes values_per_byte only for bitmaps below
8 bits per pixel, so 8 and 16 bpp reads no longer divide.
RP2040 (pajenicko_picopad), full-screen 320x240 repaint of an 8 bpp
bitmap: 297 -> 203 ms. Flash +104 bytes.
Output is unchanged: 12 cases (tiles of 16x16 and 12x10, partly
off-screen, flip_x, flip_y, transpose, scale 2 and 3, transparency with
overlap, 1/2/4/8/16 bpp, ColorConverter, dither) checksum identically
through BusDisplay.fill_row.1 parent ac3ad80 commit e2d97af
2 files changed
Lines changed: 38 additions & 8 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | 95 | | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
518 | 522 | | |
519 | 523 | | |
520 | | - | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
521 | 538 | | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
522 | 550 | | |
523 | 551 | | |
524 | 552 | | |
| |||
531 | 559 | | |
532 | 560 | | |
533 | 561 | | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
| 562 | + | |
538 | 563 | | |
539 | 564 | | |
540 | 565 | | |
541 | 566 | | |
542 | 567 | | |
543 | 568 | | |
544 | | - | |
545 | | - | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
546 | 576 | | |
547 | 577 | | |
548 | 578 | | |
| |||
0 commit comments