Commit c24487e
committed
Add logic to track rendering area of various PDF ops
This commit is a first step towards #6419, and it can also help with
first compute which ops can affect what is visible in that part of
the page.
This commit adds logic to track operations with their respective
bounding boxes. Only operations that actually cause something to
be rendered have a bounding box and dependencies.
Consider the following example:
```
0. setFillRGBColor
1. beginText
2. showText "Hello"
3. endText
4. constructPath [...] -> eoFill
```
here we have three rendering operations: the showText op (2) and the
path (4). (2) depends on (0), (1) and (3), while (4) only depends on
(0). Both (2) and (4) have a bounding box.
This tracking happens when first rendering a PDF: we then use the
recorded information to optimize future partial renderings of a PDF, so
that we can skip operations that do not affected the PDF area on the
canvas.
All this logic only runs when the new `enableOptimizedPartialRendering`
preference, disabled by default, is enabled.
The bounding boxes and dependencies are also shown in the pdfBug
stepper. When hovering over a step now:
- it highlights the steps that they depend on
- it highlights on the PDF itself the bounding box1 parent e20ee99 commit c24487e
File tree
16 files changed
+2553
-212
lines changed- src
- display
- test
- web
16 files changed
+2553
-212
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
1239 | 1240 | | |
1240 | 1241 | | |
1241 | 1242 | | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
1242 | 1247 | | |
1243 | 1248 | | |
1244 | 1249 | | |
| |||
1309 | 1314 | | |
1310 | 1315 | | |
1311 | 1316 | | |
| 1317 | + | |
1312 | 1318 | | |
1313 | 1319 | | |
1314 | 1320 | | |
| |||
1433 | 1439 | | |
1434 | 1440 | | |
1435 | 1441 | | |
| 1442 | + | |
| 1443 | + | |
1436 | 1444 | | |
1437 | 1445 | | |
1438 | 1446 | | |
| |||
1479 | 1487 | | |
1480 | 1488 | | |
1481 | 1489 | | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
1482 | 1495 | | |
1483 | 1496 | | |
1484 | 1497 | | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
1485 | 1510 | | |
1486 | 1511 | | |
1487 | 1512 | | |
| |||
1516 | 1541 | | |
1517 | 1542 | | |
1518 | 1543 | | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
1519 | 1547 | | |
1520 | 1548 | | |
1521 | 1549 | | |
| |||
1531 | 1559 | | |
1532 | 1560 | | |
1533 | 1561 | | |
| 1562 | + | |
1534 | 1563 | | |
1535 | 1564 | | |
1536 | 1565 | | |
| |||
3140 | 3169 | | |
3141 | 3170 | | |
3142 | 3171 | | |
| 3172 | + | |
3143 | 3173 | | |
3144 | 3174 | | |
3145 | 3175 | | |
| |||
3170 | 3200 | | |
3171 | 3201 | | |
3172 | 3202 | | |
| 3203 | + | |
| 3204 | + | |
3173 | 3205 | | |
3174 | 3206 | | |
3175 | 3207 | | |
| |||
3199 | 3231 | | |
3200 | 3232 | | |
3201 | 3233 | | |
3202 | | - | |
| 3234 | + | |
3203 | 3235 | | |
3204 | 3236 | | |
3205 | 3237 | | |
| |||
3218 | 3250 | | |
3219 | 3251 | | |
3220 | 3252 | | |
3221 | | - | |
| 3253 | + | |
| 3254 | + | |
3222 | 3255 | | |
3223 | 3256 | | |
3224 | 3257 | | |
| |||
3294 | 3327 | | |
3295 | 3328 | | |
3296 | 3329 | | |
3297 | | - | |
| 3330 | + | |
| 3331 | + | |
3298 | 3332 | | |
3299 | 3333 | | |
3300 | 3334 | | |
| |||
0 commit comments