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/graphics/GraphicsLayer.h" | 7 #include "platform/graphics/GraphicsLayer.h" |
8 #include "platform/graphics/paint/DrawingDisplayItem.h" | 8 #include "platform/graphics/paint/DrawingDisplayItem.h" |
9 #include "platform/instrumentation/tracing/TraceEvent.h" | 9 #include "platform/instrumentation/tracing/TraceEvent.h" |
10 #include "third_party/skia/include/core/SkPictureAnalyzer.h" | 10 #include "third_party/skia/include/core/SkPictureAnalyzer.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 | 92 |
93 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled() && | 93 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled() && |
94 isCheckingUnderInvalidation()) { | 94 isCheckingUnderInvalidation()) { |
95 // We are checking under-invalidation of an ancestor subsequence enclosing | 95 // We are checking under-invalidation of an ancestor subsequence enclosing |
96 // this one. The ancestor subsequence is supposed to have already "copied", | 96 // this one. The ancestor subsequence is supposed to have already "copied", |
97 // so we should let the client continue to actually paint the descendant | 97 // so we should let the client continue to actually paint the descendant |
98 // subsequences without "copying". | 98 // subsequences without "copying". |
99 return false; | 99 return false; |
100 } | 100 } |
101 | 101 |
102 size_t cachedItem = | 102 SubsequenceMarkers* markers = getSubsequenceMarkers(client); |
103 findCachedItem(DisplayItem::Id(client, DisplayItem::kSubsequence)); | 103 if (!markers) { |
104 if (cachedItem == kNotFound) { | |
105 NOTREACHED(); | |
106 return false; | 104 return false; |
107 } | 105 } |
108 | 106 |
109 // |cachedItem| will point to the first item after the subsequence or end of | 107 // |cachedItem| will point to the first item after the subsequence or end of |
110 // the current list. | 108 // the current list. |
111 ensureNewDisplayItemListInitialCapacity(); | 109 ensureNewDisplayItemListInitialCapacity(); |
112 copyCachedSubsequence(cachedItem); | |
113 | 110 |
114 m_nextItemToMatch = cachedItem; | 111 size_t sizeBeforeCopy = m_newDisplayItemList.size(); |
115 // Items before |cachedItem| have been copied so we don't need to index them. | 112 copyCachedSubsequence(markers->start, markers->end); |
116 if (cachedItem > m_nextItemToIndex) | 113 |
117 m_nextItemToIndex = cachedItem; | 114 if (!RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) { |
115 addCachedSubsequence(client, sizeBeforeCopy, | |
116 m_newDisplayItemList.size() - 1); | |
117 } | |
118 | |
119 m_nextItemToMatch = markers->end + 1; | |
120 // Items before |m_nextItemToMatch| have been copied so we don't need to index | |
121 // them. | |
122 if (m_nextItemToMatch > m_nextItemToIndex) | |
123 m_nextItemToIndex = m_nextItemToMatch; | |
118 | 124 |
119 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) { | 125 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) { |
120 // Return false to let the painter actually paint. We will check if the new | 126 // Return false to let the painter actually paint. We will check if the new |
121 // painting is the same as the cached one. | 127 // painting is the same as the cached one. |
122 return false; | 128 return false; |
123 } | 129 } |
124 | 130 |
125 return true; | 131 return true; |
126 } | 132 } |
127 | 133 |
134 PaintController::SubsequenceMarkers* PaintController::getSubsequenceMarkers( | |
135 const DisplayItemClient& client) { | |
136 auto result = m_currentCachedSubsequences.find(&client); | |
137 if (result == m_currentCachedSubsequences.end()) | |
138 return nullptr; | |
139 return &result->value; | |
140 } | |
141 | |
142 void PaintController::addCachedSubsequence(const DisplayItemClient& client, | |
143 unsigned start, | |
144 unsigned end) { | |
145 DCHECK(start <= end); | |
146 DCHECK(end < m_newDisplayItemList.size()); | |
147 if (isCheckingUnderInvalidation()) { | |
148 SubsequenceMarkers* markers = getSubsequenceMarkers(client); | |
149 if (!markers) { | |
150 showSequenceUnderInvalidationError( | |
151 "under-invalidation : unexpected subsequence", client, start, end); | |
152 DCHECK(false); | |
153 } | |
154 if (markers->end - markers->start != end - start) { | |
155 showSequenceUnderInvalidationError( | |
156 "under-invalidation: new subsequence wrong length", client, start, | |
157 end); | |
158 DCHECK(false); | |
159 } | |
160 } | |
161 | |
162 DCHECK(m_newCachedSubsequences.find(&client) == | |
163 m_newCachedSubsequences.end()); | |
164 | |
165 m_newCachedSubsequences.insert(&client, SubsequenceMarkers(start, end)); | |
Xianzhu
2017/04/05 22:39:17
I'm afraid this may degrade performance. Previousl
chrishtr
2017/04/06 00:05:29
Ok.
You're right about indexing, but OTOH there a
| |
166 } | |
167 | |
128 bool PaintController::lastDisplayItemIsNoopBegin() const { | 168 bool PaintController::lastDisplayItemIsNoopBegin() const { |
129 if (m_newDisplayItemList.isEmpty()) | 169 if (m_newDisplayItemList.isEmpty()) |
130 return false; | 170 return false; |
131 | 171 |
132 const auto& lastDisplayItem = m_newDisplayItemList.last(); | 172 const auto& lastDisplayItem = m_newDisplayItemList.last(); |
133 return lastDisplayItem.isBegin() && !lastDisplayItem.drawsContent(); | 173 return lastDisplayItem.isBegin() && !lastDisplayItem.drawsContent(); |
134 } | 174 } |
135 | 175 |
136 void PaintController::removeLastDisplayItem() { | 176 void PaintController::removeLastDisplayItem() { |
137 if (m_newDisplayItemList.isEmpty()) | 177 if (m_newDisplayItemList.isEmpty()) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
172 | 212 |
173 void PaintController::processNewItem(DisplayItem& displayItem) { | 213 void PaintController::processNewItem(DisplayItem& displayItem) { |
174 DCHECK(!m_constructionDisabled); | 214 DCHECK(!m_constructionDisabled); |
175 | 215 |
176 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 216 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
177 if (!isSkippingCache()) { | 217 if (!isSkippingCache()) { |
178 if (displayItem.isCacheable()) { | 218 if (displayItem.isCacheable()) { |
179 // Mark the client shouldKeepAlive under this PaintController. | 219 // Mark the client shouldKeepAlive under this PaintController. |
180 // The status will end after the new display items are committed. | 220 // The status will end after the new display items are committed. |
181 displayItem.client().beginShouldKeepAlive(this); | 221 displayItem.client().beginShouldKeepAlive(this); |
182 | |
183 if (!m_currentSubsequenceClients.isEmpty()) { | |
184 // Mark the client shouldKeepAlive under the current subsequence. | |
185 // The status will end when the subsequence owner is invalidated or | |
186 // deleted. | |
187 displayItem.client().beginShouldKeepAlive( | |
188 m_currentSubsequenceClients.back()); | |
189 } | |
190 } | |
191 | |
192 if (displayItem.getType() == DisplayItem::kSubsequence) { | |
193 m_currentSubsequenceClients.push_back(&displayItem.client()); | |
194 } else if (displayItem.getType() == DisplayItem::kEndSubsequence) { | |
195 CHECK(m_currentSubsequenceClients.back() == &displayItem.client()); | |
196 m_currentSubsequenceClients.pop_back(); | |
197 } | 222 } |
198 } | 223 } |
199 #endif | 224 #endif |
200 | 225 |
201 if (isSkippingCache()) | 226 if (isSkippingCache()) |
202 displayItem.setSkippedCache(); | 227 displayItem.setSkippedCache(); |
203 | 228 |
204 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 229 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
205 size_t lastChunkIndex = m_newPaintChunks.lastChunkIndex(); | 230 size_t lastChunkIndex = m_newPaintChunks.lastChunkIndex(); |
206 if (m_newPaintChunks.incrementDisplayItemIndex(displayItem)) { | 231 if (m_newPaintChunks.incrementDisplayItemIndex(displayItem)) { |
207 DCHECK(lastChunkIndex != m_newPaintChunks.lastChunkIndex()); | 232 DCHECK(lastChunkIndex != m_newPaintChunks.lastChunkIndex()); |
208 if (lastChunkIndex != kNotFound) | 233 if (lastChunkIndex != kNotFound) |
209 generateChunkRasterInvalidationRects( | 234 generateChunkRasterInvalidationRects( |
210 m_newPaintChunks.paintChunkAt(lastChunkIndex)); | 235 m_newPaintChunks.paintChunkAt(lastChunkIndex)); |
211 } | 236 } |
212 } | 237 } |
213 | 238 |
214 #if DCHECK_IS_ON() | 239 #if DCHECK_IS_ON() |
215 // Verify noop begin/end pairs have been removed. | 240 // Verify noop begin/end pairs have been removed. |
216 if (m_newDisplayItemList.size() >= 2 && displayItem.isEnd()) { | 241 if (m_newDisplayItemList.size() >= 2 && displayItem.isEnd()) { |
217 const auto& beginDisplayItem = | 242 const auto& beginDisplayItem = |
218 m_newDisplayItemList[m_newDisplayItemList.size() - 2]; | 243 m_newDisplayItemList[m_newDisplayItemList.size() - 2]; |
219 if (beginDisplayItem.isBegin() && | 244 if (beginDisplayItem.isBegin() && |
220 beginDisplayItem.getType() != DisplayItem::kSubsequence && | |
221 !beginDisplayItem.drawsContent()) | 245 !beginDisplayItem.drawsContent()) |
222 DCHECK(!displayItem.isEndAndPairedWith(beginDisplayItem.getType())); | 246 DCHECK(!displayItem.isEndAndPairedWith(beginDisplayItem.getType())); |
223 } | 247 } |
224 | 248 |
225 size_t index = findMatchingItemFromIndex(displayItem.getId(), | 249 size_t index = findMatchingItemFromIndex(displayItem.getId(), |
226 m_newDisplayItemIndicesByClient, | 250 m_newDisplayItemIndicesByClient, |
227 m_newDisplayItemList); | 251 m_newDisplayItemList); |
228 if (index != kNotFound) { | 252 if (index != kNotFound) { |
229 #ifndef NDEBUG | 253 #ifndef NDEBUG |
230 showDebugData(); | 254 showDebugData(); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
386 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) | 410 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) |
387 CHECK(false) << "Can't find cached display item"; | 411 CHECK(false) << "Can't find cached display item"; |
388 | 412 |
389 // We did not find the cached display item. This should be impossible, but may | 413 // We did not find the cached display item. This should be impossible, but may |
390 // occur if there is a bug in the system, such as under-invalidation, | 414 // occur if there is a bug in the system, such as under-invalidation, |
391 // incorrect cache checking or duplicate display ids. In this case, the caller | 415 // incorrect cache checking or duplicate display ids. In this case, the caller |
392 // should fall back to repaint the display item. | 416 // should fall back to repaint the display item. |
393 return kNotFound; | 417 return kNotFound; |
394 } | 418 } |
395 | 419 |
396 // Copies a cached subsequence from current list to the new list. On return, | 420 // Copies a cached subsequence from current list to the new list. |
397 // |cachedItemIndex| points to the item after the EndSubsequence item of the | 421 // When paintUnderInvaldiationCheckingEnabled() we'll not actually |
398 // subsequence. When paintUnderInvaldiationCheckingEnabled() we'll not actually | |
399 // copy the subsequence, but mark the begin and end of the subsequence for | 422 // copy the subsequence, but mark the begin and end of the subsequence for |
400 // under-invalidation checking. | 423 // under-invalidation checking. |
401 void PaintController::copyCachedSubsequence(size_t& cachedItemIndex) { | 424 void PaintController::copyCachedSubsequence(size_t beginIndex, |
425 size_t endIndex) { | |
402 AutoReset<size_t> subsequenceBeginIndex( | 426 AutoReset<size_t> subsequenceBeginIndex( |
403 &m_currentCachedSubsequenceBeginIndexInNewList, | 427 &m_currentCachedSubsequenceBeginIndexInNewList, |
404 m_newDisplayItemList.size()); | 428 m_newDisplayItemList.size()); |
405 DisplayItem* cachedItem = | 429 DisplayItem* cachedItem = |
406 &m_currentPaintArtifact.getDisplayItemList()[cachedItemIndex]; | 430 &m_currentPaintArtifact.getDisplayItemList()[beginIndex]; |
407 DCHECK(cachedItem->getType() == DisplayItem::kSubsequence); | |
408 | 431 |
409 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) { | 432 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) { |
410 DCHECK(!isCheckingUnderInvalidation()); | 433 DCHECK(!isCheckingUnderInvalidation()); |
411 m_underInvalidationCheckingBegin = cachedItemIndex; | 434 m_underInvalidationCheckingBegin = beginIndex; |
412 m_underInvalidationMessagePrefix = | 435 m_underInvalidationMessagePrefix = |
413 "(In cached subsequence of " + cachedItem->client().debugName() + ")"; | 436 "(In cached subsequence of " + cachedItem->client().debugName() + ")"; |
414 } | 437 } |
415 | 438 |
416 DisplayItem::Id endSubsequenceId(cachedItem->client(), | |
417 DisplayItem::kEndSubsequence); | |
418 Vector<PaintChunk>::const_iterator cachedChunk; | 439 Vector<PaintChunk>::const_iterator cachedChunk; |
419 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 440 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
420 cachedChunk = | 441 cachedChunk = |
421 m_currentPaintArtifact.findChunkByDisplayItemIndex(cachedItemIndex); | 442 m_currentPaintArtifact.findChunkByDisplayItemIndex(beginIndex); |
422 DCHECK(cachedChunk != m_currentPaintArtifact.paintChunks().end()); | 443 DCHECK(cachedChunk != m_currentPaintArtifact.paintChunks().end()); |
423 updateCurrentPaintChunkProperties( | 444 updateCurrentPaintChunkProperties( |
424 cachedChunk->id ? &*cachedChunk->id : nullptr, cachedChunk->properties); | 445 cachedChunk->id ? &*cachedChunk->id : nullptr, cachedChunk->properties); |
425 } else { | 446 } else { |
426 // Avoid uninitialized variable error on Windows. | 447 // Avoid uninitialized variable error on Windows. |
427 cachedChunk = m_currentPaintArtifact.paintChunks().begin(); | 448 cachedChunk = m_currentPaintArtifact.paintChunks().begin(); |
428 } | 449 } |
429 | 450 |
430 while (true) { | 451 for (size_t currentIndex = beginIndex; currentIndex <= endIndex; |
452 ++currentIndex) { | |
453 cachedItem = &m_currentPaintArtifact.getDisplayItemList()[currentIndex]; | |
431 DCHECK(cachedItem->hasValidClient()); | 454 DCHECK(cachedItem->hasValidClient()); |
432 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 455 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
433 CHECK(cachedItem->client().isAlive()); | 456 CHECK(cachedItem->client().isAlive()); |
434 #endif | 457 #endif |
435 ++m_numCachedNewItems; | 458 ++m_numCachedNewItems; |
436 bool metEndSubsequence = cachedItem->getId() == endSubsequenceId; | |
437 if (!RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) { | 459 if (!RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) { |
438 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && | 460 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && |
439 cachedItemIndex == cachedChunk->endIndex) { | 461 currentIndex == cachedChunk->endIndex) { |
440 ++cachedChunk; | 462 ++cachedChunk; |
441 DCHECK(cachedChunk != m_currentPaintArtifact.paintChunks().end()); | 463 DCHECK(cachedChunk != m_currentPaintArtifact.paintChunks().end()); |
442 updateCurrentPaintChunkProperties( | 464 updateCurrentPaintChunkProperties( |
443 cachedChunk->id ? &*cachedChunk->id : nullptr, | 465 cachedChunk->id ? &*cachedChunk->id : nullptr, |
444 cachedChunk->properties); | 466 cachedChunk->properties); |
445 } | 467 } |
446 processNewItem(moveItemFromCurrentListToNewList(cachedItemIndex)); | 468 processNewItem(moveItemFromCurrentListToNewList(currentIndex)); |
447 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 469 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
448 DCHECK((!m_newPaintChunks.lastChunk().id && !cachedChunk->id) || | 470 DCHECK((!m_newPaintChunks.lastChunk().id && !cachedChunk->id) || |
449 m_newPaintChunks.lastChunk().matches(*cachedChunk)); | 471 m_newPaintChunks.lastChunk().matches(*cachedChunk)); |
450 } | 472 } |
451 | |
452 ++cachedItemIndex; | |
453 if (metEndSubsequence) | |
454 break; | |
455 | |
456 // We should always be able to find the EndSubsequence display item. | |
457 DCHECK(cachedItemIndex < | |
458 m_currentPaintArtifact.getDisplayItemList().size()); | |
459 cachedItem = &m_currentPaintArtifact.getDisplayItemList()[cachedItemIndex]; | |
460 } | 473 } |
461 | 474 |
462 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) { | 475 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) { |
463 m_underInvalidationCheckingEnd = cachedItemIndex; | 476 m_underInvalidationCheckingEnd = endIndex + 1; |
464 DCHECK(isCheckingUnderInvalidation()); | 477 DCHECK(isCheckingUnderInvalidation()); |
465 } | 478 } |
466 } | 479 } |
467 | 480 |
468 DISABLE_CFI_PERF | 481 DISABLE_CFI_PERF |
469 static IntRect visualRectForDisplayItem( | 482 static IntRect visualRectForDisplayItem( |
470 const DisplayItem& displayItem, | 483 const DisplayItem& displayItem, |
471 const LayoutSize& offsetFromLayoutObject) { | 484 const LayoutSize& offsetFromLayoutObject) { |
472 LayoutRect visualRect = displayItem.client().visualRect(); | 485 LayoutRect visualRect = displayItem.client().visualRect(); |
473 visualRect.move(-offsetFromLayoutObject); | 486 visualRect.move(-offsetFromLayoutObject); |
(...skipping 26 matching lines...) Expand all Loading... | |
500 #endif | 513 #endif |
501 | 514 |
502 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && | 515 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && |
503 !m_newDisplayItemList.isEmpty()) | 516 !m_newDisplayItemList.isEmpty()) |
504 generateChunkRasterInvalidationRects(m_newPaintChunks.lastChunk()); | 517 generateChunkRasterInvalidationRects(m_newPaintChunks.lastChunk()); |
505 | 518 |
506 SkPictureGpuAnalyzer gpuAnalyzer; | 519 SkPictureGpuAnalyzer gpuAnalyzer; |
507 | 520 |
508 m_currentCacheGeneration = | 521 m_currentCacheGeneration = |
509 DisplayItemClient::CacheGenerationOrInvalidationReason::next(); | 522 DisplayItemClient::CacheGenerationOrInvalidationReason::next(); |
523 | |
524 m_newCachedSubsequences.swap(m_currentCachedSubsequences); | |
525 m_newCachedSubsequences.clear(); | |
526 for (auto& item : m_currentCachedSubsequences) | |
527 item.key->setDisplayItemsCached(m_currentCacheGeneration); | |
528 | |
510 Vector<const DisplayItemClient*> skippedCacheClients; | 529 Vector<const DisplayItemClient*> skippedCacheClients; |
511 for (const auto& item : m_newDisplayItemList) { | 530 for (const auto& item : m_newDisplayItemList) { |
512 // No reason to continue the analysis once we have a veto. | 531 // No reason to continue the analysis once we have a veto. |
513 if (gpuAnalyzer.suitableForGpuRasterization()) | 532 if (gpuAnalyzer.suitableForGpuRasterization()) |
514 item.analyzeForGpuRasterization(gpuAnalyzer); | 533 item.analyzeForGpuRasterization(gpuAnalyzer); |
515 | 534 |
516 // TODO(wkorman): Only compute and append visual rect for drawings. | 535 // TODO(wkorman): Only compute and append visual rect for drawings. |
517 m_newDisplayItemList.appendVisualRect( | 536 m_newDisplayItemList.appendVisualRect( |
518 visualRectForDisplayItem(item, offsetFromLayoutObject)); | 537 visualRectForDisplayItem(item, offsetFromLayoutObject)); |
519 | 538 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
559 for (const auto& chunk : m_currentPaintArtifact.paintChunks()) { | 578 for (const auto& chunk : m_currentPaintArtifact.paintChunks()) { |
560 if (chunk.id && chunk.id->client.isJustCreated()) | 579 if (chunk.id && chunk.id->client.isJustCreated()) |
561 chunk.id->client.clearIsJustCreated(); | 580 chunk.id->client.clearIsJustCreated(); |
562 } | 581 } |
563 } | 582 } |
564 | 583 |
565 // We'll allocate the initial buffer when we start the next paint. | 584 // We'll allocate the initial buffer when we start the next paint. |
566 m_newDisplayItemList = DisplayItemList(0); | 585 m_newDisplayItemList = DisplayItemList(0); |
567 | 586 |
568 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 587 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
569 CHECK(m_currentSubsequenceClients.isEmpty()); | |
570 DisplayItemClient::endShouldKeepAliveAllClients(this); | 588 DisplayItemClient::endShouldKeepAliveAllClients(this); |
571 #endif | 589 #endif |
572 | 590 |
573 #ifndef NDEBUG | 591 #ifndef NDEBUG |
574 m_numSequentialMatches = 0; | 592 m_numSequentialMatches = 0; |
575 m_numOutOfOrderMatches = 0; | 593 m_numOutOfOrderMatches = 0; |
576 m_numIndexedItems = 0; | 594 m_numIndexedItems = 0; |
577 #endif | 595 #endif |
578 } | 596 } |
579 | 597 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
778 } | 796 } |
779 LOG(INFO) << "new record:\n" | 797 LOG(INFO) << "new record:\n" |
780 << (newRecord ? recordAsDebugString(newRecord) : "None"); | 798 << (newRecord ? recordAsDebugString(newRecord) : "None"); |
781 LOG(INFO) << "old record:\n" | 799 LOG(INFO) << "old record:\n" |
782 << (oldRecord ? recordAsDebugString(oldRecord) : "None"); | 800 << (oldRecord ? recordAsDebugString(oldRecord) : "None"); |
783 | 801 |
784 showDebugData(); | 802 showDebugData(); |
785 #endif // NDEBUG | 803 #endif // NDEBUG |
786 } | 804 } |
787 | 805 |
806 void PaintController::showSequenceUnderInvalidationError( | |
807 const char* reason, | |
808 const DisplayItemClient& client, | |
809 int start, | |
810 int end) { | |
811 LOG(ERROR) << m_underInvalidationMessagePrefix << " " << reason; | |
812 LOG(ERROR) << "Subsequence client: " << client.debugName(); | |
813 #ifndef NDEBUG | |
814 // showDebugData(); | |
815 #else | |
816 LOG(ERROR) << "Run debug build to get more details."; | |
817 #endif | |
818 LOG(ERROR) << "See http://crbug.com/619103."; | |
819 } | |
820 | |
788 void PaintController::checkUnderInvalidation() { | 821 void PaintController::checkUnderInvalidation() { |
789 DCHECK(RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()); | 822 DCHECK(RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()); |
790 | 823 |
791 if (!isCheckingUnderInvalidation()) | 824 if (!isCheckingUnderInvalidation()) |
792 return; | 825 return; |
793 | 826 |
794 const DisplayItem& newItem = m_newDisplayItemList.last(); | 827 const DisplayItem& newItem = m_newDisplayItemList.last(); |
795 size_t oldItemIndex = m_underInvalidationCheckingBegin + | 828 size_t oldItemIndex = m_underInvalidationCheckingBegin + |
796 m_skippedProbableUnderInvalidationCount; | 829 m_skippedProbableUnderInvalidationCount; |
797 DisplayItem* oldItem = | 830 DisplayItem* oldItem = |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
863 showPaintRecords | 896 showPaintRecords |
864 ? (DisplayItemList::JsonOptions::ShowPaintRecords | | 897 ? (DisplayItemList::JsonOptions::ShowPaintRecords | |
865 DisplayItemList::JsonOptions::ShowClientDebugName) | 898 DisplayItemList::JsonOptions::ShowClientDebugName) |
866 : DisplayItemList::JsonOptions::ShowClientDebugName) | 899 : DisplayItemList::JsonOptions::ShowClientDebugName) |
867 ->toPrettyJSONString() | 900 ->toPrettyJSONString() |
868 .utf8() | 901 .utf8() |
869 .data()); | 902 .data()); |
870 } | 903 } |
871 | 904 |
872 } // namespace blink | 905 } // namespace blink |
OLD | NEW |