cc: Add picture recording modes for benchmarking
commit5a77e28ed4ce59a0448dd8f17d8eca161f00596b
authorskyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 4 Apr 2014 22:43:06 +0000 (4 22:43 +0000)
committerskyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 4 Apr 2014 22:43:06 +0000 (4 22:43 +0000)
tree18cd46302bef214236db3836c62523edd9ed81e0
parenta77a6dd5ea17055bdc5cc6d55f64f7c07e31efc8
cc: Add picture recording modes for benchmarking

This patch adds three different picture recording modes for benchmarking
purposes:

1. RECORD_NORMALLY. This is the default and produces a normal recording
   as before.

2. RECORD_WITH_NULL_CANVAS. This mode uses SkNullCanvas to avoid (most
   of) the Skia processing that happen during recording. Can be used to
   estimate the recording workload inside Blink.

3. RECORD_WITH_PAINTING_DISABLED. Passes a NULL canvas to Blink, which
   causes the GraphicsContext object to disable painting. This mode
   gives an estimate of the recording workload of Blink excluding the
   processing inside GraphicsContext.

This patch also modifies the rasterize_and_record_micro benchmark to
report the recording time for each mode (record_time_ms,
record_time_null_canvas_ms and record_time_painting_disabled_ms
respectively).

Anecdotally on a z600 and the key_silk_cases page set, SkNullCanvas cuts
recording time to 50% and disabling painting down to 19%.

BUG=357572
TEST=PictureTest.RecordingModes
TEST=tools/perf/run_benchmark rasterize_and_record_micro.key_silk_cases --browser=release

Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=261543

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261906 0039d316-1c4b-4281-b951-d872f2087c98
15 files changed:
cc/debug/picture_record_benchmark.cc
cc/debug/rasterize_and_record_benchmark.cc
cc/debug/rasterize_and_record_benchmark.h
cc/layers/picture_image_layer.cc
cc/resources/bitmap_skpicture_content_layer_updater.cc
cc/resources/content_layer_updater.cc
cc/resources/picture.cc
cc/resources/picture.h
cc/resources/picture_pile.cc
cc/resources/picture_unittest.cc
cc/test/fake_content_layer_client.cc
cc/test/fake_content_layer_client.h
cc/test/fake_picture_pile_impl.cc
cc/test/solid_color_content_layer_client.cc
tools/perf/measurements/rasterize_and_record_micro.py