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

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

Issue 2107103002: Find cached display items directly during painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 5 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.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp b/third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp
index cb42fefa480b0aa32f03d22131e9d8205945ed00..73a3929a703a46568bd327764b1f5da6faad17f3 100644
--- a/third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ContiguousContainer.cpp
@@ -171,6 +171,14 @@ void ContiguousContainerBase::swap(ContiguousContainerBase& other)
std::swap(m_maxObjectSize, other.m_maxObjectSize);
}
+void ContiguousContainerBase::shrinkToFit()
+{
+ while (m_endIndex < m_buffers.size() - 1) {
+ DCHECK(m_buffers.last()->isEmpty());
+ m_buffers.removeLast();
+ }
+}
+
ContiguousContainerBase::Buffer*
ContiguousContainerBase::allocateNewBufferForNextAllocation(size_t bufferSize, const char* typeName)
{

Powered by Google App Engine
This is Rietveld 408576698