This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Display list culling prototype based on op indices #38304
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a variant of #38189 that uses indices of the ops rather than offsets into the buffer, to control which ops re rendered or culled. The description that follows is essentially the same as the other PR.
This PR creates the underpinnings for a mechanism that can be used to cull DisplayLists based on the indices of the rendering operations that are desired. The RTree that the DisplayList produces will return indices within its list of the rectangles that are involved in the operation and a simple vector of "op indices" maintained by the RTree accumulator can be used to translate into an op index with a simple vector lookup.
Note that only the indices of the rendering ops are required.
The following ops will cull themselves if they are not needed:
The following ops will not cull themselves and will always be executed. The tracking to prevent them from being executed would require a lot of overhead that is unlikely to save much time:
The culling is tested in its simplest form by the included unit test.
The performance of the overhead of this mechanism has not (yet) been measured.
There is a lot of bookkeeping cruft in this PR, mostly in the form of having to add a
count_op()
method to the DisplayListCalculator to reconstruct information that is known implicitly by the DisplayListBuilder. When the bounds and rtree calculation are merged into the Builder class via #34365, that cruft can be eliminated in favor of the Builder already knowing the indices of all of its ops.The commits for this PR start with the same commits used for the previous "buffer offset" variant and then convert to using indices partway through because I implemented this variant first as a modification to those previous code changes.