| 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/PaintController.h" | 6 #include "platform/graphics/paint/PaintController.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/GraphicsLayer.h" | 10 #include "platform/graphics/GraphicsLayer.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 invalidateClient(client); | 117 invalidateClient(client); |
| 118 | 118 |
| 119 if (visualRect) { | 119 if (visualRect) { |
| 120 // TODO(wkorman): cache visualRect for the client. | 120 // TODO(wkorman): cache visualRect for the client. |
| 121 } | 121 } |
| 122 } | 122 } |
| 123 | 123 |
| 124 void PaintController::invalidateClient(const DisplayItemClientWrapper& client) | 124 void PaintController::invalidateClient(const DisplayItemClientWrapper& client) |
| 125 { | 125 { |
| 126 #if ENABLE(ASSERT) | 126 #if ENABLE(ASSERT) |
| 127 m_invalidations.append(client.debugName()); | 127 // Slimming paint v1 CompositedLayerMapping may invalidate client on extra l
ayers. |
| 128 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() || clientCacheIsValid(c
lient.displayItemClient())) |
| 129 m_invalidations.append(client.debugName()); |
| 128 #endif | 130 #endif |
| 129 | 131 |
| 130 invalidateUntracked(client.displayItemClient()); | 132 invalidateUntracked(client.displayItemClient()); |
| 131 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_trackedPaintInvali
dationObjects) | 133 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_trackedPaintInvali
dationObjects) |
| 132 m_trackedPaintInvalidationObjects->append(client.debugName()); | 134 m_trackedPaintInvalidationObjects->append(client.debugName()); |
| 133 } | 135 } |
| 134 | 136 |
| 135 void PaintController::invalidateUntracked(DisplayItemClient client) | 137 void PaintController::invalidateUntracked(DisplayItemClient client) |
| 136 { | 138 { |
| 137 // This can be called during painting, but we can't invalidate already paint
ed clients. | 139 // This can be called during painting, but we can't invalidate already paint
ed clients. |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 { | 273 { |
| 272 TRACE_EVENT2("blink,benchmark", "PaintController::commitNewDisplayItems", | 274 TRACE_EVENT2("blink,benchmark", "PaintController::commitNewDisplayItems", |
| 273 "current_display_list_size", (int)m_currentPaintArtifact.displayItemList
().size(), | 275 "current_display_list_size", (int)m_currentPaintArtifact.displayItemList
().size(), |
| 274 "num_non_cached_new_items", (int)m_newDisplayItemList.size() - m_numCach
edItems); | 276 "num_non_cached_new_items", (int)m_newDisplayItemList.size() - m_numCach
edItems); |
| 275 | 277 |
| 276 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled() | 278 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled() |
| 277 && !m_newDisplayItemList.isEmpty() | 279 && !m_newDisplayItemList.isEmpty() |
| 278 && m_newDisplayItemList.last().type() == DisplayItem::CachedDisplayItemL
ist) { | 280 && m_newDisplayItemList.last().type() == DisplayItem::CachedDisplayItemL
ist) { |
| 279 // The whole display item list is cached. | 281 // The whole display item list is cached. |
| 280 ASSERT(m_newDisplayItemList.size() == 1 | 282 ASSERT(m_newDisplayItemList.size() == 1 |
| 281 || (m_newDisplayItemList.size() == 2 && m_newDisplayItemList[0].type
() == DisplayItem::DebugRedFill)); | 283 || (m_newDisplayItemList.size() == 2 && DisplayItem::nonCachedType(m
_newDisplayItemList[0].type()) == DisplayItem::DebugRedFill)); |
| 282 ASSERT(m_invalidations.isEmpty()); | 284 ASSERT(m_invalidations.isEmpty()); |
| 283 ASSERT(m_clientsCheckedPaintInvalidation.isEmpty()); | 285 ASSERT(m_clientsCheckedPaintInvalidation.isEmpty()); |
| 284 m_newDisplayItemList.clear(); | 286 m_newDisplayItemList.clear(); |
| 285 m_newPaintChunks.clear(); | 287 m_newPaintChunks.clear(); |
| 286 return; | 288 return; |
| 287 } | 289 } |
| 288 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 290 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
| 289 m_clientsCheckedPaintInvalidation.clear(); | 291 m_clientsCheckedPaintInvalidation.clear(); |
| 290 | 292 |
| 291 // These data structures are used during painting only. | 293 // These data structures are used during painting only. |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 | 564 |
| 563 void PaintController::showDebugData() const | 565 void PaintController::showDebugData() const |
| 564 { | 566 { |
| 565 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri
ng(m_currentPaintArtifact.displayItemList()).utf8().data()); | 567 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri
ng(m_currentPaintArtifact.displayItemList()).utf8().data()); |
| 566 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m
_newDisplayItemList).utf8().data()); | 568 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m
_newDisplayItemList).utf8().data()); |
| 567 } | 569 } |
| 568 | 570 |
| 569 #endif // ifndef NDEBUG | 571 #endif // ifndef NDEBUG |
| 570 | 572 |
| 571 } // namespace blink | 573 } // namespace blink |
| OLD | NEW |