| 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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 // the rounded clips vector in ClipDisplayItem, which is not expected to | 518 // the rounded clips vector in ClipDisplayItem, which is not expected to |
| 519 // contribute significantly to memory usage. | 519 // contribute significantly to memory usage. |
| 520 | 520 |
| 521 // Memory outside this class due to m_newDisplayItemList. | 521 // Memory outside this class due to m_newDisplayItemList. |
| 522 DCHECK(m_newDisplayItemList.isEmpty()); | 522 DCHECK(m_newDisplayItemList.isEmpty()); |
| 523 memoryUsage += m_newDisplayItemList.memoryUsageInBytes(); | 523 memoryUsage += m_newDisplayItemList.memoryUsageInBytes(); |
| 524 | 524 |
| 525 return memoryUsage; | 525 return memoryUsage; |
| 526 } | 526 } |
| 527 | 527 |
| 528 void PaintController::appendDebugDrawingAfterCommit(const DisplayItemClient& dis
playItemClient, PassRefPtr<SkPicture> picture, const LayoutSize& offsetFromLayou
tObject) | 528 void PaintController::appendDebugDrawingAfterCommit(const DisplayItemClient& dis
playItemClient, sk_sp<SkPicture> picture, const LayoutSize& offsetFromLayoutObje
ct) |
| 529 { | 529 { |
| 530 DCHECK(m_newDisplayItemList.isEmpty()); | 530 DCHECK(m_newDisplayItemList.isEmpty()); |
| 531 DrawingDisplayItem& displayItem = m_currentPaintArtifact.getDisplayItemList(
).allocateAndConstruct<DrawingDisplayItem>(displayItemClient, DisplayItem::kDebu
gDrawing, picture); | 531 DrawingDisplayItem& displayItem = m_currentPaintArtifact.getDisplayItemList(
).allocateAndConstruct<DrawingDisplayItem>(displayItemClient, DisplayItem::kDebu
gDrawing, std::move(picture)); |
| 532 displayItem.setSkippedCache(); | 532 displayItem.setSkippedCache(); |
| 533 // TODO(wkorman): Only compute and append visual rect for drawings. | 533 // TODO(wkorman): Only compute and append visual rect for drawings. |
| 534 m_currentPaintArtifact.getDisplayItemList().appendVisualRect(visualRectForDi
splayItem(displayItem, offsetFromLayoutObject)); | 534 m_currentPaintArtifact.getDisplayItemList().appendVisualRect(visualRectForDi
splayItem(displayItem, offsetFromLayoutObject)); |
| 535 } | 535 } |
| 536 | 536 |
| 537 void PaintController::generateChunkRasterInvalidationRects(PaintChunk& newChunk) | 537 void PaintController::generateChunkRasterInvalidationRects(PaintChunk& newChunk) |
| 538 { | 538 { |
| 539 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 539 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| 540 if (m_currentChunkIsFromCachedSubsequence) | 540 if (m_currentChunkIsFromCachedSubsequence) |
| 541 return; | 541 return; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 return stringBuilder.toString(); | 722 return stringBuilder.toString(); |
| 723 } | 723 } |
| 724 | 724 |
| 725 void PaintController::showDebugData() const | 725 void PaintController::showDebugData() const |
| 726 { | 726 { |
| 727 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri
ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data()); | 727 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri
ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data()); |
| 728 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m
_newDisplayItemList).utf8().data()); | 728 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m
_newDisplayItemList).utf8().data()); |
| 729 } | 729 } |
| 730 | 730 |
| 731 } // namespace blink | 731 } // namespace blink |
| OLD | NEW |