Bug 1642629 - Reserve sorted polygon list before pushing know number of split planes into it. r=gw

Differential Revision: https://phabricator.services.mozilla.com/D80438
This commit is contained in:
Nicolas Silva 2020-06-24 12:49:51 +00:00
parent 80b62b8fcd
commit 0d9ad4dbe2

View File

@ -5864,7 +5864,9 @@ impl PicturePrimitive {
// Process the accumulated split planes and order them for rendering.
// Z axis is directed at the screen, `sort` is ascending, and we need back-to-front order.
for poly in splitter.sort(vec3(0.0, 0.0, 1.0)) {
let sorted = splitter.sort(vec3(0.0, 0.0, 1.0));
ordered.reserve(sorted.len());
for poly in sorted {
let cluster = &self.prim_list.clusters[poly.anchor.cluster_index];
let spatial_node_index = cluster.spatial_node_index;
let transform = match spatial_tree