Closed Bug 1729241 Opened 3 years ago Closed 3 years ago

Refactor spatial tree accessors and update

Categories

(Core :: Graphics: WebRender, task)

task

Tracking

()

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- affected

People

(Reporter: gw, Assigned: gw)

Details

Attachments

(3 files)

No description provided.

In future, spatial tree nodes will not be stored in a flat
vec array. Instead, they'll be retained based on their unique
key. To prepare for this, refactor the spatial tree so that
all access to nodes is done via an accessor, and the tree
update no longer relies on split_mut.

Assignee: nobody → gwatson
Status: NEW → ASSIGNED

Previously, the GPU transform palette always stored the local ->
world transform for each spatial node with O(1) access time.

This won't be feasible in future when spatial nodes are retained
and stored with opaque handles.

Although this was previously a small optimization, it's no longer
important. With picture caching and raster roots, querying the
local -> world transform should be relatively rare (and even rarer
once all surfaces establish raster roots).

We still retain the optimization that querying an identity transform
(where the from == to spatial node) avoids a hash lookup and always
resolves to the first transform in the palette, since this is quite
common.

Since spatial node indices will become opaque handles in future,
remove the last part of code outside spatial_tree that relies
on the index. In this case, switch the hit-testing code to use
the spatial node indices as a hash key. This is unlikely to have
any noticeable performance impact since hit-tests are relatively
rare, and generally only access a small number of spatial nodes.

Pushed by gwatson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a90fa338971b
Pt 1 - Refactor spatial tree accessors and update r=gfx-reviewers,kvark
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
Status: RESOLVED → REOPENED
Keywords: leave-open
Resolution: FIXED → ---
Pushed by gwatson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/aae10c334f6d
Pt 2 - Refactor spatial tree accessors and update r=gfx-reviewers,kvark
https://hg.mozilla.org/integration/autoland/rev/c3ddc8726b7b
Pt 3 - Make spatial node indices an opaque type r=gfx-reviewers,kvark
Status: REOPENED → RESOLVED
Closed: 3 years ago3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: