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/TraceEvent.h" | 9 #include "platform/TraceEvent.h" |
10 #include "platform/graphics/paint/DrawingDisplayItem.h" | 10 #include "platform/graphics/paint/DrawingDisplayItem.h" |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 #ifndef NDEBUG | 593 #ifndef NDEBUG |
594 | 594 |
595 WTF::String DisplayItemList::displayItemsAsDebugString(const DisplayItems& list)
const | 595 WTF::String DisplayItemList::displayItemsAsDebugString(const DisplayItems& list)
const |
596 { | 596 { |
597 StringBuilder stringBuilder; | 597 StringBuilder stringBuilder; |
598 size_t i = 0; | 598 size_t i = 0; |
599 for (auto it = list.begin(); it != list.end(); ++it, ++i) { | 599 for (auto it = list.begin(); it != list.end(); ++it, ++i) { |
600 const DisplayItem& displayItem = *it; | 600 const DisplayItem& displayItem = *it; |
601 if (i) | 601 if (i) |
602 stringBuilder.append(",\n"); | 602 stringBuilder.append(",\n"); |
603 if (!displayItem.isValid()) { | |
604 stringBuilder.append("null"); | |
605 continue; | |
606 } | |
607 stringBuilder.append(String::format("{index: %d, ", (int)i)); | 603 stringBuilder.append(String::format("{index: %d, ", (int)i)); |
608 displayItem.dumpPropertiesAsDebugString(stringBuilder); | 604 displayItem.dumpPropertiesAsDebugString(stringBuilder); |
609 stringBuilder.append(", cacheIsValid: "); | 605 if (displayItem.isValid()) { |
610 stringBuilder.append(clientCacheIsValid(displayItem.client()) ? "true" :
"false"); | 606 stringBuilder.append(", cacheIsValid: "); |
| 607 stringBuilder.append(clientCacheIsValid(displayItem.client()) ? "tru
e" : "false"); |
| 608 } |
611 stringBuilder.append('}'); | 609 stringBuilder.append('}'); |
612 } | 610 } |
613 return stringBuilder.toString(); | 611 return stringBuilder.toString(); |
614 } | 612 } |
615 | 613 |
616 void DisplayItemList::showDebugData() const | 614 void DisplayItemList::showDebugData() const |
617 { | 615 { |
618 WTFLogAlways("current display items: [%s]\n", displayItemsAsDebugString(m_cu
rrentDisplayItems).utf8().data()); | 616 WTFLogAlways("current display items: [%s]\n", displayItemsAsDebugString(m_cu
rrentDisplayItems).utf8().data()); |
619 WTFLogAlways("new display items: [%s]\n", displayItemsAsDebugString(m_newDis
playItems).utf8().data()); | 617 WTFLogAlways("new display items: [%s]\n", displayItemsAsDebugString(m_newDis
playItems).utf8().data()); |
620 } | 618 } |
621 | 619 |
622 #endif // ifndef NDEBUG | 620 #endif // ifndef NDEBUG |
623 | 621 |
624 void DisplayItemList::replay(GraphicsContext& context) | 622 void DisplayItemList::replay(GraphicsContext& context) |
625 { | 623 { |
626 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); | 624 TRACE_EVENT0("blink,benchmark", "DisplayItemList::replay"); |
627 ASSERT(m_newDisplayItems.isEmpty()); | 625 ASSERT(m_newDisplayItems.isEmpty()); |
628 for (DisplayItem& displayItem : m_currentDisplayItems) | 626 for (DisplayItem& displayItem : m_currentDisplayItems) |
629 displayItem.replay(context); | 627 displayItem.replay(context); |
630 } | 628 } |
631 | 629 |
632 } // namespace blink | 630 } // namespace blink |
OLD | NEW |