| OLD | NEW |
| 1 # `Source/core/paint` | 1 # `Source/core/paint` |
| 2 | 2 |
| 3 This directory contains implementation of painters of layout objects. It covers | 3 This directory contains implementation of painters of layout objects. It covers |
| 4 the following document lifecycle states: | 4 the following document lifecycle states: |
| 5 | 5 |
| 6 * PaintInvalidation (`InPaintInvalidation` and `PaintInvalidationClean`) | 6 * PaintInvalidation (`InPaintInvalidation` and `PaintInvalidationClean`) |
| 7 * PrePaint (`InPrePaint` and `PrePaintClean`) | 7 * PrePaint (`InPrePaint` and `PrePaintClean`) |
| 8 * Paint (`InPaint` and `PaintClean`) | 8 * Paint (`InPaint` and `PaintClean`) |
| 9 | 9 |
| 10 ## Glossaries | 10 ## Glossaries |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 empty phases. Now we have optimized `PaintPhaseDescendantBlockBackgroundsOnly`, | 240 empty phases. Now we have optimized `PaintPhaseDescendantBlockBackgroundsOnly`, |
| 241 `PaintPhaseDescendantOutlinesOnly` and `PaintPhaseFloat` for empty paint phases. | 241 `PaintPhaseDescendantOutlinesOnly` and `PaintPhaseFloat` for empty paint phases. |
| 242 | 242 |
| 243 During paint invalidation, we set the containing self-painting layer's `needsPai
ntPhaseXXX` | 243 During paint invalidation, we set the containing self-painting layer's `needsPai
ntPhaseXXX` |
| 244 flag if the object has something needing to be painted in the paint phase. | 244 flag if the object has something needing to be painted in the paint phase. |
| 245 | 245 |
| 246 During painting, we check the flag before painting a paint phase and skip the tr
ee walk if | 246 During painting, we check the flag before painting a paint phase and skip the tr
ee walk if |
| 247 the flag is not set. | 247 the flag is not set. |
| 248 | 248 |
| 249 It's hard to clear a `needsPaintPhaseXXX` flag when a layer no longer needs the
paint phase, | 249 It's hard to clear a `needsPaintPhaseXXX` flag when a layer no longer needs the
paint phase, |
| 250 so we never clear the flags. | 250 so we never clear the flags. Instead, we use another set of flags (`previousPain
tPhaseXXXWasEmpty`) |
| 251 to record if a painting of a phase actually produced nothing. We'll skip the nex
t |
| 252 painting of the phase if the flag is set, regardless of the corresponding |
| 253 `needsPaintPhaseXXX` flag. We will clear the `previousPaintPhaseXXXWasEmpty` fla
gs when |
| 254 we paint with different clipping, scroll offset or interest rect from the previo
us paint. |
| 255 |
| 256 We don't clear the `previousPaintPhaseXXXWasEmpty` flags when the layer is marke
d `needsRepaint`. |
| 257 Instead we clear the flag when the corresponding `needsPaintPhaseXXX` is set. Th
is ensures that |
| 258 we won't clear `previousPaintPhaseXXXWasEmpty` flags when unrelated things chang
ed which won't |
| 259 cause the paint phases to become non-empty. |
| 251 | 260 |
| 252 When layer structure changes, and we are not invalidate paint of the changed sub
tree, | 261 When layer structure changes, and we are not invalidate paint of the changed sub
tree, |
| 253 we need to manually update the `needsPaintPhaseXXX` flags. For example, if an ob
ject changes | 262 we need to manually update the `needsPaintPhaseXXX` flags. For example, if an ob
ject changes |
| 254 style and creates a self-painting-layer, we copy the flags from its containing s
elf-painting | 263 style and creates a self-painting-layer, we copy the flags from its containing s
elf-painting |
| 255 layer to this layer, assuming that this layer needs all paint phases that its co
ntainer | 264 layer to this layer, assuming that this layer needs all paint phases that its co
ntainer |
| 256 self-painting layer needs. | 265 self-painting layer needs. |
| 257 | 266 |
| 258 We could update the `needsPaintPhaseXXX` flags in a separate tree walk, but that
would regress | 267 We could update the `needsPaintPhaseXXX` flags in a separate tree walk, but that
would regress |
| 259 performance of the first paint. For slimming paint v2, we can update the flags d
uring the | 268 performance of the first paint. For slimming paint v2, we can update the flags d
uring the |
| 260 pre-painting tree walk to simplify the logics. | 269 pre-painting tree walk to simplify the logics. |
| OLD | NEW |