| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 257 |
| 258 if (DisplayItem::isCachedType(newDisplayItem.type())) { | 258 if (DisplayItem::isCachedType(newDisplayItem.type())) { |
| 259 ASSERT(!RuntimeEnabledFeatures::slimmingPaintUnderInvalidationChecki
ngEnabled()); | 259 ASSERT(!RuntimeEnabledFeatures::slimmingPaintUnderInvalidationChecki
ngEnabled()); |
| 260 ASSERT(clientCacheIsValid(newDisplayItem.client())); | 260 ASSERT(clientCacheIsValid(newDisplayItem.client())); |
| 261 if (isSynchronized) { | 261 if (isSynchronized) { |
| 262 updatedList.appendByMoving(currentIt); | 262 updatedList.appendByMoving(currentIt); |
| 263 } else { | 263 } else { |
| 264 DisplayItems::Iterator foundIt = findOutOfOrderCachedItem(curren
tIt, newDisplayItem.id(), matchingType, displayItemIndicesByClient); | 264 DisplayItems::Iterator foundIt = findOutOfOrderCachedItem(curren
tIt, newDisplayItem.id(), matchingType, displayItemIndicesByClient); |
| 265 isSynchronized = (foundIt == currentIt); | 265 isSynchronized = (foundIt == currentIt); |
| 266 | 266 |
| 267 #ifndef NDEBUG |
| 268 if (foundIt == currentEnd) { |
| 269 showDebugData(); |
| 270 WTFLogAlways("CachedDisplayItem %s not found in m_currentDis
playItems\n", |
| 271 newDisplayItem.asDebugString().utf8().data()); |
| 272 } |
| 273 #endif |
| 267 // TODO(chrishtr): downgrade to ASSERT as this goes to beta user
s, and replace with bailing out of the rest of the merge. | 274 // TODO(chrishtr): downgrade to ASSERT as this goes to beta user
s, and replace with bailing out of the rest of the merge. |
| 268 // This assert hits if we couldn't find the cached display item
in our cache, which should be impossible. | 275 // This assert hits if we couldn't find the cached display item
in our cache, which should be impossible. |
| 269 RELEASE_ASSERT(foundIt != currentEnd); | 276 RELEASE_ASSERT(foundIt != currentEnd); |
| 270 | 277 |
| 271 updatedList.appendByMoving(foundIt); | 278 updatedList.appendByMoving(foundIt); |
| 272 } | 279 } |
| 273 } else { | 280 } else { |
| 274 #if ENABLE(ASSERT) | 281 #if ENABLE(ASSERT) |
| 275 if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEn
abled()) | 282 if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEn
abled()) |
| 276 checkCachedDisplayItemIsUnchanged(newDisplayItem, displayItemInd
icesByClient); | 283 checkCachedDisplayItemIsUnchanged(newDisplayItem, displayItemInd
icesByClient); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 474 |
| 468 void DisplayItemList::replay(GraphicsContext& context) const | 475 void DisplayItemList::replay(GraphicsContext& context) const |
| 469 { | 476 { |
| 470 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); | 477 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); |
| 471 ASSERT(m_newDisplayItems.isEmpty()); | 478 ASSERT(m_newDisplayItems.isEmpty()); |
| 472 for (auto& displayItem : m_currentDisplayItems) | 479 for (auto& displayItem : m_currentDisplayItems) |
| 473 displayItem.replay(context); | 480 displayItem.replay(context); |
| 474 } | 481 } |
| 475 | 482 |
| 476 } // namespace blink | 483 } // namespace blink |
| OLD | NEW |