Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3762)

Unified Diff: cc/resources/picture_pile_impl.cc

Issue 26031002: cc: Remove unused metrics from RenderingStats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed raster_worker_pool_perftest.cc Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/picture_pile_impl.h ('k') | cc/resources/picture_pile_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_pile_impl.cc
diff --git a/cc/resources/picture_pile_impl.cc b/cc/resources/picture_pile_impl.cc
index 3a4020e072bbf5b9b13187ab9910d8a19da1ed8d..8f98350abd9e3d753994db63a3a567af985a3044 100644
--- a/cc/resources/picture_pile_impl.cc
+++ b/cc/resources/picture_pile_impl.cc
@@ -73,8 +73,12 @@ void PicturePileImpl::RasterDirect(
SkCanvas* canvas,
gfx::Rect canvas_rect,
float contents_scale,
- RasterStats* raster_stats) {
- RasterCommon(canvas, NULL, canvas_rect, contents_scale, raster_stats);
+ RenderingStatsInstrumentation* rendering_stats_instrumentation) {
+ RasterCommon(canvas,
+ NULL,
+ canvas_rect,
+ contents_scale,
+ rendering_stats_instrumentation);
}
void PicturePileImpl::RasterForAnalysis(
@@ -88,7 +92,7 @@ void PicturePileImpl::RasterToBitmap(
SkCanvas* canvas,
gfx::Rect canvas_rect,
float contents_scale,
- RasterStats* raster_stats) {
+ RenderingStatsInstrumentation* rendering_stats_instrumentation) {
#ifndef NDEBUG
// Any non-painted areas will be left in this color.
canvas->clear(DebugColors::NonPaintedFillColor());
@@ -132,7 +136,11 @@ void PicturePileImpl::RasterToBitmap(
}
}
- RasterCommon(canvas, NULL, canvas_rect, contents_scale, raster_stats);
+ RasterCommon(canvas,
+ NULL,
+ canvas_rect,
+ contents_scale,
+ rendering_stats_instrumentation);
}
void PicturePileImpl::RasterCommon(
@@ -140,7 +148,7 @@ void PicturePileImpl::RasterCommon(
SkDrawPictureCallback* callback,
gfx::Rect canvas_rect,
float contents_scale,
- RasterStats* raster_stats) {
+ RenderingStatsInstrumentation* rendering_stats_instrumentation) {
DCHECK(contents_scale >= min_contents_scale_);
canvas->translate(-canvas_rect.x(), -canvas_rect.y());
@@ -159,12 +167,6 @@ void PicturePileImpl::RasterCommon(
SkRegion::kIntersect_Op);
Region unclipped(content_rect);
- if (raster_stats) {
- raster_stats->total_pixels_rasterized = 0;
- raster_stats->total_rasterize_time = base::TimeDelta::FromSeconds(0);
- raster_stats->best_rasterize_time = base::TimeDelta::FromSeconds(0);
- }
-
for (TilingData::Iterator tile_iter(&tiling_, layer_rect);
tile_iter; ++tile_iter) {
PictureListMap::iterator map_iter =
@@ -196,8 +198,6 @@ void PicturePileImpl::RasterCommon(
if (!unclipped.Intersects(content_clip))
continue;
- base::TimeDelta total_duration =
- base::TimeDelta::FromInternalValue(0);
base::TimeDelta best_duration =
base::TimeDelta::FromInternalValue(std::numeric_limits<int64>::max());
int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_);
@@ -206,23 +206,20 @@ void PicturePileImpl::RasterCommon(
benchmark_instrumentation::kRasterLoop);
for (int j = 0; j < repeat_count; ++j) {
base::TimeTicks start_time;
- if (raster_stats)
- start_time = base::TimeTicks::HighResNow();
-
+ if (rendering_stats_instrumentation)
+ start_time = rendering_stats_instrumentation->StartRecording();
(*i)->Raster(canvas, callback, content_clip, contents_scale);
-
- if (raster_stats) {
- base::TimeDelta duration = base::TimeTicks::HighResNow() - start_time;
- total_duration += duration;
+ if (rendering_stats_instrumentation) {
+ base::TimeDelta duration =
+ rendering_stats_instrumentation->EndRecording(start_time);
best_duration = std::min(best_duration, duration);
}
}
-
- if (raster_stats) {
- raster_stats->total_pixels_rasterized +=
+ if (rendering_stats_instrumentation) {
+ int64 rasterized_pixel_count =
repeat_count * content_clip.width() * content_clip.height();
- raster_stats->total_rasterize_time += total_duration;
- raster_stats->best_rasterize_time += best_duration;
+ rendering_stats_instrumentation->AddRaster(best_duration,
+ rasterized_pixel_count);
}
if (show_debug_picture_borders_) {
« no previous file with comments | « cc/resources/picture_pile_impl.h ('k') | cc/resources/picture_pile_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698