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

Unified Diff: cc/quads/list_container.h

Issue 448303002: Use custom ListContainer to allocate DrawQuads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@perftest
Patch Set: fix win trybot compile error Created 6 years, 3 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
Index: cc/quads/list_container.h
diff --git a/cc/quads/list_container.h b/cc/quads/list_container.h
index 34a30aadd6e74c2403fce5d339d61b9f00c428e6..5915a862afcd500e837c4cdd99bc5fc794bb5807 100644
--- a/cc/quads/list_container.h
+++ b/cc/quads/list_container.h
@@ -150,9 +150,15 @@ class CC_EXPORT ListContainer {
// Allocate().
template <typename DerivedElementType>
DerivedElementType* AllocateAndConstruct() {
- DerivedElementType* result =
- new (Allocate(sizeof(DerivedElementType))) DerivedElementType;
- return result;
+ return new (Allocate(sizeof(DerivedElementType))) DerivedElementType;
+ }
+ // Take in derived element type and copy construct it at location generated by
+ // Allocate().
+ template <typename DerivedElementType>
+ DerivedElementType* AllocateAndCopyConstruct(
danakj 2014/09/23 17:59:38 nit: AllocateAndCopyFrom?
weiliangc 2014/09/24 20:14:35 Done.
+ const DerivedElementType* source) {
+ return new (Allocate(sizeof(DerivedElementType)))
+ DerivedElementType(*source);
}
size_t size() const;

Powered by Google App Engine
This is Rietveld 408576698