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

Unified Diff: cc/resources/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_skpicture_content_layer_updater.cc ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/content_layer_updater.cc
diff --git a/cc/resources/content_layer_updater.cc b/cc/resources/content_layer_updater.cc
index 0651e87f9ddb2d55add54ab45bbb35436576a620..b96881b4502731022e326ce1664933763ab4ec61 100644
--- a/cc/resources/content_layer_updater.cc
+++ b/cc/resources/content_layer_updater.cc
@@ -32,6 +32,9 @@ void ContentLayerUpdater::PaintContents(SkCanvas* canvas,
gfx::Rect* resulting_opaque_rect,
RenderingStats* stats) {
TRACE_EVENT0("cc", "ContentLayerUpdater::PaintContents");
+
+ printf("ContentLayerUpdater::PaintContents\n");
+
canvas->save();
canvas->translate(SkFloatToScalar(-content_rect.x()),
SkFloatToScalar(-content_rect.y()));
@@ -56,14 +59,18 @@ void ContentLayerUpdater::PaintContents(SkCanvas* canvas,
canvas->clipRect(layer_sk_rect);
gfx::RectF opaque_layer_rect;
- base::TimeTicks paint_begin_time;
- if (stats)
- paint_begin_time = base::TimeTicks::Now();
+
+ base::TimeTicks start_time =
+ rendering_stats_instrumentation_->StartRecording();
+
painter_->Paint(canvas, layer_rect, &opaque_layer_rect);
- if (stats) {
- stats->total_paint_time += base::TimeTicks::Now() - paint_begin_time;
- stats->total_pixels_painted += content_rect.width() * content_rect.height();
- }
+
+ base::TimeDelta duration =
+ rendering_stats_instrumentation_->EndRecording(start_time);
+ rendering_stats_instrumentation_->AddPaint(
+ duration,
+ content_rect.width() * content_rect.height());
+
canvas->restore();
gfx::RectF opaque_content_rect = gfx::ScaleRect(
« no previous file with comments | « cc/resources/bitmap_skpicture_content_layer_updater.cc ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698