Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include "platform/TraceEvent.h" | 10 #include "platform/TraceEvent.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 235 && m_currentDisplayItems[currentDisplayItemsIndex] | 235 && m_currentDisplayItems[currentDisplayItemsIndex] |
| 236 && m_currentDisplayItems[currentDisplayItemsIndex]->idsEqual(*newDis playItem, matchingType); | 236 && m_currentDisplayItems[currentDisplayItemsIndex]->idsEqual(*newDis playItem, matchingType); |
| 237 | 237 |
| 238 if (newDisplayItem->isCached()) { | 238 if (newDisplayItem->isCached()) { |
| 239 ASSERT(!RuntimeEnabledFeatures::slimmingPaintUnderInvalidationChecki ngEnabled()); | 239 ASSERT(!RuntimeEnabledFeatures::slimmingPaintUnderInvalidationChecki ngEnabled()); |
| 240 ASSERT(clientCacheIsValid(newDisplayItem->client())); | 240 ASSERT(clientCacheIsValid(newDisplayItem->client())); |
| 241 if (isSynchronized) { | 241 if (isSynchronized) { |
| 242 updatedList.append(m_currentDisplayItems[currentDisplayItemsInde x].release()); | 242 updatedList.append(m_currentDisplayItems[currentDisplayItemsInde x].release()); |
| 243 } else { | 243 } else { |
| 244 size_t foundIndex = findOutOfOrderCachedItem(currentDisplayItems Index, *newDisplayItem, matchingType, displayItemIndicesByClient); | 244 size_t foundIndex = findOutOfOrderCachedItem(currentDisplayItems Index, *newDisplayItem, matchingType, displayItemIndicesByClient); |
| 245 if (foundIndex != kNotFound) { | 245 ASSERT(foundIndex != kNotFound); |
| 246 isSynchronized = (foundIndex == currentDisplayItemsIndex); | 246 isSynchronized = (foundIndex == currentDisplayItemsIndex); |
| 247 updatedList.append(m_currentDisplayItems[foundIndex].release ()); | 247 updatedList.append(m_currentDisplayItems[foundIndex].release()); |
| 248 } | |
| 249 // else: do nothing because previously the client generated a em pty picture which is not stored in the cache. | |
|
chrishtr
2015/06/03 21:19:21
The behavior this comment refers to was removed ea
Xianzhu
2015/06/03 21:32:56
Yes. I should have changed the above when I added
| |
| 250 } | 248 } |
| 251 } else { | 249 } else { |
| 252 #if ENABLE(ASSERT) | 250 #if ENABLE(ASSERT) |
| 253 if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEn abled()) | 251 if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEn abled()) |
| 254 checkCachedDisplayItemIsUnchanged(*newDisplayItem, displayItemIn dicesByClient); | 252 checkCachedDisplayItemIsUnchanged(*newDisplayItem, displayItemIn dicesByClient); |
| 255 else | 253 else |
| 256 ASSERT(!newDisplayItem->isDrawing() || !clientCacheIsValid(newDi splayItem->client())); | 254 ASSERT(!newDisplayItem->isDrawing() || !clientCacheIsValid(newDi splayItem->client())); |
| 257 #endif // ENABLE(ASSERT) | 255 #endif // ENABLE(ASSERT) |
| 258 updatedList.append(newDisplayItem.release()); | 256 updatedList.append(newDisplayItem.release()); |
| 259 } | 257 } |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 435 | 433 |
| 436 void DisplayItemList::replay(GraphicsContext& context) const | 434 void DisplayItemList::replay(GraphicsContext& context) const |
| 437 { | 435 { |
| 438 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); | 436 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); |
| 439 ASSERT(m_newDisplayItems.isEmpty()); | 437 ASSERT(m_newDisplayItems.isEmpty()); |
| 440 for (auto& displayItem : m_currentDisplayItems) | 438 for (auto& displayItem : m_currentDisplayItems) |
| 441 displayItem->replay(context); | 439 displayItem->replay(context); |
| 442 } | 440 } |
| 443 | 441 |
| 444 } // namespace blink | 442 } // namespace blink |
| OLD | NEW |