| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 void PaintController::displayItemClientWasInvalidated(const DisplayItemClient& c
lient) | 131 void PaintController::displayItemClientWasInvalidated(const DisplayItemClient& c
lient) |
| 132 { | 132 { |
| 133 #if DCHECK_IS_ON() | 133 #if DCHECK_IS_ON() |
| 134 // Slimming paint v1 CompositedLayerMapping may invalidate client on extra l
ayers. | 134 // Slimming paint v1 CompositedLayerMapping may invalidate client on extra l
ayers. |
| 135 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() || clientCacheIsValid(c
lient)) | 135 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() || clientCacheIsValid(c
lient)) |
| 136 m_invalidations.append(client.debugName()); | 136 m_invalidations.append(client.debugName()); |
| 137 | 137 |
| 138 // Should not invalidate already painted clients. | 138 // Should not invalidate already painted clients. |
| 139 DCHECK(!m_newDisplayItemIndicesByClient.contains(&client)); | 139 DCHECK(!m_newDisplayItemIndicesByClient.contains(&client)); |
| 140 #endif | 140 #endif |
| 141 | |
| 142 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_trackedPaintInvali
dationObjects) | |
| 143 m_trackedPaintInvalidationObjects->append(client.debugName()); | |
| 144 } | 141 } |
| 145 | 142 |
| 146 void PaintController::invalidateAll() | 143 void PaintController::invalidateAll() |
| 147 { | 144 { |
| 148 // Can only be called during layout/paintInvalidation, not during painting. | 145 // Can only be called during layout/paintInvalidation, not during painting. |
| 149 DCHECK(m_newDisplayItemList.isEmpty()); | 146 DCHECK(m_newDisplayItemList.isEmpty()); |
| 150 m_currentPaintArtifact.reset(); | 147 m_currentPaintArtifact.reset(); |
| 151 m_currentCacheGeneration.invalidate(); | 148 m_currentCacheGeneration.invalidate(); |
| 152 | |
| 153 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_trackedPaintInvali
dationObjects) | |
| 154 m_trackedPaintInvalidationObjects->append("##ALL##"); | |
| 155 } | 149 } |
| 156 | 150 |
| 157 bool PaintController::clientCacheIsValid(const DisplayItemClient& client) const | 151 bool PaintController::clientCacheIsValid(const DisplayItemClient& client) const |
| 158 { | 152 { |
| 159 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 153 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
| 160 CHECK(client.isAlive()); | 154 CHECK(client.isAlive()); |
| 161 #endif | 155 #endif |
| 162 if (skippingCache()) | 156 if (skippingCache()) |
| 163 return false; | 157 return false; |
| 164 return client.displayItemsAreCached(m_currentCacheGeneration); | 158 return client.displayItemsAreCached(m_currentCacheGeneration); |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 | 555 |
| 562 void PaintController::showDebugData() const | 556 void PaintController::showDebugData() const |
| 563 { | 557 { |
| 564 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri
ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data()); | 558 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri
ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data()); |
| 565 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m
_newDisplayItemList).utf8().data()); | 559 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m
_newDisplayItemList).utf8().data()); |
| 566 } | 560 } |
| 567 | 561 |
| 568 #endif // ifndef NDEBUG | 562 #endif // ifndef NDEBUG |
| 569 | 563 |
| 570 } // namespace blink | 564 } // namespace blink |
| OLD | NEW |