| 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
|
|
|