| Index: cc/picture.cc
|
| diff --git a/cc/picture.cc b/cc/picture.cc
|
| index 50eefd867096b0a492e579052da5dbc14028d5b2..b7445e62f68774b9e29914608a870beba504a76b 100644
|
| --- a/cc/picture.cc
|
| +++ b/cc/picture.cc
|
| @@ -18,7 +18,8 @@ scoped_refptr<Picture> Picture::Create() {
|
| Picture::Picture() {
|
| }
|
|
|
| -Picture::Picture(SkPicture* picture, gfx::Rect layer_rect,
|
| +Picture::Picture(const skia::RefPtr<SkPicture>& picture,
|
| + gfx::Rect layer_rect,
|
| gfx::Rect opaque_rect) :
|
| layer_rect_(layer_rect),
|
| opaque_rect_(opaque_rect),
|
| @@ -31,8 +32,8 @@ Picture::~Picture() {
|
| scoped_refptr<Picture> Picture::Clone() {
|
| // SkPicture is not thread-safe to rasterize with, so return a thread-safe
|
| // clone of it.
|
| - DCHECK(picture_.get());
|
| - SkPicture* clone = picture_->clone();
|
| + DCHECK(picture_);
|
| + skia::RefPtr<SkPicture> clone = skia::AdoptRef(picture_->clone());
|
| return make_scoped_refptr(new Picture(clone, layer_rect_, opaque_rect_));
|
| }
|
|
|
| @@ -41,8 +42,8 @@ void Picture::Record(ContentLayerClient* painter, gfx::Rect layer_rect,
|
| TRACE_EVENT0("cc", "Picture::Record");
|
|
|
| // Record() should only be called once.
|
| - DCHECK(!picture_.get());
|
| - picture_.reset(new SkPicture);
|
| + DCHECK(!picture_);
|
| + picture_ = skia::AdoptRef(new SkPicture);
|
|
|
| SkCanvas* canvas = picture_->beginRecording(
|
| layer_rect.width(),
|
| @@ -80,7 +81,7 @@ void Picture::Record(ContentLayerClient* painter, gfx::Rect layer_rect,
|
|
|
| void Picture::Raster(SkCanvas* canvas) {
|
| TRACE_EVENT0("cc", "Picture::Raster");
|
| - DCHECK(picture_.get());
|
| + DCHECK(picture_);
|
| canvas->save();
|
| canvas->translate(layer_rect_.x(), layer_rect_.y());
|
| canvas->drawPicture(*picture_);
|
|
|