| 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/NotImplemented.h" | 7 #include "platform/NotImplemented.h" |
| 8 #include "platform/TraceEvent.h" | 8 #include "platform/TraceEvent.h" |
| 9 #include "platform/graphics/GraphicsLayer.h" | 9 #include "platform/graphics/GraphicsLayer.h" |
| 10 #include "platform/graphics/paint/DrawingDisplayItem.h" | 10 #include "platform/graphics/paint/DrawingDisplayItem.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 m_scopeStack.append(m_nextScope++); | 109 m_scopeStack.append(m_nextScope++); |
| 110 beginSkippingCache(); | 110 beginSkippingCache(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void PaintController::endScope() | 113 void PaintController::endScope() |
| 114 { | 114 { |
| 115 m_scopeStack.removeLast(); | 115 m_scopeStack.removeLast(); |
| 116 endSkippingCache(); | 116 endSkippingCache(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void PaintController::invalidate(const DisplayItemClient& client, PaintInvalidat
ionReason paintInvalidationReason, const IntRect* visualRect) | 119 void PaintController::invalidate(const DisplayItemClient& client) |
| 120 { | |
| 121 invalidateClient(client); | |
| 122 | |
| 123 if (visualRect) { | |
| 124 // TODO(wkorman): cache visualRect for the client. | |
| 125 } | |
| 126 } | |
| 127 | |
| 128 void PaintController::invalidateClient(const DisplayItemClient& client) | |
| 129 { | 120 { |
| 130 #if ENABLE(ASSERT) | 121 #if ENABLE(ASSERT) |
| 131 // Slimming paint v1 CompositedLayerMapping may invalidate client on extra l
ayers. | 122 // Slimming paint v1 CompositedLayerMapping may invalidate client on extra l
ayers. |
| 132 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() || clientCacheIsValid(c
lient)) | 123 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() || clientCacheIsValid(c
lient)) |
| 133 m_invalidations.append(client.debugName()); | 124 m_invalidations.append(client.debugName()); |
| 134 #endif | 125 #endif |
| 135 | 126 |
| 136 invalidateUntracked(client); | 127 invalidateUntracked(client); |
| 137 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_trackedPaintInvali
dationObjects) | 128 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_trackedPaintInvali
dationObjects) |
| 138 m_trackedPaintInvalidationObjects->append(client.debugName()); | 129 m_trackedPaintInvalidationObjects->append(client.debugName()); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 162 { | 153 { |
| 163 if (skippingCache()) | 154 if (skippingCache()) |
| 164 return false; | 155 return false; |
| 165 updateValidlyCachedClientsIfNeeded(); | 156 updateValidlyCachedClientsIfNeeded(); |
| 166 return m_validlyCachedClients.contains(&client); | 157 return m_validlyCachedClients.contains(&client); |
| 167 } | 158 } |
| 168 | 159 |
| 169 void PaintController::invalidatePaintOffset(const DisplayItemClient& client) | 160 void PaintController::invalidatePaintOffset(const DisplayItemClient& client) |
| 170 { | 161 { |
| 171 ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled()); | 162 ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled()); |
| 172 invalidateClient(client); | 163 invalidate(client); |
| 173 | 164 |
| 174 #if ENABLE(ASSERT) | 165 #if ENABLE(ASSERT) |
| 175 ASSERT(!paintOffsetWasInvalidated(client)); | 166 ASSERT(!paintOffsetWasInvalidated(client)); |
| 176 m_clientsWithPaintOffsetInvalidations.add(&client); | 167 m_clientsWithPaintOffsetInvalidations.add(&client); |
| 177 #endif | 168 #endif |
| 178 } | 169 } |
| 179 | 170 |
| 180 #if ENABLE(ASSERT) | 171 #if ENABLE(ASSERT) |
| 181 bool PaintController::paintOffsetWasInvalidated(const DisplayItemClient& client)
const | 172 bool PaintController::paintOffsetWasInvalidated(const DisplayItemClient& client)
const |
| 182 { | 173 { |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 | 556 |
| 566 void PaintController::showDebugData() const | 557 void PaintController::showDebugData() const |
| 567 { | 558 { |
| 568 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri
ng(m_currentPaintArtifact.displayItemList()).utf8().data()); | 559 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri
ng(m_currentPaintArtifact.displayItemList()).utf8().data()); |
| 569 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m
_newDisplayItemList).utf8().data()); | 560 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m
_newDisplayItemList).utf8().data()); |
| 570 } | 561 } |
| 571 | 562 |
| 572 #endif // ifndef NDEBUG | 563 #endif // ifndef NDEBUG |
| 573 | 564 |
| 574 } // namespace blink | 565 } // namespace blink |
| OLD | NEW |