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..c4c7014475c6f8569f47958a64435ec5864c4957 100644 |
| --- a/ui/gfx/scoped_canvas.h |
| +++ b/ui/gfx/scoped_canvas.h |
| @@ -23,6 +23,18 @@ class GFX_EXPORT ScopedCanvas { |
| canvas_->Restore(); |
| } |
| + ScopedCanvas(ScopedCanvas&& o) { |
|
Peter Kasting
2017/04/06 00:52:11
Nit: Per Google style guide constructors and assig
danakj
2017/04/06 17:05:28
I didn't realize this, thanks. https://google.gith
|
| + canvas_ = o.canvas_; |
| + o.canvas_ = nullptr; |
| + } |
| + ScopedCanvas& operator=(ScopedCanvas&& o) { |
| + if (canvas_) |
| + canvas_->Restore(); |
| + canvas_ = o.canvas_; |
| + o.canvas_ = nullptr; |
| + return *this; |
| + } |
| + |
| private: |
| gfx::Canvas* canvas_; |