cc: Use a ListContainer for DisplayItemList to reduce allocations.
commitf15802914bd7a8f5ea8c4d7893e9c79450804714
authordanakj <danakj@chromium.org>
Thu, 7 May 2015 18:26:12 +0000 (7 11:26 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 7 May 2015 18:26:37 +0000 (7 18:26 +0000)
treea05434d37992aea271d636e15e6c7ae1c0402d28
parentc464a50a451d6405eb9dcc84889f2da3710c0f4e
cc: Use a ListContainer for DisplayItemList to reduce allocations.

Currently every DisplayItem is malloced/freed individually. Follow the
pattern used for DrawQuads instead, using ListContainer to allocate
log(n) times instead of once for each item. This replaces each
DisplayFooItem::Create(...) with a default constructor and a
DisplayFooItem::SetNew(...) that must be called on newly constructed
items before they are used.

This patch changes the time to do UpdateLayers (after making
gfx::ImageSkiaReps immutable cuz they dominate times for now) for a
single tab loading spinner from .174ms to .167ms on a linux x620,
giving a 4% reduction in frame record time. I used a mean of 3000
samples in each run to reduce noise.

R=ajuma, enne
BUG=466426

Review URL: https://codereview.chromium.org/1123983002

Cr-Commit-Position: refs/heads/master@{#328797}
35 files changed:
cc/BUILD.gn
cc/blink/web_display_item_list_impl.cc
cc/cc.gyp
cc/layers/picture_image_layer.cc
cc/layers/picture_image_layer_unittest.cc
cc/quads/list_container.cc
cc/quads/list_container.h
cc/resources/clip_display_item.cc
cc/resources/clip_display_item.h
cc/resources/clip_path_display_item.cc
cc/resources/clip_path_display_item.h
cc/resources/compositing_display_item.cc
cc/resources/compositing_display_item.h
cc/resources/display_item_list.cc
cc/resources/display_item_list.h
cc/resources/display_item_list_unittest.cc
cc/resources/display_list_recording_source.cc
cc/resources/drawing_display_item.cc
cc/resources/drawing_display_item.h
cc/resources/filter_display_item.cc
cc/resources/filter_display_item.h
cc/resources/float_clip_display_item.cc
cc/resources/float_clip_display_item.h
cc/resources/largest_display_item.cc [new file with mode: 0644]
cc/resources/largest_display_item.h [new file with mode: 0644]
cc/resources/transform_display_item.cc
cc/resources/transform_display_item.h
cc/test/fake_content_layer_client.cc
cc/test/fake_display_list_recording_source.h
ui/compositor/clip_transform_recorder.cc
ui/compositor/clip_transform_recorder.h
ui/compositor/compositing_recorder.cc
ui/compositor/paint_cache.cc
ui/compositor/paint_cache.h
ui/compositor/paint_recorder.cc