| 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/tracing/TraceEvent.h" | 9 #include "platform/tracing/TraceEvent.h" |
| 10 #include "third_party/skia/include/core/SkPictureAnalyzer.h" | 10 #include "third_party/skia/include/core/SkPictureAnalyzer.h" |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 m_currentPaintArtifact.getDisplayItemList().size()); | 458 m_currentPaintArtifact.getDisplayItemList().size()); |
| 459 cachedItem = &m_currentPaintArtifact.getDisplayItemList()[cachedItemIndex]; | 459 cachedItem = &m_currentPaintArtifact.getDisplayItemList()[cachedItemIndex]; |
| 460 } | 460 } |
| 461 | 461 |
| 462 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) { | 462 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) { |
| 463 m_underInvalidationCheckingEnd = cachedItemIndex; | 463 m_underInvalidationCheckingEnd = cachedItemIndex; |
| 464 DCHECK(isCheckingUnderInvalidation()); | 464 DCHECK(isCheckingUnderInvalidation()); |
| 465 } | 465 } |
| 466 } | 466 } |
| 467 | 467 |
| 468 DISABLE_CFI_PERF |
| 468 static IntRect visualRectForDisplayItem( | 469 static IntRect visualRectForDisplayItem( |
| 469 const DisplayItem& displayItem, | 470 const DisplayItem& displayItem, |
| 470 const LayoutSize& offsetFromLayoutObject) { | 471 const LayoutSize& offsetFromLayoutObject) { |
| 471 LayoutRect visualRect = displayItem.client().visualRect(); | 472 LayoutRect visualRect = displayItem.client().visualRect(); |
| 472 visualRect.move(-offsetFromLayoutObject); | 473 visualRect.move(-offsetFromLayoutObject); |
| 473 return enclosingIntRect(visualRect); | 474 return enclosingIntRect(visualRect); |
| 474 } | 475 } |
| 475 | 476 |
| 476 void PaintController::resetCurrentListIndices() { | 477 void PaintController::resetCurrentListIndices() { |
| 477 m_nextItemToMatch = 0; | 478 m_nextItemToMatch = 0; |
| 478 m_nextItemToIndex = 0; | 479 m_nextItemToIndex = 0; |
| 479 m_nextChunkToMatch = 0; | 480 m_nextChunkToMatch = 0; |
| 480 m_underInvalidationCheckingBegin = 0; | 481 m_underInvalidationCheckingBegin = 0; |
| 481 m_underInvalidationCheckingEnd = 0; | 482 m_underInvalidationCheckingEnd = 0; |
| 482 m_skippedProbableUnderInvalidationCount = 0; | 483 m_skippedProbableUnderInvalidationCount = 0; |
| 483 } | 484 } |
| 484 | 485 |
| 486 DISABLE_CFI_PERF |
| 485 void PaintController::commitNewDisplayItems( | 487 void PaintController::commitNewDisplayItems( |
| 486 const LayoutSize& offsetFromLayoutObject) { | 488 const LayoutSize& offsetFromLayoutObject) { |
| 487 TRACE_EVENT2("blink,benchmark", "PaintController::commitNewDisplayItems", | 489 TRACE_EVENT2("blink,benchmark", "PaintController::commitNewDisplayItems", |
| 488 "current_display_list_size", | 490 "current_display_list_size", |
| 489 (int)m_currentPaintArtifact.getDisplayItemList().size(), | 491 (int)m_currentPaintArtifact.getDisplayItemList().size(), |
| 490 "num_non_cached_new_items", | 492 "num_non_cached_new_items", |
| 491 (int)m_newDisplayItemList.size() - m_numCachedNewItems); | 493 (int)m_newDisplayItemList.size() - m_numCachedNewItems); |
| 492 m_numCachedNewItems = 0; | 494 m_numCachedNewItems = 0; |
| 493 | 495 |
| 494 // These data structures are used during painting only. | 496 // These data structures are used during painting only. |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 m_currentPaintArtifact.getDisplayItemList(), showPictures) | 887 m_currentPaintArtifact.getDisplayItemList(), showPictures) |
| 886 .utf8() | 888 .utf8() |
| 887 .data()); | 889 .data()); |
| 888 WTFLogAlways("new display item list: [%s]\n", | 890 WTFLogAlways("new display item list: [%s]\n", |
| 889 displayItemListAsDebugString(m_newDisplayItemList, showPictures) | 891 displayItemListAsDebugString(m_newDisplayItemList, showPictures) |
| 890 .utf8() | 892 .utf8() |
| 891 .data()); | 893 .data()); |
| 892 } | 894 } |
| 893 | 895 |
| 894 } // namespace blink | 896 } // namespace blink |
| OLD | NEW |