зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1476368 - Pre-allocate primitives vector in setup_picture_caching. r=gw
--HG-- extra : source : 32aa85626f6c484dff616ec9ae78ca53ea38dec5 extra : histedit_source : 109a92a512932d686f31906c37392f5f55db18e8
This commit is contained in:
Родитель
b6c94f1ece
Коммит
859c756fae
|
@ -312,10 +312,7 @@ impl<'a> DisplayListFlattener<'a> {
|
|||
};
|
||||
|
||||
// Get the list of existing primitives in the main stacking context.
|
||||
let mut old_prim_list = mem::replace(
|
||||
primitives,
|
||||
Vec::new(),
|
||||
);
|
||||
let mut old_prim_list = primitives.take();
|
||||
|
||||
// In the simple case, there are no preceding or trailing primitives,
|
||||
// because everything is anchored to the root scroll node. Handle
|
||||
|
@ -409,6 +406,7 @@ impl<'a> DisplayListFlattener<'a> {
|
|||
|
||||
// This contains the tile caching picture, with preceding and
|
||||
// trailing primitives outside the main scroll root.
|
||||
primitives.reserve(preceding_prims.len() + trailing_prims.len() + 1);
|
||||
primitives.extend(preceding_prims);
|
||||
primitives.push(instance);
|
||||
primitives.extend(trailing_prims);
|
||||
|
|
Загрузка…
Ссылка в новой задаче