diff options
author | Hal Canary <halcanary@google.com> | 2018-06-14 15:12:42 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-14 19:50:44 +0000 |
commit | 0acb79eb2a63c404257889890a4ace0efc022ef9 (patch) | |
tree | 4855fffec3e1a277449c8278e61fcdb89c6f0e60 /include/private | |
parent | fedfd5402cd28c22262bdc2d47ae568b8e3cf33b (diff) |
SkTemplates no longer uses Sknoncopyable
Change-Id: I142ff4f6b05e633b92d982f3c39a0e58617c1c0e
Reviewed-on: https://skia-review.googlesource.com/135040
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'include/private')
-rw-r--r-- | include/private/SkTemplates.h | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/include/private/SkTemplates.h b/include/private/SkTemplates.h index 4a9a2f223b..418502b2c1 100644 --- a/include/private/SkTemplates.h +++ b/include/private/SkTemplates.h @@ -130,8 +130,13 @@ private: /** Wraps SkAutoTArray, with room for kCountRequested elements preallocated. */ -template <int kCountRequested, typename T> class SkAutoSTArray : SkNoncopyable { +template <int kCountRequested, typename T> class SkAutoSTArray { public: + SkAutoSTArray(SkAutoSTArray&&) = delete; + SkAutoSTArray(const SkAutoSTArray&) = delete; + SkAutoSTArray& operator=(SkAutoSTArray&&) = delete; + SkAutoSTArray& operator=(const SkAutoSTArray&) = delete; + /** Initialize with no objects */ SkAutoSTArray() { fArray = nullptr; @@ -272,7 +277,7 @@ private: std::unique_ptr<T, SkFunctionWrapper<void, void, sk_free>> fPtr; }; -template <size_t kCountRequested, typename T> class SkAutoSTMalloc : SkNoncopyable { +template <size_t kCountRequested, typename T> class SkAutoSTMalloc { public: SkAutoSTMalloc() : fPtr(fTStorage) {} @@ -286,6 +291,11 @@ public: } } + SkAutoSTMalloc(SkAutoSTMalloc&&) = delete; + SkAutoSTMalloc(const SkAutoSTMalloc&) = delete; + SkAutoSTMalloc& operator=(SkAutoSTMalloc&&) = delete; + SkAutoSTMalloc& operator=(const SkAutoSTMalloc&) = delete; + ~SkAutoSTMalloc() { if (fPtr != fTStorage) { sk_free(fPtr); @@ -395,8 +405,14 @@ T* SkInPlaceNewCheck(void* storage, size_t size, Args&&... args) { * Reserves memory that is aligned on double and pointer boundaries. * Hopefully this is sufficient for all practical purposes. */ -template <size_t N> class SkAlignedSStorage : SkNoncopyable { +template <size_t N> class SkAlignedSStorage { public: + SkAlignedSStorage() {} + SkAlignedSStorage(SkAlignedSStorage&&) = delete; + SkAlignedSStorage(const SkAlignedSStorage&) = delete; + SkAlignedSStorage& operator=(SkAlignedSStorage&&) = delete; + SkAlignedSStorage& operator=(const SkAlignedSStorage&) = delete; + size_t size() const { return N; } void* get() { return fData; } const void* get() const { return fData; } @@ -415,8 +431,14 @@ private: * we have to do some arcane trickery to determine alignment of non-POD * types. Lifetime of the memory is the lifetime of the object. */ -template <int N, typename T> class SkAlignedSTStorage : SkNoncopyable { +template <int N, typename T> class SkAlignedSTStorage { public: + SkAlignedSTStorage() {} + SkAlignedSTStorage(SkAlignedSTStorage&&) = delete; + SkAlignedSTStorage(const SkAlignedSTStorage&) = delete; + SkAlignedSTStorage& operator=(SkAlignedSTStorage&&) = delete; + SkAlignedSTStorage& operator=(const SkAlignedSTStorage&) = delete; + /** * Returns void* because this object does not initialize the * memory. Use placement new for types that require a cons. |