| 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 && !currentIt->isGone() | 253 && !currentIt->isGone() |
| 254 && currentIt->id().equalToExceptForType(newDisplayItem.id(), matchin
gType); | 254 && currentIt->id().equalToExceptForType(newDisplayItem.id(), matchin
gType); |
| 255 | 255 |
| 256 if (DisplayItem::isCachedType(newDisplayItem.type())) { | 256 if (DisplayItem::isCachedType(newDisplayItem.type())) { |
| 257 ASSERT(!RuntimeEnabledFeatures::slimmingPaintUnderInvalidationChecki
ngEnabled()); | 257 ASSERT(!RuntimeEnabledFeatures::slimmingPaintUnderInvalidationChecki
ngEnabled()); |
| 258 ASSERT(clientCacheIsValid(newDisplayItem.client())); | 258 ASSERT(clientCacheIsValid(newDisplayItem.client())); |
| 259 if (isSynchronized) { | 259 if (isSynchronized) { |
| 260 updatedList.appendByMoving(currentIt); | 260 updatedList.appendByMoving(currentIt); |
| 261 } else { | 261 } else { |
| 262 DisplayItems::Iterator foundIt = findOutOfOrderCachedItem(curren
tIt, newDisplayItem.id(), matchingType, displayItemIndicesByClient); | 262 DisplayItems::Iterator foundIt = findOutOfOrderCachedItem(curren
tIt, newDisplayItem.id(), matchingType, displayItemIndicesByClient); |
| 263 ASSERT(foundIt != currentEnd); | |
| 264 isSynchronized = (foundIt == currentIt); | 263 isSynchronized = (foundIt == currentIt); |
| 264 |
| 265 // TODO(chrishtr): downgrade to ASSERT as this goes to beta user
s, and replace with bailing out of the rest of the merge. |
| 266 // This assert hits if we couldn't find the cached display item
in our cache, which should be impossible. |
| 267 RELEASE_ASSERT(foundIt != currentEnd); |
| 268 |
| 265 updatedList.appendByMoving(foundIt); | 269 updatedList.appendByMoving(foundIt); |
| 266 } | 270 } |
| 267 } else { | 271 } else { |
| 268 #if ENABLE(ASSERT) | 272 #if ENABLE(ASSERT) |
| 269 if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEn
abled()) | 273 if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEn
abled()) |
| 270 checkCachedDisplayItemIsUnchanged(newDisplayItem, displayItemInd
icesByClient); | 274 checkCachedDisplayItemIsUnchanged(newDisplayItem, displayItemInd
icesByClient); |
| 271 else | 275 else |
| 272 ASSERT(!DisplayItem::isDrawingType(newDisplayItem.type()) || new
DisplayItem.skippedCache() || !clientCacheIsValid(newDisplayItem.client())); | 276 ASSERT(!DisplayItem::isDrawingType(newDisplayItem.type()) || new
DisplayItem.skippedCache() || !clientCacheIsValid(newDisplayItem.client())); |
| 273 #endif // ENABLE(ASSERT) | 277 #endif // ENABLE(ASSERT) |
| 274 updatedList.appendByMoving(newIt); | 278 updatedList.appendByMoving(newIt); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 | 465 |
| 462 void DisplayItemList::replay(GraphicsContext& context) const | 466 void DisplayItemList::replay(GraphicsContext& context) const |
| 463 { | 467 { |
| 464 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); | 468 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); |
| 465 ASSERT(m_newDisplayItems.isEmpty()); | 469 ASSERT(m_newDisplayItems.isEmpty()); |
| 466 for (auto& displayItem : m_currentDisplayItems) | 470 for (auto& displayItem : m_currentDisplayItems) |
| 467 displayItem.replay(context); | 471 displayItem.replay(context); |
| 468 } | 472 } |
| 469 | 473 |
| 470 } // namespace blink | 474 } // namespace blink |
| OLD | NEW |