Closed Bug 1614655 Opened 5 years ago Closed 5 years ago

Support caching additional display items

Categories

(Core :: Graphics: WebRender, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: mikokm, Assigned: mikokm)

References

Details

Attachments

(3 files)

Currently WebRender only knows how to cache Rectangle display items. We should be able to trivially extend this to all display items that have 1:1 mapping with Gecko, and do not depend on surrounding state.

Depends on: 1616419

This patch changes the underlying storage for WR display items in DisplayItemCache
from Vec<Option<CachedDisplayItem> to Vec<Vec<CachedDisplayItem>>.
This allows storing multiple WebRender display items for one Gecko display item.

The storage is populated by traversing BuiltDisplayList extra data portion
in display list format, which is roughly as follows:
RetainedItems(key k1)
Item1(..)
RetainedItems(key k2)
ItemN(..)
ItemN+1(..)

This would store Item1 under key k1, and ItemN and ItemN+1 under the key k2,
where k1 and k2 are arbitrary unique identifiers (currently of type uint16_t).

The entries in the storage are accessed by DisplayItemCache::get_iterator(key),
which is called by BuiltDisplayListIter, whenever it encounters a display item
DisplayItem::ReuseItems(key).

Depends on D66442

Pushed by mikokm@gmail.com: https://hg.mozilla.org/integration/autoland/rev/10897d6106a8 Part 1: Remove item_key from CommonItemProperties r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/cc263e909c61 Part 2: Allow 1:n mapping of Gecko - WR display items r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/e79e84e8819c Part 3: Retain WR display items for nsDisplayBorder, nsDisplayText, nsDisplayButtonBorder, and nsDisplayButtonForeground r=jrmuizel
Pushed by mikokm@gmail.com: https://hg.mozilla.org/integration/autoland/rev/0e791acac783 Part 1: Remove item_key from CommonItemProperties r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/aaed31bbe8f4 Part 2: Allow 1:n mapping of Gecko - WR display items r=jrmuizel https://hg.mozilla.org/integration/autoland/rev/cac023f94cda Part 3: Retain WR display items for nsDisplayBorder, nsDisplayText, nsDisplayButtonBorder, and nsDisplayButtonForeground r=jrmuizel
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
Flags: needinfo?(mikokm)
Regressions: 1624125
Regressions: 1640457
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: