summaryrefslogtreecommitdiffstats
path: root/cc/debug/rasterize_and_record_benchmark.cc
diff options
context:
space:
mode:
authorscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-04 23:42:56 +0000
committerscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-04 23:42:56 +0000
commitbe6dedf67bfdaf94c64e3a853e8491582905dd19 (patch)
treecccc95d45169effea10a2e8b84237200771b9da9 /cc/debug/rasterize_and_record_benchmark.cc
parentd3ba08d9ead26a59ae5503ca7f175c5a6046f2cc (diff)
downloadchromium_src-be6dedf67bfdaf94c64e3a853e8491582905dd19.zip
chromium_src-be6dedf67bfdaf94c64e3a853e8491582905dd19.tar.gz
chromium_src-be6dedf67bfdaf94c64e3a853e8491582905dd19.tar.bz2
Revert 261906 "cc: Add picture recording modes for benchmarking"
Suspected of causing gcm_unit_tests failures http://build.chromium.org/p/chromium.mac/buildstatus?builder=Mac10.7%20Tests%20%282%29&number=25118 Will file a bug that gcm_unit_tests isn't in default tryjob set if this is actually the cause. > 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 TBR=skyostil@chromium.org Review URL: https://codereview.chromium.org/226083007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261914 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/debug/rasterize_and_record_benchmark.cc')
-rw-r--r--cc/debug/rasterize_and_record_benchmark.cc47
1 files changed, 16 insertions, 31 deletions
diff --git a/cc/debug/rasterize_and_record_benchmark.cc b/cc/debug/rasterize_and_record_benchmark.cc
index e41c968..ab8d1cb 100644
--- a/cc/debug/rasterize_and_record_benchmark.cc
+++ b/cc/debug/rasterize_and_record_benchmark.cc
@@ -6,10 +6,8 @@
#include <algorithm>
#include <limits>
-#include <string>
#include "base/basictypes.h"
-#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "cc/debug/rasterize_and_record_benchmark_impl.h"
#include "cc/layers/layer.h"
@@ -24,9 +22,6 @@ namespace {
const int kDefaultRecordRepeatCount = 100;
-const char* kModeSuffixes[Picture::RECORDING_MODE_COUNT] = {
- "", "_sk_null_canvas", "_painting_disabled"};
-
base::TimeTicks Now() {
return base::TimeTicks::IsThreadNowSupported()
? base::TimeTicks::ThreadNow()
@@ -66,12 +61,8 @@ void RasterizeAndRecordBenchmark::DidUpdateLayers(LayerTreeHost* host) {
DCHECK(!results_.get());
results_ = make_scoped_ptr(new base::DictionaryValue);
results_->SetInteger("pixels_recorded", record_results_.pixels_recorded);
-
- for (int i = 0; i < Picture::RECORDING_MODE_COUNT; i++) {
- std::string name = base::StringPrintf("record_time%s_ms", kModeSuffixes[i]);
- results_->SetDouble(name,
- record_results_.total_best_time[i].InMillisecondsF());
- }
+ results_->SetDouble("record_time_ms",
+ record_results_.total_best_time.InMillisecondsF());
main_thread_benchmark_done_ = true;
}
@@ -116,27 +107,21 @@ void RasterizeAndRecordBenchmark::RunOnLayer(PictureLayer* layer) {
if (visible_content_rect.IsEmpty())
return;
- for (int mode_index = 0; mode_index < Picture::RECORDING_MODE_COUNT;
- mode_index++) {
- Picture::RecordingMode mode =
- static_cast<Picture::RecordingMode>(mode_index);
- base::TimeDelta min_time = base::TimeDelta::Max();
- for (int i = 0; i < record_repeat_count_; ++i) {
- base::TimeTicks start = Now();
- scoped_refptr<Picture> picture = Picture::Create(
- visible_content_rect, painter, tile_grid_info, false, 0, mode);
- base::TimeTicks end = Now();
- base::TimeDelta duration = end - start;
- if (duration < min_time)
- min_time = duration;
- }
-
- if (mode == Picture::RECORD_NORMALLY) {
- record_results_.pixels_recorded +=
- visible_content_rect.width() * visible_content_rect.height();
- }
- record_results_.total_best_time[mode_index] += min_time;
+
+ base::TimeDelta min_time = base::TimeDelta::Max();
+ for (int i = 0; i < record_repeat_count_; ++i) {
+ base::TimeTicks start = Now();
+ scoped_refptr<Picture> picture = Picture::Create(
+ visible_content_rect, painter, tile_grid_info, false, 0);
+ base::TimeTicks end = Now();
+ base::TimeDelta duration = end - start;
+ if (duration < min_time)
+ min_time = duration;
}
+
+ record_results_.pixels_recorded +=
+ visible_content_rect.width() * visible_content_rect.height();
+ record_results_.total_best_time += min_time;
}
RasterizeAndRecordBenchmark::RecordResults::RecordResults()