diff options
Diffstat (limited to 'cc/resources/bitmap_content_layer_updater.cc')
-rw-r--r-- | cc/resources/bitmap_content_layer_updater.cc | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/cc/resources/bitmap_content_layer_updater.cc b/cc/resources/bitmap_content_layer_updater.cc index 93f5807..5365c4c 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_instrumentation.h" +#include "cc/debug/rendering_stats.h" #include "cc/resources/layer_painter.h" #include "cc/resources/prioritized_resource.h" #include "cc/resources/resource_update.h" @@ -23,23 +23,20 @@ BitmapContentLayerUpdater::Resource::~Resource() {} void BitmapContentLayerUpdater::Resource::Update(ResourceUpdateQueue* queue, gfx::Rect source_rect, gfx::Vector2d dest_offset, - bool partial_update) { + bool partial_update, + RenderingStats* stats) { updater_->UpdateTexture( queue, texture(), source_rect, dest_offset, partial_update); } scoped_refptr<BitmapContentLayerUpdater> BitmapContentLayerUpdater::Create( - scoped_ptr<LayerPainter> painter, - RenderingStatsInstrumentation* stats_instrumentation) { - return make_scoped_refptr( - new BitmapContentLayerUpdater(painter.Pass(), stats_instrumentation)); + scoped_ptr<LayerPainter> painter) { + return make_scoped_refptr(new BitmapContentLayerUpdater(painter.Pass())); } BitmapContentLayerUpdater::BitmapContentLayerUpdater( - scoped_ptr<LayerPainter> painter, - RenderingStatsInstrumentation* stats_instrumentation) - : ContentLayerUpdater(painter.Pass(), stats_instrumentation), - opaque_(false) {} + scoped_ptr<LayerPainter> painter) + : ContentLayerUpdater(painter.Pass()), opaque_(false) {} BitmapContentLayerUpdater::~BitmapContentLayerUpdater() {} @@ -54,24 +51,25 @@ void BitmapContentLayerUpdater::PrepareToUpdate( gfx::Size tile_size, float contents_width_scale, float contents_height_scale, - gfx::Rect* resulting_opaque_rect) { + gfx::Rect* resulting_opaque_rect, + RenderingStats* stats) { if (canvas_size_ != content_rect.size()) { canvas_size_ = content_rect.size(); canvas_ = make_scoped_ptr(skia::CreateBitmapCanvas( canvas_size_.width(), canvas_size_.height(), opaque_)); } - // TODO: Clarify if this needs to be saved here. crbug.com/223693 - rendering_stats_instrumentation_->AddRaster( - base::TimeDelta(), - content_rect.width() * content_rect.height(), - false); + if (stats) { + stats->total_pixels_rasterized += + content_rect.width() * content_rect.height(); + } PaintContents(canvas_.get(), content_rect, contents_width_scale, contents_height_scale, - resulting_opaque_rect); + resulting_opaque_rect, + stats); } void BitmapContentLayerUpdater::UpdateTexture(ResourceUpdateQueue* queue, |