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

Side by Side Diff: Source/platform/graphics/paint/DisplayItemList.cpp

Issue 924533006: Don't remove empty display item pairs that draw content (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address review comments Created 5 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "platform/graphics/paint/DisplayItemList.h" 6 #include "platform/graphics/paint/DisplayItemList.h"
7 7
8 #include "platform/NotImplemented.h" 8 #include "platform/NotImplemented.h"
9 #include "platform/RuntimeEnabledFeatures.h" 9 #include "platform/RuntimeEnabledFeatures.h"
10 #ifndef NDEBUG 10 #ifndef NDEBUG
(...skipping 10 matching lines...) Expand all
21 ASSERT(m_newPaints.isEmpty()); 21 ASSERT(m_newPaints.isEmpty());
22 return m_paintList; 22 return m_paintList;
23 } 23 }
24 24
25 void DisplayItemList::add(WTF::PassOwnPtr<DisplayItem> displayItem) 25 void DisplayItemList::add(WTF::PassOwnPtr<DisplayItem> displayItem)
26 { 26 {
27 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled()); 27 ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled());
28 28
29 if (displayItem->isEnd()) { 29 if (displayItem->isEnd()) {
30 ASSERT(!m_newPaints.isEmpty()); 30 ASSERT(!m_newPaints.isEmpty());
31 if (m_newPaints.last()->isBegin()) { 31 if (m_newPaints.last()->isBegin() && !m_newPaints.last()->drawsContent() ) {
32 ASSERT(displayItem->isEndAndPairedWith(*m_newPaints.last())); 32 ASSERT(displayItem->isEndAndPairedWith(*m_newPaints.last()));
33 // Remove the beginning display item of this empty pair. 33 // Remove the beginning display item of this empty pair.
34 m_newPaints.removeLast(); 34 m_newPaints.removeLast();
35 #if ENABLE(ASSERT) 35 #if ENABLE(ASSERT)
36 if (RuntimeEnabledFeatures::slimmingPaintDisplayItemCacheEnabled()) { 36 if (RuntimeEnabledFeatures::slimmingPaintDisplayItemCacheEnabled()) {
37 // Also remove the index pointing to the removed display item. 37 // Also remove the index pointing to the removed display item.
38 Vector<size_t>& indices = m_newDisplayItemIndicesByClient.find(d isplayItem->client())->value; 38 Vector<size_t>& indices = m_newDisplayItemIndicesByClient.find(d isplayItem->client())->value;
39 if (!indices.isEmpty() && indices.last() == m_newPaints.size()) 39 if (!indices.isEmpty() && indices.last() == m_newPaints.size())
40 indices.removeLast(); 40 indices.removeLast();
41 } 41 }
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 #endif // ifndef NDEBUG 239 #endif // ifndef NDEBUG
240 240
241 void DisplayItemList::replay(GraphicsContext* context) 241 void DisplayItemList::replay(GraphicsContext* context)
242 { 242 {
243 updatePaintList(); 243 updatePaintList();
244 for (auto& displayItem : m_paintList) 244 for (auto& displayItem : m_paintList)
245 displayItem->replay(context); 245 displayItem->replay(context);
246 } 246 }
247 247
248 } // namespace blink 248 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/paint/DisplayItem.h ('k') | Source/platform/graphics/paint/DrawingDisplayItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698