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

Unified Diff: cc/resources/bitmap_skpicture_content_layer_updater.cc

Issue 13265003: cc: Switch ContentLayerUpdater to use RenderingStatsInstrumentation (Closed) Base URL: http://git.chromium.org/chromium/src.git@update
Patch Set: Added printfs Created 7 years, 9 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/bitmap_content_layer_updater.cc ('k') | cc/resources/content_layer_updater.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/bitmap_skpicture_content_layer_updater.cc
diff --git a/cc/resources/bitmap_skpicture_content_layer_updater.cc b/cc/resources/bitmap_skpicture_content_layer_updater.cc
index 1a2ebee9c9067f8e8c1a5c5f0a654cb86f7b1f02..4f30358957fb4c0c2305eebce99e9c8b4cc382bf 100644
--- a/cc/resources/bitmap_skpicture_content_layer_updater.cc
+++ b/cc/resources/bitmap_skpicture_content_layer_updater.cc
@@ -31,12 +31,8 @@ void BitmapSkPictureContentLayerUpdater::Resource::Update(
bitmap_.setIsOpaque(updater_->layer_is_opaque());
SkDevice device(bitmap_);
SkCanvas canvas(&device);
- base::TimeTicks paint_begin_time;
- if (stats)
- paint_begin_time = base::TimeTicks::Now();
+
updater_->PaintContentsRect(&canvas, source_rect, stats);
- if (stats)
- stats->total_paint_time += base::TimeTicks::Now() - paint_begin_time;
ResourceUpdate upload = ResourceUpdate::Create(
texture(), &bitmap_, source_rect, source_rect, dest_offset);
@@ -73,19 +69,27 @@ void BitmapSkPictureContentLayerUpdater::PaintContentsRect(
SkCanvas* canvas,
gfx::Rect source_rect,
RenderingStats* stats) {
+
+ printf("BitmapSkPictureContentLayerUpdater::PaintContentsRect\n");
+
// Translate the origin of content_rect to that of source_rect.
canvas->translate(content_rect().x() - source_rect.x(),
content_rect().y() - source_rect.y());
- base::TimeTicks rasterize_begin_time;
- if (stats)
- rasterize_begin_time = base::TimeTicks::Now();
+
+ base::TimeTicks start_time =
+ rendering_stats_instrumentation_->StartRecording();
+
DrawPicture(canvas);
- if (stats) {
- stats->total_rasterize_time +=
- base::TimeTicks::Now() - rasterize_begin_time;
- stats->total_pixels_rasterized +=
- source_rect.width() * source_rect.height();
- }
+
+ base::TimeDelta duration =
+ rendering_stats_instrumentation_->EndRecording(start_time);
+ rendering_stats_instrumentation_->AddRaster(
+ duration,
+ source_rect.width() * source_rect.height(),
+ false);
+
+ // TODO: Clarify if this needs to be saved here. crbug.com/223693
+ rendering_stats_instrumentation_->AddPaint(duration, 0);
}
} // namespace cc
« no previous file with comments | « cc/resources/bitmap_content_layer_updater.cc ('k') | cc/resources/content_layer_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698