diff options
Diffstat (limited to 'cc/debug')
-rw-r--r-- | cc/debug/picture_record_benchmark.cc | 4 | ||||
-rw-r--r-- | cc/debug/rasterize_and_record_benchmark.cc | 47 | ||||
-rw-r--r-- | cc/debug/rasterize_and_record_benchmark.h | 3 |
3 files changed, 19 insertions, 35 deletions
diff --git a/cc/debug/picture_record_benchmark.cc b/cc/debug/picture_record_benchmark.cc index 3b372d2..220d8e7 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, Picture::RECORD_NORMALLY); + scoped_refptr<Picture> picture = + Picture::Create(rect, painter, tile_grid_info, false, 0); 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 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() diff --git a/cc/debug/rasterize_and_record_benchmark.h b/cc/debug/rasterize_and_record_benchmark.h index e2942d4..2cea16a 100644 --- a/cc/debug/rasterize_and_record_benchmark.h +++ b/cc/debug/rasterize_and_record_benchmark.h @@ -12,7 +12,6 @@ #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; @@ -46,7 +45,7 @@ class RasterizeAndRecordBenchmark : public MicroBenchmark { ~RecordResults(); int pixels_recorded; - base::TimeDelta total_best_time[Picture::RECORDING_MODE_COUNT]; + base::TimeDelta total_best_time; }; RecordResults record_results_; |