| 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 for (const DisplayItem& displayItem : m_currentPaintArtifact.getDisplayItemL
ist()) { | 409 for (const DisplayItem& displayItem : m_currentPaintArtifact.getDisplayItemL
ist()) { |
| 410 if (!displayItem.isCacheable()) | 410 if (!displayItem.isCacheable()) |
| 411 continue; | 411 continue; |
| 412 displayItem.client().setDisplayItemsCached(m_currentCacheGeneration); | 412 displayItem.client().setDisplayItemsCached(m_currentCacheGeneration); |
| 413 } | 413 } |
| 414 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 414 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
| 415 DisplayItemClient::endShouldKeepAliveAllClients(this); | 415 DisplayItemClient::endShouldKeepAliveAllClients(this); |
| 416 #endif | 416 #endif |
| 417 } | 417 } |
| 418 | 418 |
| 419 void PaintController::appendDebugDrawingAfterCommit(const DisplayItemClient& dis
playItemClient, PassRefPtr<SkPicture> picture, const LayoutSize& offsetFromLayou
tObject) |
| 420 { |
| 421 DCHECK(m_newDisplayItemList.isEmpty()); |
| 422 DrawingDisplayItem& displayItem = m_currentPaintArtifact.getDisplayItemList(
).allocateAndConstruct<DrawingDisplayItem>(displayItemClient, DisplayItem::Debug
Drawing, picture); |
| 423 displayItem.setSkippedCache(); |
| 424 m_currentPaintArtifact.getDisplayItemList().appendVisualRect(visualRectForDi
splayItem(displayItem, offsetFromLayoutObject)); |
| 425 } |
| 426 |
| 419 #if DCHECK_IS_ON() | 427 #if DCHECK_IS_ON() |
| 420 | 428 |
| 421 void PaintController::checkUnderInvalidation(DisplayItemList::iterator& newIt, D
isplayItemList::iterator& currentIt) | 429 void PaintController::checkUnderInvalidation(DisplayItemList::iterator& newIt, D
isplayItemList::iterator& currentIt) |
| 422 { | 430 { |
| 423 DCHECK(RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled
()); | 431 DCHECK(RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled
()); |
| 424 DCHECK(newIt->isCached()); | 432 DCHECK(newIt->isCached()); |
| 425 | 433 |
| 426 // When under-invalidation-checking is enabled, the forced painting is follo
wing the cached display item. | 434 // When under-invalidation-checking is enabled, the forced painting is follo
wing the cached display item. |
| 427 DisplayItem::Type nextItemType = DisplayItem::nonCachedType(newIt->getType()
); | 435 DisplayItem::Type nextItemType = DisplayItem::nonCachedType(newIt->getType()
); |
| 428 ++newIt; | 436 ++newIt; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 | 547 |
| 540 void PaintController::showDebugData() const | 548 void PaintController::showDebugData() const |
| 541 { | 549 { |
| 542 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri
ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data()); | 550 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri
ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data()); |
| 543 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m
_newDisplayItemList).utf8().data()); | 551 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m
_newDisplayItemList).utf8().data()); |
| 544 } | 552 } |
| 545 | 553 |
| 546 #endif // ifndef NDEBUG | 554 #endif // ifndef NDEBUG |
| 547 | 555 |
| 548 } // namespace blink | 556 } // namespace blink |
| OLD | NEW |