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

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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(WebDisplayItemList* list) const { 120 void PaintArtifact::AppendToWebDisplayItemList(
121 const LayoutSize& visual_rect_offset,
122 WebDisplayItemList* list) const {
121 TRACE_EVENT0("blink,benchmark", "PaintArtifact::appendToWebDisplayItemList"); 123 TRACE_EVENT0("blink,benchmark", "PaintArtifact::appendToWebDisplayItemList");
122 size_t visual_rect_index = 0; 124 for (const DisplayItem& item : display_item_list_)
123 for (const DisplayItem& display_item : display_item_list_) { 125 item.AppendToWebDisplayItemList(visual_rect_offset, list);
124 display_item.AppendToWebDisplayItemList(
125 display_item_list_.VisualRect(visual_rect_index), list);
126 visual_rect_index++;
127 }
128 list->SetIsSuitableForGpuRasterization(IsSuitableForGpuRasterization()); 126 list->SetIsSuitableForGpuRasterization(IsSuitableForGpuRasterization());
129 } 127 }
130 128
131 } // namespace blink 129 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698