cc: Remove 3 virtual function calls per display item during record.
commitb929714ec046700f577c5ecc098767e8b74b9f77
authordanakj <danakj@chromium.org>
Mon, 11 May 2015 18:40:28 +0000 (11 11:40 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 11 May 2015 18:41:41 +0000 (11 18:41 +0000)
tree7472e574fd19b53b3bfe3d3cc1ef23eb9fbe948c
parent51e929027280b71fee09829661c8895863c16888
cc: Remove 3 virtual function calls per display item during record.

During record we compute the "is suitable for gpu raster", the "approx
operation count" and the "memory usage" for each display item. It does
this by calling a virtual function on each display item for each of
these.

Instead, store them as fields in display item, have them filled in by
the subclass when they set up their data, and just read them directly
while walking the display items in the list and summing them up.

This provides a change for a single tab spinner in the UI compositor
from 0.201342 ms to 0.181608 which is a 10% improvement in record time
(time spent in LayerTreeHost::UpdateLayers).

R=enne
BUG=466426

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

Cr-Commit-Position: refs/heads/master@{#329199}
16 files changed:
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.h
cc/resources/display_item_list.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/transform_display_item.cc
cc/resources/transform_display_item.h