Chromium Code Reviews| Index: ui/gfx/scoped_canvas.h |
| diff --git a/ui/gfx/scoped_canvas.h b/ui/gfx/scoped_canvas.h |
| index 96ccaffa25d3a28c1f6d4b0295b5224afeeed224..aa2d9830f447989d6f81c9c7ed9ce5d3a0048d0c 100644 |
| --- a/ui/gfx/scoped_canvas.h |
| +++ b/ui/gfx/scoped_canvas.h |
| @@ -23,6 +23,17 @@ class GFX_EXPORT ScopedCanvas { |
| canvas_->Restore(); |
| } |
| + ScopedCanvas(ScopedCanvas&& o) { |
| + canvas_ = o.canvas_; |
| + o.canvas_ = nullptr; |
| + } |
| + ScopedCanvas& operator=(ScopedCanvas&& o) { |
| + if (canvas_) |
| + canvas_->Restore(); |
| + canvas_ = o.canvas_; |
| + o.canvas_ = nullptr; |
|
danakj
2017/04/05 22:01:37
Oops, was missing the return here when I changed t
danakj
2017/04/05 22:07:01
Alternatively i could keep passing a null instead
|
| + } |
| + |
| private: |
| gfx::Canvas* canvas_; |