Skip to content

Commit

Permalink
Auto merge of #17406 - Gankro:with_cap, r=jdm
Browse files Browse the repository at this point in the history
use DisplayListBuilder::with_capacity

DO NOT MERGE until servo/webrender#1399 has landed in Servo.

Previously webrender was reserving 1MB of space for each display list (empirically pages weighed between 100k and 10MB when I implemented this). This was problematic for gecko because they used webrender differently. This just brings Servo back to where it was.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17406)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Jul 24, 2017
2 parents 723b21b + 855b1fe commit 3629efb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/layout/webrender_helpers.rs
Expand Up @@ -223,8 +223,9 @@ impl WebRenderDisplayListConverter for DisplayList {
fn convert_to_webrender(&self, pipeline_id: PipelineId) -> DisplayListBuilder {
let traversal = DisplayListTraversal::new(self);
let webrender_pipeline_id = pipeline_id.to_webrender();
let mut builder = DisplayListBuilder::new(webrender_pipeline_id,
self.bounds().size.to_sizef());
let mut builder = DisplayListBuilder::with_capacity(webrender_pipeline_id,
self.bounds().size.to_sizef(),
1024 * 1024); // 1 MB of space

let mut current_scroll_root_id = ClipId::root_scroll_node(webrender_pipeline_id);
builder.push_clip_id(current_scroll_root_id);
Expand Down

0 comments on commit 3629efb

Please sign in to comment.