Open
Bug 1259278
Opened 10 years ago
Updated 1 year ago
Implement precise visibility tracking using the same display lists that we paint with
Categories
(Core :: Layout, task)
Core
Layout
Tracking
()
REOPENED
People
(Reporter: seth, Unassigned)
References
Details
Attachments
(6 files)
|
42.77 KB,
patch
|
Details | Diff | Splinter Review | |
|
24.96 KB,
patch
|
Details | Diff | Splinter Review | |
|
1.90 KB,
patch
|
Details | Diff | Splinter Review | |
|
1.19 KB,
patch
|
Details | Diff | Splinter Review | |
|
1.54 KB,
patch
|
Details | Diff | Splinter Review | |
|
6.18 KB,
patch
|
Details | Diff | Splinter Review |
Especially given that we only update approximate visibility at most once per second, we need to combine approximate visibility tracking with precise visibility tracking. We need both, because approximate visibility tracking is used for predictive image decoding and tracks an area which is larger than the viewport or displayport (this is why it is approximate), but the low sample rate for it makes it poorly suited for many things that we'd want to use visibility tracking for.
Here's the initial plan:
(1) Add a second frame visibility counter (stored in the same frame property; we should still be able to avoid allocation by being smart about the number of bits we use). This counter will be used for precise visibility.
(2) Add a second set to the pres shell for precisely visible frames.
(3) When we construct a display list for painting, increment the precise visibility count for frames in the display list, and decrement for frames that are no longer visible, using the same algorithm we use for approximate visibility. Note that display lists constructed for other purposes (e.g. canvas.drawWindow()) should not be factored in, and we should also probably ignore display lists intended for painting the low-resolution displayport we use when scrolling quickly.
(4) Add a new Visibility::VISIBLE enum value, and rename Visibility::APPROXIMATELY_NONVISIBLE to Visibility::NONVISIBLE.
(5) nsIFrame::GetVisibility() should return Visibility::VISIBLE if the precise visibility counter for the frame is greater than 0, else Visibility::APPROXIMATELY_VISIBLE if the approximate visibility counter is greater than 0, else Visibility::NONVISIBLE.
(6) Update the other visibility-related methods to be precise visibility-aware.
(7) Remove now-unnecessary code. One obvious candidate is nsIFrame::UpdateVisibilitySynchronously() and all callers.
(8) Update the visibility visualization to paint precisely-visible regions a different color from approximately-visible regions. (Which requires sending them over to the compositor thread separately.)
These changes shouldn't be that complex, and they should make the visibility API much more useful.
CC'ing some folks familiar with this code.
Comment 1•9 years ago
|
||
Comment 2•9 years ago
|
||
Comment 3•9 years ago
|
||
Comment 4•9 years ago
|
||
Comment 5•9 years ago
|
||
Comment 6•9 years ago
|
||
Comment 7•9 years ago
|
||
Most of the patches are rebased versions of patches from bugs 1270389, 1272554 and 1270394 to keep them updated in a single bug.
Updated•9 years ago
|
Attachment #8783676 -
Attachment description: Part 1 → Part 1: Add Visibility::IN_VIEWPORT to the frame visibility API
Updated•9 years ago
|
Attachment #8783677 -
Attachment description: Part 2 → Part 2: Cache the current scroll parent and scrollports/displayports information
Updated•9 years ago
|
Attachment #8783678 -
Attachment description: Part 3 → Part 3: Only consider a frame IN_DISPLAYPORT if it's within the critical displayport
Updated•9 years ago
|
Attachment #8783680 -
Attachment description: Part 5 → Part 5: Add lambda versions of nsIDocument::EnumerateSubDocuments()
Updated•9 years ago
|
Attachment #8783681 -
Attachment description: Part 6 → Part 6: Replace remove-only approximate visibility updates with just dropping everything outside of the viewport
Updated•9 years ago
|
Attachment #8783679 -
Attachment description: Part 4 → Part 4: Fix switch block compiling errors on Android
Updated•9 years ago
|
No longer blocks: intersection-observer-impl
Comment 8•4 years ago
|
||
The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.
Assignee: seth.bugzilla → nobody
Updated•3 years ago
|
Severity: normal → S3
Comment 9•1 year ago
|
||
No activity for years, closing. please reopen if you plan to finish it
Status: NEW → RESOLVED
Type: defect → task
Closed: 1 year ago
Resolution: --- → INACTIVE
Updated•1 year ago
|
Status: RESOLVED → REOPENED
Resolution: INACTIVE → ---
You need to log in
before you can comment on or make changes to this bug.
Description
•