summaryrefslogtreecommitdiffstats
path: root/cc/debug
diff options
context:
space:
mode:
authorscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-04 23:48:21 +0000
committerscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-04 23:48:21 +0000
commit600b6e8ac2f7f755bf0a618513a1c9d303715fe9 (patch)
tree36df33b1f4903d8236f7f74d1e822081f02b47b9 /cc/debug
parentbe6dedf67bfdaf94c64e3a853e8491582905dd19 (diff)
downloadchromium_src-600b6e8ac2f7f755bf0a618513a1c9d303715fe9.zip
chromium_src-600b6e8ac2f7f755bf0a618513a1c9d303715fe9.tar.gz
chromium_src-600b6e8ac2f7f755bf0a618513a1c9d303715fe9.tar.bz2
Revert 261914 "Revert 261906 "cc: Add picture recording modes fo..."
Shouldn't have been reverted, apologies for the noise. > 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 TBR=skyostil@chromium.org Review URL: https://codereview.chromium.org/226293003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261915 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/debug')
-rw-r--r--cc/debug/picture_record_benchmark.cc4
-rw-r--r--cc/debug/rasterize_and_record_benchmark.cc47
-rw-r--r--cc/debug/rasterize_and_record_benchmark.h3
3 files changed, 35 insertions, 19 deletions
diff --git a/cc/debug/picture_record_benchmark.cc b/cc/debug/picture_record_benchmark.cc
index 220d8e7..3b372d2 100644
--- a/cc/debug/picture_record_benchmark.cc
+++ b/cc/debug/picture_record_benchmark.cc
@@ -110,8 +110,8 @@ void PictureRecordBenchmark::RunOnLayer(PictureLayer* layer) {
base::TimeTicks start = base::TimeTicks::HighResNow();
- scoped_refptr<Picture> picture =
- Picture::Create(rect, painter, tile_grid_info, false, 0);
+ scoped_refptr<Picture> picture = Picture::Create(
+ rect, painter, tile_grid_info, false, 0, Picture::RECORD_NORMALLY);
base::TimeTicks end = base::TimeTicks::HighResNow();
base::TimeDelta duration = end - start;
diff --git a/cc/debug/rasterize_and_record_benchmark.cc b/cc/debug/rasterize_and_record_benchmark.cc
index ab8d1cb..e41c968 100644
--- a/cc/debug/rasterize_and_record_benchmark.cc
+++ b/cc/debug/rasterize_and_record_benchmark.cc
@@ -6,8 +6,10 @@
#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"
@@ -22,6 +24,9 @@ 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()
@@ -61,8 +66,12 @@ void RasterizeAndRecordBenchmark::DidUpdateLayers(LayerTreeHost* host) {
DCHECK(!results_.get());
results_ = make_scoped_ptr(new base::DictionaryValue);
results_->SetInteger("pixels_recorded", record_results_.pixels_recorded);
- results_->SetDouble("record_time_ms",
- record_results_.total_best_time.InMillisecondsF());
+
+ 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());
+ }
main_thread_benchmark_done_ = true;
}
@@ -107,21 +116,27 @@ void RasterizeAndRecordBenchmark::RunOnLayer(PictureLayer* layer) {
if (visible_content_rect.IsEmpty())
return;
-
- 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;
+ 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;
}
-
- record_results_.pixels_recorded +=
- visible_content_rect.width() * visible_content_rect.height();
- record_results_.total_best_time += min_time;
}
RasterizeAndRecordBenchmark::RecordResults::RecordResults()
diff --git a/cc/debug/rasterize_and_record_benchmark.h b/cc/debug/rasterize_and_record_benchmark.h
index 2cea16a..e2942d4 100644
--- a/cc/debug/rasterize_and_record_benchmark.h
+++ b/cc/debug/rasterize_and_record_benchmark.h
@@ -12,6 +12,7 @@
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "cc/debug/micro_benchmark_controller.h"
+#include "cc/resources/picture.h"
namespace base {
class DictionaryValue;
@@ -45,7 +46,7 @@ class RasterizeAndRecordBenchmark : public MicroBenchmark {
~RecordResults();
int pixels_recorded;
- base::TimeDelta total_best_time;
+ base::TimeDelta total_best_time[Picture::RECORDING_MODE_COUNT];
};
RecordResults record_results_;