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 |
158 void PaintController::processNewItem(DisplayItem& displayItem) | 165 void PaintController::processNewItem(DisplayItem& displayItem) |
159 { | 166 { |
160 DCHECK(!m_constructionDisabled); | 167 DCHECK(!m_constructionDisabled); |
161 | 168 |
162 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 169 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
163 if (!isSkippingCache()) { | 170 if (!isSkippingCache()) { |
164 if (displayItem.isCacheable()) { | 171 if (displayItem.isCacheable()) { |
165 // Mark the client shouldKeepAlive under this PaintController. | 172 // Mark the client shouldKeepAlive under this PaintController. |
166 // The status will end after the new display items are committed. | 173 // The status will end after the new display items are committed. |
167 displayItem.client().beginShouldKeepAlive(this); | 174 displayItem.client().beginShouldKeepAlive(this); |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 | 614 |
608 void PaintController::showDebugData() const | 615 void PaintController::showDebugData() const |
609 { | 616 { |
610 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri
ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data()); | 617 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri
ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data()); |
611 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m
_newDisplayItemList).utf8().data()); | 618 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m
_newDisplayItemList).utf8().data()); |
612 } | 619 } |
613 | 620 |
614 #endif // ifndef NDEBUG | 621 #endif // ifndef NDEBUG |
615 | 622 |
616 } // namespace blink | 623 } // namespace blink |
OLD | NEW |