diff options
Diffstat (limited to 'src/core/SkBitmap.cpp')
-rw-r--r-- | src/core/SkBitmap.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp index 8997f2b014..661dca3ea5 100644 --- a/src/core/SkBitmap.cpp +++ b/src/core/SkBitmap.cpp @@ -39,6 +39,8 @@ SkBitmap::SkBitmap(const SkBitmap& src) { SkDEBUGCODE(this->validate();) } +SkBitmap::SkBitmap(SkBitmap&& other) : SkBitmap() { this->swap(other); } + SkBitmap::~SkBitmap() { SkDEBUGCODE(this->validate();) this->freePixels(); @@ -72,6 +74,14 @@ SkBitmap& SkBitmap::operator=(const SkBitmap& src) { return *this; } +SkBitmap& SkBitmap::operator=(SkBitmap&& other) { + if (this != &other) { + this->swap(other); + other.reset(); + } + return *this; +} + void SkBitmap::swap(SkBitmap& other) { SkTSwap(fColorTable, other.fColorTable); SkTSwap(fPixelRef, other.fPixelRef); |