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

Unified Diff: third_party/WebKit/Source/platform/graphics/ContiguousContainer.h

Issue 2307623002: [SPv2] Defer decision of raster invalidation after paint for changes z-index, transform, etc. (Closed)
Patch Set: x Created 4 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: third_party/WebKit/Source/platform/graphics/ContiguousContainer.h
diff --git a/third_party/WebKit/Source/platform/graphics/ContiguousContainer.h b/third_party/WebKit/Source/platform/graphics/ContiguousContainer.h
index 98bce1957c4aa2692f746cff3ceb33aaef9a4653..dc5210f5ccc7661a8ef48ac7ee208be57a08ac88 100644
--- a/third_party/WebKit/Source/platform/graphics/ContiguousContainer.h
+++ b/third_party/WebKit/Source/platform/graphics/ContiguousContainer.h
@@ -192,14 +192,15 @@ public:
void swap(ContiguousContainer& other) { ContiguousContainerBase::swap(other); }
- // Appends a new element using memcpy, then default-constructs a base
- // element in its place. Use with care.
- BaseElementType& appendByMoving(BaseElementType& item, size_t size)
+ // Appends a new element using memcpy, then constructs a base element in its place with args.
+ // Use with care.
+ template <typename... Args>
+ BaseElementType& appendByMoving(BaseElementType& item, size_t size, Args&&... args)
{
ASSERT(size >= sizeof(BaseElementType));
void* newItem = alignedAllocate(size);
memcpy(newItem, static_cast<void*>(&item), size);
- new (&item) BaseElementType;
+ new (&item) BaseElementType(std::forward<Args>(args)...);
return *static_cast<BaseElementType*>(newItem);
}

Powered by Google App Engine
This is Rietveld 408576698