diff options
-rw-r--r-- | include/private/SkTArray.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/private/SkTArray.h b/include/private/SkTArray.h index 1c06bf331a..bd0798ce76 100644 --- a/include/private/SkTArray.h +++ b/include/private/SkTArray.h @@ -403,6 +403,18 @@ protected: } /** + * Move another array, using preallocated storage if preAllocCount >= + * array.count(). Otherwise storage will only be used when array shrinks + * to fit. + */ + template <int N> + SkTArray(SkTArray&& array, SkAlignedSTStorage<N,T>* storage) { + this->init(array.fCount, storage->get(), N); + array.move(fMemArray); + array.fCount = 0; + } + + /** * Copy a C array, using preallocated storage if preAllocCount >= * count. Otherwise storage will only be used when array shrinks * to fit. @@ -532,10 +544,18 @@ public: : INHERITED(array, &fStorage) { } + SkSTArray(SkSTArray&& array) + : INHERITED(std::move(array), &fStorage) { + } + explicit SkSTArray(const INHERITED& array) : INHERITED(array, &fStorage) { } + explicit SkSTArray(INHERITED&& array) + : INHERITED(std::move(array), &fStorage) { + } + explicit SkSTArray(int reserveCount) : INHERITED(reserveCount) { } |