summaryrefslogtreecommitdiffstats
path: root/cc/debug
diff options
context:
space:
mode:
authorenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-13 08:20:16 +0000
committerenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-13 08:20:16 +0000
commit8b6cea09a979ffb5e9d625cc2b3a4587c1929a32 (patch)
treec7afb93aa45f3cc6691660ab17f7a9496dc87e2c /cc/debug
parentc27fdee9d2b32a33ce6f323a5d0ef4f28f5f7792 (diff)
downloadchromium_src-8b6cea09a979ffb5e9d625cc2b3a4587c1929a32.zip
chromium_src-8b6cea09a979ffb5e9d625cc2b3a4587c1929a32.tar.gz
chromium_src-8b6cea09a979ffb5e9d625cc2b3a4587c1929a32.tar.bz2
cc: Include analysis in raster benchmark costs
Insert analysis costs into the raster benchmark. This will make it possible to combine analysis and raster into a single step and be confident that it will not regress the total costs of rastering a tile. ATTN perf sheriffs: this will regress benchmarks because it is doing more work, but it is a more accurate representation of the work that gets done per unit of raster work. This should be treated as a "perf rebaseline" and not as a regression. R=vmpstr@chromium.org BUG=none Review URL: https://codereview.chromium.org/74713006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240540 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/debug')
-rw-r--r--cc/debug/rasterize_and_record_benchmark_impl.cc3
-rw-r--r--cc/debug/rendering_stats.cc6
-rw-r--r--cc/debug/rendering_stats.h1
-rw-r--r--cc/debug/rendering_stats_instrumentation.cc9
-rw-r--r--cc/debug/rendering_stats_instrumentation.h1
5 files changed, 19 insertions, 1 deletions
diff --git a/cc/debug/rasterize_and_record_benchmark_impl.cc b/cc/debug/rasterize_and_record_benchmark_impl.cc
index ecf2688..f2904a3 100644
--- a/cc/debug/rasterize_and_record_benchmark_impl.cc
+++ b/cc/debug/rasterize_and_record_benchmark_impl.cc
@@ -94,8 +94,11 @@ void RasterizeAndRecordBenchmarkImpl::RunOnLayer(PictureLayerImpl* layer) {
SkBitmapDevice device(bitmap);
SkCanvas canvas(&device);
+ PicturePileImpl::Analysis analysis;
base::TimeTicks start = Now();
+ picture_pile->AnalyzeInRect(
+ content_rect, contents_scale, &analysis, NULL);
picture_pile->RasterToBitmap(&canvas, content_rect, contents_scale, NULL);
base::TimeTicks end = Now();
base::TimeDelta duration = end - start;
diff --git a/cc/debug/rendering_stats.cc b/cc/debug/rendering_stats.cc
index 16bf091..abce5ae 100644
--- a/cc/debug/rendering_stats.cc
+++ b/cc/debug/rendering_stats.cc
@@ -47,6 +47,7 @@ ImplThreadRenderingStats::AsTraceableData() const {
void ImplThreadRenderingStats::Add(const ImplThreadRenderingStats& other) {
frame_count += other.frame_count;
rasterize_time += other.rasterize_time;
+ analysis_time += other.analysis_time;
rasterized_pixel_count += other.rasterized_pixel_count;
}
@@ -61,8 +62,11 @@ void RenderingStats::EnumerateFields(Enumerator* enumerator) const {
main_stats.record_time.InSecondsF());
enumerator->AddInt64("recordedPixelCount",
main_stats.recorded_pixel_count);
+ // Combine rasterization and analysis time as a precursor to combining
+ // them in the same step internally.
enumerator->AddDouble("rasterizeTime",
- impl_stats.rasterize_time.InSecondsF());
+ impl_stats.rasterize_time.InSecondsF() +
+ impl_stats.analysis_time.InSecondsF());
enumerator->AddInt64("rasterizedPixelCount",
impl_stats.rasterized_pixel_count);
}
diff --git a/cc/debug/rendering_stats.h b/cc/debug/rendering_stats.h
index ff1dbef..d28f110 100644
--- a/cc/debug/rendering_stats.h
+++ b/cc/debug/rendering_stats.h
@@ -49,6 +49,7 @@ struct CC_EXPORT ImplThreadRenderingStats {
int64 frame_count;
base::TimeDelta rasterize_time;
+ base::TimeDelta analysis_time;
int64 rasterized_pixel_count;
ImplThreadRenderingStats();
diff --git a/cc/debug/rendering_stats_instrumentation.cc b/cc/debug/rendering_stats_instrumentation.cc
index 3987b7e..63840a3 100644
--- a/cc/debug/rendering_stats_instrumentation.cc
+++ b/cc/debug/rendering_stats_instrumentation.cc
@@ -99,4 +99,13 @@ void RenderingStatsInstrumentation::AddRaster(base::TimeDelta duration,
impl_stats_.rasterized_pixel_count += pixels;
}
+void RenderingStatsInstrumentation::AddAnalysis(base::TimeDelta duration,
+ int64 pixels) {
+ if (!record_rendering_stats_)
+ return;
+
+ base::AutoLock scoped_lock(lock_);
+ impl_stats_.analysis_time += duration;
+}
+
} // namespace cc
diff --git a/cc/debug/rendering_stats_instrumentation.h b/cc/debug/rendering_stats_instrumentation.h
index 4508600..6811755 100644
--- a/cc/debug/rendering_stats_instrumentation.h
+++ b/cc/debug/rendering_stats_instrumentation.h
@@ -52,6 +52,7 @@ class CC_EXPORT RenderingStatsInstrumentation {
void AddPaint(base::TimeDelta duration, int64 pixels);
void AddRecord(base::TimeDelta duration, int64 pixels);
void AddRaster(base::TimeDelta duration, int64 pixels);
+ void AddAnalysis(base::TimeDelta duration, int64 pixels);
protected:
RenderingStatsInstrumentation();