Chromium Code Reviews| Index: cc/resources/bitmap_content_layer_updater.cc |
| diff --git a/cc/resources/bitmap_content_layer_updater.cc b/cc/resources/bitmap_content_layer_updater.cc |
| index 5365c4c2c5f1ad53aba5a242b2513fa65cbc0d7b..93f58073758dc1e7719f90d0efe80cd12fea0bb2 100644 |
| --- a/cc/resources/bitmap_content_layer_updater.cc |
| +++ b/cc/resources/bitmap_content_layer_updater.cc |
| @@ -4,7 +4,7 @@ |
| #include "cc/resources/bitmap_content_layer_updater.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.h" |
| @@ -23,20 +23,23 @@ BitmapContentLayerUpdater::Resource::~Resource() {} |
| void BitmapContentLayerUpdater::Resource::Update(ResourceUpdateQueue* queue, |
| gfx::Rect source_rect, |
| gfx::Vector2d dest_offset, |
| - bool partial_update, |
| - RenderingStats* stats) { |
| + bool partial_update) { |
| updater_->UpdateTexture( |
| queue, texture(), source_rect, dest_offset, partial_update); |
| } |
| scoped_refptr<BitmapContentLayerUpdater> BitmapContentLayerUpdater::Create( |
| - scoped_ptr<LayerPainter> painter) { |
| - return make_scoped_refptr(new BitmapContentLayerUpdater(painter.Pass())); |
| + scoped_ptr<LayerPainter> painter, |
| + RenderingStatsInstrumentation* stats_instrumentation) { |
| + return make_scoped_refptr( |
| + new BitmapContentLayerUpdater(painter.Pass(), stats_instrumentation)); |
| } |
| BitmapContentLayerUpdater::BitmapContentLayerUpdater( |
| - scoped_ptr<LayerPainter> painter) |
| - : ContentLayerUpdater(painter.Pass()), opaque_(false) {} |
| + scoped_ptr<LayerPainter> painter, |
| + RenderingStatsInstrumentation* stats_instrumentation) |
| + : ContentLayerUpdater(painter.Pass(), stats_instrumentation), |
| + opaque_(false) {} |
| BitmapContentLayerUpdater::~BitmapContentLayerUpdater() {} |
| @@ -51,25 +54,24 @@ void BitmapContentLayerUpdater::PrepareToUpdate( |
| gfx::Size tile_size, |
| float contents_width_scale, |
| float contents_height_scale, |
| - gfx::Rect* resulting_opaque_rect, |
| - RenderingStats* stats) { |
| + gfx::Rect* resulting_opaque_rect) { |
| if (canvas_size_ != content_rect.size()) { |
| canvas_size_ = content_rect.size(); |
| canvas_ = make_scoped_ptr(skia::CreateBitmapCanvas( |
| canvas_size_.width(), canvas_size_.height(), opaque_)); |
| } |
| - if (stats) { |
| - stats->total_pixels_rasterized += |
| - content_rect.width() * content_rect.height(); |
| - } |
| + // TODO: Clarify if this needs to be saved here. crbug.com/223693 |
|
danakj
2013/03/26 18:48:32
Oh you did this already :D
|
| + rendering_stats_instrumentation_->AddRaster( |
| + base::TimeDelta(), |
| + content_rect.width() * content_rect.height(), |
| + false); |
| PaintContents(canvas_.get(), |
| content_rect, |
| contents_width_scale, |
| contents_height_scale, |
| - resulting_opaque_rect, |
| - stats); |
| + resulting_opaque_rect); |
| } |
| void BitmapContentLayerUpdater::UpdateTexture(ResourceUpdateQueue* queue, |