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 7d11e34ef2e741e5e9356ff15d57c2a70c8697eb..96fe71d12a1a4b502e18091a97680c6d105f54a3 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,23 @@ 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->totalPixelsRasterized += |
| - content_rect.width() * content_rect.height(); |
| - } |
| + rendering_stats_instrumentation_->AddRaster( |
| + base::TimeDelta(), |
|
egraether
2013/03/23 00:15:40
No rasterize time saved here, should we change tha
danakj
2013/03/23 01:56:32
It will be equal to the paint time, and I think th
egraether
2013/03/25 21:07:44
Had a chat with hartmanng, he was not sure what's
danakj
2013/03/26 18:47:50
Ok, can you add a TODO that points to the crbug in
|
| + 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, |