OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/PaintArtifact.h" | 5 #include "platform/graphics/paint/PaintArtifact.h" |
6 | 6 |
7 #include "cc/paint/display_item_list.h" | 7 #include "cc/paint/display_item_list.h" |
8 #include "platform/geometry/IntRect.h" | 8 #include "platform/geometry/IntRect.h" |
9 #include "platform/graphics/GraphicsLayer.h" | 9 #include "platform/graphics/GraphicsLayer.h" |
10 #include "platform/graphics/compositing/PaintChunksToCcLayer.h" | 10 #include "platform/graphics/compositing/PaintChunksToCcLayer.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // references into pointers. | 110 // references into pointers. |
111 for (const auto& chunk : PaintChunks()) | 111 for (const auto& chunk : PaintChunks()) |
112 pointer_paint_chunks.push_back(&chunk); | 112 pointer_paint_chunks.push_back(&chunk); |
113 scoped_refptr<cc::DisplayItemList> display_item_list = | 113 scoped_refptr<cc::DisplayItemList> display_item_list = |
114 PaintChunksToCcLayer::Convert(pointer_paint_chunks, replay_state, | 114 PaintChunksToCcLayer::Convert(pointer_paint_chunks, replay_state, |
115 gfx::Vector2dF(), GetDisplayItemList()); | 115 gfx::Vector2dF(), GetDisplayItemList()); |
116 canvas.drawDisplayItemList(display_item_list); | 116 canvas.drawDisplayItemList(display_item_list); |
117 } | 117 } |
118 | 118 |
119 DISABLE_CFI_PERF | 119 DISABLE_CFI_PERF |
120 void PaintArtifact::AppendToWebDisplayItemList( | 120 void PaintArtifact::AppendToWebDisplayItemList(WebDisplayItemList* list) const { |
121 const LayoutSize& visual_rect_offset, | |
122 WebDisplayItemList* list) const { | |
123 TRACE_EVENT0("blink,benchmark", "PaintArtifact::appendToWebDisplayItemList"); | 121 TRACE_EVENT0("blink,benchmark", "PaintArtifact::appendToWebDisplayItemList"); |
124 for (const DisplayItem& item : display_item_list_) | 122 size_t visual_rect_index = 0; |
125 item.AppendToWebDisplayItemList(visual_rect_offset, list); | 123 for (const DisplayItem& display_item : display_item_list_) { |
| 124 display_item.AppendToWebDisplayItemList( |
| 125 display_item_list_.VisualRect(visual_rect_index), list); |
| 126 visual_rect_index++; |
| 127 } |
126 list->SetIsSuitableForGpuRasterization(IsSuitableForGpuRasterization()); | 128 list->SetIsSuitableForGpuRasterization(IsSuitableForGpuRasterization()); |
127 } | 129 } |
128 | 130 |
129 } // namespace blink | 131 } // namespace blink |
OLD | NEW |