Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(673)

Side by Side Diff: third_party/WebKit/Source/core/paint/README.md

Issue 2285633005: Reland of Skip PaintLayer empty paint phases if it previously painted nothing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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.
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698