| Index: cc/bitmap_skpicture_content_layer_updater.cc
|
| diff --git a/cc/bitmap_skpicture_content_layer_updater.cc b/cc/bitmap_skpicture_content_layer_updater.cc
|
| index 5c0e512c1893899d5d744cd5566b24f9490e1c7b..dab97b13224b872c5aa589cd7872dfa425166775 100644
|
| --- a/cc/bitmap_skpicture_content_layer_updater.cc
|
| +++ b/cc/bitmap_skpicture_content_layer_updater.cc
|
| @@ -20,16 +20,19 @@ BitmapSkPictureContentLayerUpdater::Resource::Resource(BitmapSkPictureContentLay
|
| {
|
| }
|
|
|
| -void BitmapSkPictureContentLayerUpdater::Resource::update(ResourceUpdateQueue& queue, const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats& stats)
|
| +void BitmapSkPictureContentLayerUpdater::Resource::update(ResourceUpdateQueue& queue, const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset, bool partialUpdate, RenderingStats* stats)
|
| {
|
| m_bitmap.setConfig(SkBitmap::kARGB_8888_Config, sourceRect.width(), sourceRect.height());
|
| m_bitmap.allocPixels();
|
| m_bitmap.setIsOpaque(m_updater->layerIsOpaque());
|
| SkDevice device(m_bitmap);
|
| SkCanvas canvas(&device);
|
| - base::TimeTicks paintBeginTime = base::TimeTicks::Now();
|
| + base::TimeTicks paintBeginTime;
|
| + if (stats)
|
| + paintBeginTime = base::TimeTicks::Now();
|
| updater()->paintContentsRect(&canvas, sourceRect, stats);
|
| - stats.totalPaintTime += base::TimeTicks::Now() - paintBeginTime;
|
| + if (stats)
|
| + stats->totalPaintTime += base::TimeTicks::Now() - paintBeginTime;
|
|
|
| ResourceUpdate upload = ResourceUpdate::Create(
|
| texture(), &m_bitmap, sourceRect, sourceRect, destOffset);
|
| @@ -58,15 +61,19 @@ scoped_ptr<LayerUpdater::Resource> BitmapSkPictureContentLayerUpdater::createRes
|
| return scoped_ptr<LayerUpdater::Resource>(new Resource(this, PrioritizedResource::create(manager)));
|
| }
|
|
|
| -void BitmapSkPictureContentLayerUpdater::paintContentsRect(SkCanvas* canvas, const gfx::Rect& sourceRect, RenderingStats& stats)
|
| +void BitmapSkPictureContentLayerUpdater::paintContentsRect(SkCanvas* canvas, const gfx::Rect& sourceRect, RenderingStats* stats)
|
| {
|
| // Translate the origin of contentRect to that of sourceRect.
|
| canvas->translate(contentRect().x() - sourceRect.x(),
|
| contentRect().y() - sourceRect.y());
|
| - base::TimeTicks rasterizeBeginTime = base::TimeTicks::Now();
|
| + base::TimeTicks rasterizeBeginTime;
|
| + if (stats)
|
| + rasterizeBeginTime = base::TimeTicks::Now();
|
| drawPicture(canvas);
|
| - stats.totalRasterizeTime += base::TimeTicks::Now() - rasterizeBeginTime;
|
| - stats.totalPixelsRasterized += sourceRect.width() * sourceRect.height();
|
| + if (stats) {
|
| + stats->totalRasterizeTime += base::TimeTicks::Now() - rasterizeBeginTime;
|
| + stats->totalPixelsRasterized += sourceRect.width() * sourceRect.height();
|
| + }
|
| }
|
|
|
| } // namespace cc
|
|
|