diff options
Diffstat (limited to 'src/core/SkTLList.h')
-rw-r--r-- | src/core/SkTLList.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/SkTLList.h b/src/core/SkTLList.h index 298ce516cc..99b5bc67d9 100644 --- a/src/core/SkTLList.h +++ b/src/core/SkTLList.h @@ -75,6 +75,15 @@ public: return reinterpret_cast<T*>(node->fObj); } + T* addToHead() { + this->validate(); + Node* node = this->createNode(); + fList.addToHead(node); + SkNEW_PLACEMENT(node->fObj, T); + this->validate(); + return reinterpret_cast<T*>(node->fObj); + } + T* addToTail(const T& t) { this->validate(); Node* node = this->createNode(); @@ -84,6 +93,15 @@ public: return reinterpret_cast<T*>(node->fObj); } + T* addToTail() { + this->validate(); + Node* node = this->createNode(); + fList.addToTail(node); + SkNEW_PLACEMENT(node->fObj, T); + this->validate(); + return reinterpret_cast<T*>(node->fObj); + } + /** Adds a new element to the list before the location indicated by the iterator. If the iterator refers to a NULL location then the new element is added at the tail */ T* addBefore(const T& t, const Iter& location) { |