| 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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 if (item.isCacheable()) { | 520 if (item.isCacheable()) { |
| 521 item.client().setDisplayItemsCached(m_currentCacheGeneration); | 521 item.client().setDisplayItemsCached(m_currentCacheGeneration); |
| 522 } else { | 522 } else { |
| 523 if (item.client().isJustCreated()) | 523 if (item.client().isJustCreated()) |
| 524 item.client().clearIsJustCreated(); | 524 item.client().clearIsJustCreated(); |
| 525 if (item.skippedCache()) | 525 if (item.skippedCache()) |
| 526 skippedCacheClients.push_back(&item.client()); | 526 skippedCacheClients.push_back(&item.client()); |
| 527 } | 527 } |
| 528 } | 528 } |
| 529 | 529 |
| 530 if (!m_firstPainted) { |
| 531 for (const auto& item : m_newDisplayItemList) { |
| 532 if (item.isDrawing() && |
| 533 // Here we ignore all document-background paintings because we don't |
| 534 // know if the background is default. ViewPainter should have called |
| 535 // setFirstPainted() if this display item is for non-default |
| 536 // background. |
| 537 item.getType() != DisplayItem::kDocumentBackground && |
| 538 item.drawsContent()) { |
| 539 m_firstPainted = true; |
| 540 break; |
| 541 } |
| 542 } |
| 543 } |
| 544 |
| 530 for (auto* client : skippedCacheClients) | 545 for (auto* client : skippedCacheClients) |
| 531 client->setDisplayItemsUncached(); | 546 client->setDisplayItemsUncached(); |
| 532 | 547 |
| 533 // The new list will not be appended to again so we can release unused memory. | 548 // The new list will not be appended to again so we can release unused memory. |
| 534 m_newDisplayItemList.shrinkToFit(); | 549 m_newDisplayItemList.shrinkToFit(); |
| 535 m_currentPaintArtifact = PaintArtifact( | 550 m_currentPaintArtifact = PaintArtifact( |
| 536 std::move(m_newDisplayItemList), m_newPaintChunks.releasePaintChunks(), | 551 std::move(m_newDisplayItemList), m_newPaintChunks.releasePaintChunks(), |
| 537 gpuAnalyzer.suitableForGpuRasterization()); | 552 gpuAnalyzer.suitableForGpuRasterization()); |
| 538 resetCurrentListIndices(); | 553 resetCurrentListIndices(); |
| 539 m_outOfOrderItemIndices.clear(); | 554 m_outOfOrderItemIndices.clear(); |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 0, m_newDisplayItemList.size(), | 861 0, m_newDisplayItemList.size(), |
| 847 showPictures ? (DisplayItemList::JsonOptions::ShowPictures | | 862 showPictures ? (DisplayItemList::JsonOptions::ShowPictures | |
| 848 DisplayItemList::JsonOptions::ShowClientDebugName) | 863 DisplayItemList::JsonOptions::ShowClientDebugName) |
| 849 : DisplayItemList::JsonOptions::ShowClientDebugName) | 864 : DisplayItemList::JsonOptions::ShowClientDebugName) |
| 850 ->toPrettyJSONString() | 865 ->toPrettyJSONString() |
| 851 .utf8() | 866 .utf8() |
| 852 .data()); | 867 .data()); |
| 853 } | 868 } |
| 854 | 869 |
| 855 } // namespace blink | 870 } // namespace blink |
| OLD | NEW |