| Index: cc/picture.cc
|
| diff --git a/cc/picture.cc b/cc/picture.cc
|
| index c850fd8e3e954c7f75068a7e383c557c1dbf092b..35a935dd0264c4619aad5370886e664b6c70505b 100644
|
| --- a/cc/picture.cc
|
| +++ b/cc/picture.cc
|
| @@ -50,7 +50,7 @@ scoped_refptr<Picture> Picture::Clone() const {
|
| }
|
|
|
| void Picture::Record(ContentLayerClient* painter,
|
| - RenderingStats& stats) {
|
| + RenderingStats* stats) {
|
| TRACE_EVENT2("cc", "Picture::Record",
|
| "width", layer_rect_.width(), "height", layer_rect_.height());
|
|
|
| @@ -80,11 +80,15 @@ void Picture::Record(ContentLayerClient* painter,
|
| canvas->drawRect(layer_skrect, paint);
|
|
|
| gfx::RectF opaque_layer_rect;
|
| - base::TimeTicks beginPaintTime = base::TimeTicks::Now();
|
| + base::TimeTicks begin_paint_time;
|
| + if (stats)
|
| + begin_paint_time = base::TimeTicks::Now();
|
| painter->paintContents(canvas, layer_rect_, opaque_layer_rect);
|
| - stats.totalPaintTime += base::TimeTicks::Now() - beginPaintTime;
|
| - stats.totalPixelsPainted += layer_rect_.width() *
|
| - layer_rect_.height();
|
| + if (stats) {
|
| + stats->totalPaintTime += base::TimeTicks::Now() - begin_paint_time;
|
| + stats->totalPixelsPainted +=
|
| + layer_rect_.width() * layer_rect_.height();
|
| + }
|
|
|
| canvas->restore();
|
| picture_->endRecording();
|
|
|