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

Unified Diff: Source/platform/graphics/paint/DisplayItemList.cpp

Issue 860563003: Disable display item caching (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 years, 11 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/platform/graphics/paint/DisplayItemList.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/paint/DisplayItemList.cpp
diff --git a/Source/platform/graphics/paint/DisplayItemList.cpp b/Source/platform/graphics/paint/DisplayItemList.cpp
index f4723e3b27c2f291c80104e8df8da8ae8adc2f5c..32789455cd6c2b84e61ed00c9cbd691e054695a9 100644
--- a/Source/platform/graphics/paint/DisplayItemList.cpp
+++ b/Source/platform/graphics/paint/DisplayItemList.cpp
@@ -15,11 +15,26 @@
namespace blink {
-const PaintList& DisplayItemList::paintList()
+void DisplayItemList::beginNewPaints()
{
ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled());
+ ASSERT(!m_newPaints.size());
+ ASSERT(!m_doingNewPaints);
+ m_doingNewPaints = true;
+}
+void DisplayItemList::endNewPaints()
+{
+ ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled());
+ ASSERT(m_doingNewPaints);
+ m_doingNewPaints = false;
updatePaintList();
+}
+
+const PaintList& DisplayItemList::paintList()
+{
+ ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled());
+ ASSERT(!m_doingNewPaints);
return m_paintList;
}
@@ -39,11 +54,16 @@ void DisplayItemList::invalidateAll()
{
ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled());
// Can only be called during layout/paintInvalidation, not during painting.
- ASSERT(m_newPaints.isEmpty());
+ ASSERT(!m_doingNewPaints && m_newPaints.isEmpty());
chrishtr 2015/01/20 23:18:53 Looks like m_doingNewPaints is only used in ASSERT
Xianzhu 2015/01/20 23:48:11 It was to ensure beginNewPaints() and endNewPaints
m_paintList.clear();
m_cachedClients.clear();
}
+bool DisplayItemList::clientCacheIsValid(DisplayItemClient client) const
+{
+ return RuntimeEnabledFeatures::slimmingPaintDisplayItemCacheEnabled() && m_cachedClients.contains(client);
+}
+
PaintList::iterator DisplayItemList::findNextMatchingCachedItem(PaintList::iterator begin, const DisplayItem& displayItem)
{
PaintList::iterator end = m_paintList.end();
@@ -74,6 +94,13 @@ static void appendDisplayItem(PaintList& list, HashSet<DisplayItemClient>& clien
// the ordering implied by the existing paint list, extra treewalks are avoided.
void DisplayItemList::updatePaintList()
{
+ if (!RuntimeEnabledFeatures::slimmingPaintDisplayItemCacheEnabled()) {
+ m_paintList.clear();
+ m_paintList.swap(m_newPaints);
+ m_cachedClients.clear();
+ return;
+ }
+
PaintList updatedList;
HashSet<DisplayItemClient> newCachedClients;
« no previous file with comments | « Source/platform/graphics/paint/DisplayItemList.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698