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

Unified Diff: include/private/SkTArray.h

Issue 2255963002: Batched implementation of drawLattice() for GPU (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Speculative reland Created 4 years, 4 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
« no previous file with comments | « include/gpu/GrDrawContext.h ('k') | src/core/SkLatticeIter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/private/SkTArray.h
diff --git a/include/private/SkTArray.h b/include/private/SkTArray.h
index 1fe2c3857c1555c58efe20303709dbde649ee868..1c06bf331ae8e92f3efcdb54b60fd3af3572443e 100644
--- a/include/private/SkTArray.h
+++ b/include/private/SkTArray.h
@@ -238,6 +238,19 @@ public:
}
/**
+ * Version of above that uses the move constructor to set n items.
+ */
+ T* move_back_n(int n, T* t) {
+ SkASSERT(n >= 0);
+ this->checkRealloc(n);
+ for (int i = 0; i < n; ++i) {
+ new (fItemArray + fCount + i) T(std::move(t[i]));
+ }
+ fCount += n;
+ return fItemArray + fCount - n;
+ }
+
+ /**
* Removes the last element. Not safe to call when count() == 0.
*/
void pop_back() {
« no previous file with comments | « include/gpu/GrDrawContext.h ('k') | src/core/SkLatticeIter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698