Index: src/core/SkString.cpp |
diff --git a/src/core/SkString.cpp b/src/core/SkString.cpp |
index b5655e0503be9574f93047dc54f9158b343c25fc..8ac56744747049479a004de6308aba901e97c2e2 100644 |
--- a/src/core/SkString.cpp |
+++ b/src/core/SkString.cpp |
@@ -275,6 +275,13 @@ SkString::SkString(const SkString& src) { |
fRec = RefRec(src.fRec); |
} |
+SkString::SkString(SkString&& src) { |
+ src.validate(); |
+ |
+ fRec = src.fRec; |
+ src.fRec = const_cast<Rec*>(&gEmptyRec); |
+} |
+ |
SkString::~SkString() { |
this->validate(); |
@@ -310,6 +317,15 @@ SkString& SkString::operator=(const SkString& src) { |
return *this; |
} |
+SkString& SkString::operator=(SkString&& src) { |
+ this->validate(); |
+ |
+ if (fRec != src.fRec) { |
+ this->swap(src); |
+ } |
+ return *this; |
+} |
+ |
SkString& SkString::operator=(const char text[]) { |
this->validate(); |