Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Unified Diff: src/core/SkTLList.h

Issue 147793007: Add rect clip to convex_poly_clip GM (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: simplify function name Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« gm/convexpolyclip.cpp ('K') | « gm/convexpolyclip.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkTLList.h
diff --git a/src/core/SkTLList.h b/src/core/SkTLList.h
index 298ce516cc01ffa1b0dce0cb872d286730f72ed3..99b5bc67d964d2b6bc07584847993bafff925d71 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) {
« gm/convexpolyclip.cpp ('K') | « gm/convexpolyclip.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698