| 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 e721891568c0b34e29660acb6f2f9946da8b70aa..455d7c9058fa0672c2bd27aa9a9c68b71b7538c7 100644
|
| --- a/cc/resources/bitmap_skpicture_content_layer_updater.cc
|
| +++ b/cc/resources/bitmap_skpicture_content_layer_updater.cc
|
| @@ -5,7 +5,7 @@
|
| #include "cc/resources/bitmap_skpicture_content_layer_updater.h"
|
|
|
| #include "base/time.h"
|
| -#include "cc/debug/rendering_stats.h"
|
| +#include "cc/debug/rendering_stats_instrumentation.h"
|
| #include "cc/resources/layer_painter.h"
|
| #include "cc/resources/prioritized_resource.h"
|
| #include "cc/resources/resource_update_queue.h"
|
| @@ -23,20 +23,15 @@ void BitmapSkPictureContentLayerUpdater::Resource::Update(
|
| ResourceUpdateQueue* queue,
|
| gfx::Rect source_rect,
|
| gfx::Vector2d dest_offset,
|
| - bool partial_update,
|
| - RenderingStats* stats) {
|
| + bool partial_update) {
|
| bitmap_.setConfig(
|
| SkBitmap::kARGB_8888_Config, source_rect.width(), source_rect.height());
|
| bitmap_.allocPixels();
|
| 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;
|
| +
|
| + updater_->PaintContentsRect(&canvas, source_rect);
|
|
|
| ResourceUpdate upload = ResourceUpdate::Create(
|
| texture(), &bitmap_, source_rect, source_rect, dest_offset);
|
| @@ -47,14 +42,18 @@ void BitmapSkPictureContentLayerUpdater::Resource::Update(
|
| }
|
|
|
| scoped_refptr<BitmapSkPictureContentLayerUpdater>
|
| -BitmapSkPictureContentLayerUpdater::Create(scoped_ptr<LayerPainter> painter) {
|
| +BitmapSkPictureContentLayerUpdater::Create(
|
| + scoped_ptr<LayerPainter> painter,
|
| + RenderingStatsInstrumentation* stats_instrumentation) {
|
| return make_scoped_refptr(
|
| - new BitmapSkPictureContentLayerUpdater(painter.Pass()));
|
| + new BitmapSkPictureContentLayerUpdater(painter.Pass(),
|
| + stats_instrumentation));
|
| }
|
|
|
| BitmapSkPictureContentLayerUpdater::BitmapSkPictureContentLayerUpdater(
|
| - scoped_ptr<LayerPainter> painter)
|
| - : SkPictureContentLayerUpdater(painter.Pass()) {}
|
| + scoped_ptr<LayerPainter> painter,
|
| + RenderingStatsInstrumentation* stats_instrumentation)
|
| + : SkPictureContentLayerUpdater(painter.Pass(), stats_instrumentation) {}
|
|
|
| BitmapSkPictureContentLayerUpdater::~BitmapSkPictureContentLayerUpdater() {}
|
|
|
| @@ -67,21 +66,25 @@ BitmapSkPictureContentLayerUpdater::CreateResource(
|
|
|
| void BitmapSkPictureContentLayerUpdater::PaintContentsRect(
|
| SkCanvas* canvas,
|
| - gfx::Rect source_rect,
|
| - RenderingStats* stats) {
|
| + gfx::Rect source_rect) {
|
| // 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
|
|
|