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

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: change header files to try fix 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
« no previous file with comments | « cc/output/software_renderer_unittest.cc ('k') | cc/quads/list_container.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/list_container.h
diff --git a/cc/quads/list_container.h b/cc/quads/list_container.h
index 34a30aadd6e74c2403fce5d339d61b9f00c428e6..6c559f611e92379ecc4a151d5226bc849990f6a7 100644
--- a/cc/quads/list_container.h
+++ b/cc/quads/list_container.h
@@ -146,13 +146,21 @@ class CC_EXPORT ListContainer {
const BaseElementType* front() const;
const BaseElementType* back() const;
+ BaseElementType* ElementAt(size_t index);
+ const BaseElementType* ElementAt(size_t index) const;
+
// Take in derived element type and construct it at location generated by
// 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* AllocateAndCopyFrom(const DerivedElementType* source) {
+ return new (Allocate(sizeof(DerivedElementType)))
+ DerivedElementType(*source);
}
size_t size() const;
« no previous file with comments | « cc/output/software_renderer_unittest.cc ('k') | cc/quads/list_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698