[go: nahoru, domu]

Comment and clean up code for marking layers to PushPropertiesTo.

The LayersThatShouldPushProperties() returned a non-const reference but
did not need to, changed to const.

The LayerNeedsPushPropertiesForTesting() method is not needed since
tests can just check base::ContainsKey() against the already existing
LayersThatShouldPushProperties().

The PushLayerPropertiesInternal() function was making a copy of the
set of layers, because layers were removing them from the set,
changed to take a const-ref as the layers are cleared afterward.
Clarified variables inside the method for readability.

PictureLayerImpls always PushPropertiesTo. Instead of causing them to
mutate the set to reinsert themselves each frame (and preventing us from
just clear()ing the set after pushing), walk all PictureLayerImpls
separately from the set of layers that need PushPropertiesTo, and
which should be removed from the set after pushing.

Changed the set of layers from a std::unordered_set to a
base::flat_set now that we have a better data type for describing sets
of small numbers of small objects. In this case "large" sets are only
~100 and the objects are pointer-sized.

TODO: We could still improve performance by batching inserts to the set.

R=enne@chromium.org

Bug: 854256
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I9411aa99016b806e585ee9e89ac19c4832f586d2
Reviewed-on: https://chromium-review.googlesource.com/1208356
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: enne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590888}
15 files changed