| 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 "platform/graphics/paint/PaintController.h" | 5 #include "platform/graphics/paint/PaintController.h" |
| 6 | 6 |
| 7 #include "platform/TraceEvent.h" | 7 #include "platform/TraceEvent.h" |
| 8 #include "platform/graphics/GraphicsLayer.h" | 8 #include "platform/graphics/GraphicsLayer.h" |
| 9 #include "platform/graphics/paint/DrawingDisplayItem.h" | 9 #include "platform/graphics/paint/DrawingDisplayItem.h" |
| 10 #include "third_party/skia/include/core/SkPictureAnalyzer.h" | 10 #include "third_party/skia/include/core/SkPictureAnalyzer.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 --m_underInvalidationCheckingBegin; | 148 --m_underInvalidationCheckingBegin; |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 #endif | 151 #endif |
| 152 m_newDisplayItemList.removeLast(); | 152 m_newDisplayItemList.removeLast(); |
| 153 | 153 |
| 154 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 154 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
| 155 m_newPaintChunks.decrementDisplayItemIndex(); | 155 m_newPaintChunks.decrementDisplayItemIndex(); |
| 156 } | 156 } |
| 157 | 157 |
| 158 const DisplayItem* PaintController::lastDisplayItem(unsigned offset) | |
| 159 { | |
| 160 if (offset < m_newDisplayItemList.size()) | |
| 161 return &m_newDisplayItemList[m_newDisplayItemList.size() - offset - 1]; | |
| 162 return nullptr; | |
| 163 } | |
| 164 | |
| 165 void PaintController::processNewItem(DisplayItem& displayItem) | 158 void PaintController::processNewItem(DisplayItem& displayItem) |
| 166 { | 159 { |
| 167 DCHECK(!m_constructionDisabled); | 160 DCHECK(!m_constructionDisabled); |
| 168 | 161 |
| 169 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 162 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
| 170 if (!isSkippingCache()) { | 163 if (!isSkippingCache()) { |
| 171 if (displayItem.isCacheable()) { | 164 if (displayItem.isCacheable()) { |
| 172 // Mark the client shouldKeepAlive under this PaintController. | 165 // Mark the client shouldKeepAlive under this PaintController. |
| 173 // The status will end after the new display items are committed. | 166 // The status will end after the new display items are committed. |
| 174 displayItem.client().beginShouldKeepAlive(this); | 167 displayItem.client().beginShouldKeepAlive(this); |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 | 607 |
| 615 void PaintController::showDebugData() const | 608 void PaintController::showDebugData() const |
| 616 { | 609 { |
| 617 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri
ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data()); | 610 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri
ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data()); |
| 618 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m
_newDisplayItemList).utf8().data()); | 611 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m
_newDisplayItemList).utf8().data()); |
| 619 } | 612 } |
| 620 | 613 |
| 621 #endif // ifndef NDEBUG | 614 #endif // ifndef NDEBUG |
| 622 | 615 |
| 623 } // namespace blink | 616 } // namespace blink |
| OLD | NEW |