Index: cc/resources/picture.cc |
diff --git a/cc/resources/picture.cc b/cc/resources/picture.cc |
index a34323757e3a8f738ef3f56151847f1dd817e387..5cfe94be9cd78c64499eaf2f620f766e74235315 100644 |
--- a/cc/resources/picture.cc |
+++ b/cc/resources/picture.cc |
@@ -3,7 +3,7 @@ |
// found in the LICENSE file. |
#include "base/debug/trace_event.h" |
-#include "cc/debug/rendering_stats.h" |
+#include "cc/debug/rendering_stats_instrumentation.h" |
#include "cc/layers/content_layer_client.h" |
#include "cc/resources/picture.h" |
#include "skia/ext/analysis_canvas.h" |
@@ -65,7 +65,7 @@ void Picture::CloneForDrawing(int num_threads) { |
} |
void Picture::Record(ContentLayerClient* painter, |
- RenderingStats* stats, |
+ RenderingStatsInstrumentation* stats_instrumentation, |
const SkTileGridPicture::TileGridInfo& tileGridInfo) { |
TRACE_EVENT2("cc", "Picture::Record", |
"width", layer_rect_.width(), "height", layer_rect_.height()); |
@@ -97,15 +97,13 @@ void Picture::Record(ContentLayerClient* painter, |
canvas->drawRect(layer_skrect, paint); |
gfx::RectF opaque_layer_rect; |
- base::TimeTicks begin_paint_time; |
- if (stats) |
- begin_paint_time = base::TimeTicks::Now(); |
+ base::TimeTicks start_time = stats_instrumentation->StartRecording(); |
+ |
painter->PaintContents(canvas, layer_rect_, &opaque_layer_rect); |
- if (stats) { |
- stats->totalPaintTime += base::TimeTicks::Now() - begin_paint_time; |
- stats->totalPixelsPainted += |
- layer_rect_.width() * layer_rect_.height(); |
- } |
+ |
+ base::TimeDelta duration = stats_instrumentation->EndRecording(start_time); |
+ stats_instrumentation->AddPaint(duration, |
+ layer_rect_.width() * layer_rect_.height()); |
canvas->restore(); |
picture_->endRecording(); |