Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp

Issue 2894093002: Don't access DisplayItemClient::VisualRect() for cached display items. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // references into pointers. 108 // references into pointers.
109 for (const auto& chunk : PaintChunks()) 109 for (const auto& chunk : PaintChunks())
110 pointer_paint_chunks.push_back(&chunk); 110 pointer_paint_chunks.push_back(&chunk);
111 scoped_refptr<cc::DisplayItemList> display_item_list = 111 scoped_refptr<cc::DisplayItemList> display_item_list =
112 PaintChunksToCcLayer::Convert(pointer_paint_chunks, replay_state, 112 PaintChunksToCcLayer::Convert(pointer_paint_chunks, replay_state,
113 gfx::Vector2dF(), GetDisplayItemList()); 113 gfx::Vector2dF(), GetDisplayItemList());
114 canvas.drawDisplayItemList(display_item_list); 114 canvas.drawDisplayItemList(display_item_list);
115 } 115 }
116 116
117 DISABLE_CFI_PERF 117 DISABLE_CFI_PERF
118 void PaintArtifact::AppendToWebDisplayItemList(WebDisplayItemList* list) const { 118 void PaintArtifact::AppendToWebDisplayItemList(
119 const LayoutSize& visual_rect_offset,
120 WebDisplayItemList* list) const {
119 TRACE_EVENT0("blink,benchmark", "PaintArtifact::appendToWebDisplayItemList"); 121 TRACE_EVENT0("blink,benchmark", "PaintArtifact::appendToWebDisplayItemList");
120 size_t visual_rect_index = 0; 122 for (const DisplayItem& item : display_item_list_)
121 for (const DisplayItem& display_item : display_item_list_) { 123 item.AppendToWebDisplayItemList(visual_rect_offset, list);
122 display_item.AppendToWebDisplayItemList(
123 display_item_list_.VisualRect(visual_rect_index), list);
124 visual_rect_index++;
125 }
126 list->SetIsSuitableForGpuRasterization(IsSuitableForGpuRasterization()); 124 list->SetIsSuitableForGpuRasterization(IsSuitableForGpuRasterization());
127 } 125 }
128 126
129 } // namespace blink 127 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698