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

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

Issue 2798513002: Revert of Make GeometryMapper fully static (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } else { 93 } else {
94 replay(bounds, *graphicsContext.canvas()); 94 replay(bounds, *graphicsContext.canvas());
95 } 95 }
96 } 96 }
97 97
98 void PaintArtifact::replay(const FloatRect& bounds, 98 void PaintArtifact::replay(const FloatRect& bounds,
99 PaintCanvas& canvas, 99 PaintCanvas& canvas,
100 const PropertyTreeState& replayState) const { 100 const PropertyTreeState& replayState) const {
101 TRACE_EVENT0("blink,benchmark", "PaintArtifact::replay"); 101 TRACE_EVENT0("blink,benchmark", "PaintArtifact::replay");
102 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 102 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
103 std::unique_ptr<GeometryMapper> geometryMapper = GeometryMapper::create();
103 Vector<const PaintChunk*> pointerPaintChunks; 104 Vector<const PaintChunk*> pointerPaintChunks;
104 pointerPaintChunks.reserveInitialCapacity(paintChunks().size()); 105 pointerPaintChunks.reserveInitialCapacity(paintChunks().size());
105 106
106 // TODO(chrishtr): it's sad to have to copy this vector just to turn 107 // TODO(chrishtr): it's sad to have to copy this vector just to turn
107 // references into pointers. 108 // references into pointers.
108 for (const auto& chunk : paintChunks()) 109 for (const auto& chunk : paintChunks())
109 pointerPaintChunks.push_back(&chunk); 110 pointerPaintChunks.push_back(&chunk);
110 scoped_refptr<cc::DisplayItemList> displayItemList = 111 scoped_refptr<cc::DisplayItemList> displayItemList =
111 PaintChunksToCcLayer::convert(pointerPaintChunks, replayState, 112 PaintChunksToCcLayer::convert(pointerPaintChunks, replayState,
112 gfx::Vector2dF(), getDisplayItemList()); 113 gfx::Vector2dF(), getDisplayItemList(),
114 *geometryMapper);
113 canvas.drawDisplayItemList(displayItemList); 115 canvas.drawDisplayItemList(displayItemList);
114 } 116 }
115 117
116 DISABLE_CFI_PERF 118 DISABLE_CFI_PERF
117 void PaintArtifact::appendToWebDisplayItemList(WebDisplayItemList* list) const { 119 void PaintArtifact::appendToWebDisplayItemList(WebDisplayItemList* list) const {
118 TRACE_EVENT0("blink,benchmark", "PaintArtifact::appendToWebDisplayItemList"); 120 TRACE_EVENT0("blink,benchmark", "PaintArtifact::appendToWebDisplayItemList");
119 size_t visualRectIndex = 0; 121 size_t visualRectIndex = 0;
120 for (const DisplayItem& displayItem : m_displayItemList) { 122 for (const DisplayItem& displayItem : m_displayItemList) {
121 displayItem.appendToWebDisplayItemList( 123 displayItem.appendToWebDisplayItemList(
122 m_displayItemList.visualRect(visualRectIndex), list); 124 m_displayItemList.visualRect(visualRectIndex), list);
123 visualRectIndex++; 125 visualRectIndex++;
124 } 126 }
125 list->setIsSuitableForGpuRasterization(isSuitableForGpuRasterization()); 127 list->setIsSuitableForGpuRasterization(isSuitableForGpuRasterization());
126 } 128 }
127 129
128 } // namespace blink 130 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698