Remove display item scope
We used display item scope to distinguish display items of the same object and
display item type painted in multiple contexts (e.g. multiple layer fragments).
A scope is assigned to each context and is included in DisplayItem::Id to make
the ids of the display items unique. However, because scope ids are unstable
(that is we can't ensure the same scope ids for the same paintings) among
paintings so we had to disable display item caching for scoped display items,
so basically creating a scope has the same effect of skipping cache.
This CL removes display item scopes and replaces ScopeRecorder with
DisplayItemCacheSkipper, to avoid the complexity and cost of scopes.
Measured performance of the patch (https://ct.skia.org/chromium_perf_runs/
run 920 to 929, 6 on Linux, 2 on Android):
AVG MEDIAN
record_time -0.15% -0.10%
record_time_caching_disabled -0.46% -0.60%
record_time_construction_disabled -0.26% -0.50%
record_time_painting_disabled -0.31% -0.52%
record_time_sk_null_canvas 0.00% 0.00%
record_time_subsequence_caching_dis.. -0.12% -0.11%
viewport_picture_size (bytes) -0.30% -0.06%
Review-Url: https://codereview.chromium.org/2022563002
Cr-Commit-Position: refs/heads/master@{#396984}
12 files changed