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

Unified Diff: Source/core/rendering/OrderIterator.cpp

Issue 22642010: [CSS Grid Layout] Speed up painting on large grids (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined change Created 7 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 | « Source/core/rendering/OrderIterator.h ('k') | Source/core/rendering/RenderGrid.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/OrderIterator.cpp
diff --git a/Source/core/rendering/OrderIterator.cpp b/Source/core/rendering/OrderIterator.cpp
index d55779cc4cf8de6523a7a428241a3f9b5530328a..1cda9c59b3cf665bb4564d99961a9afc49272de3 100644
--- a/Source/core/rendering/OrderIterator.cpp
+++ b/Source/core/rendering/OrderIterator.cpp
@@ -62,9 +62,9 @@ RenderBox* OrderIterator::next()
m_orderValuesIterator = m_orderValues.begin();
}
- m_currentChild = m_containerBox->firstChildBox();
+ m_currentChild = firstChildBox();
} else {
- m_currentChild = m_currentChild->nextSiblingBox();
+ m_currentChild = nextSiblingBox();
}
} while (!m_currentChild || m_currentChild->style()->order() != *m_orderValuesIterator);
@@ -77,6 +77,26 @@ void OrderIterator::reset()
m_orderValuesIterator = 0;
}
+RenderBox* OrderIterator::firstChildBox()
+{
+ if (m_children.isEmpty())
+ return m_containerBox->firstChildBox();
+
+ m_childIndex = 0;
+ return m_children[0];
+}
+
+RenderBox* OrderIterator::nextSiblingBox()
+{
+ if (m_children.isEmpty())
+ return m_currentChild->nextSiblingBox();
+
+ if (m_childIndex >= m_children.size() - 1)
+ return 0;
+
+ return m_children[++m_childIndex];
+}
+
OrderIteratorPopulator::~OrderIteratorPopulator()
{
m_iterator.reset();
@@ -110,6 +130,13 @@ void OrderIteratorPopulator::removeDuplicatedOrderValues()
orderValues.shrink(uniqueItemIndex + 1);
}
+void OrderIteratorPopulator::storeChild(RenderBox* child)
+{
+ m_iterator.m_children.append(child);
+
+ collectChild(child);
+}
+
void OrderIteratorPopulator::collectChild(const RenderBox* child)
{
// Avoid growing the vector for the common-case default value of 0.
« no previous file with comments | « Source/core/rendering/OrderIterator.h ('k') | Source/core/rendering/RenderGrid.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698