Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp |
| diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp |
| index 920c745fe37b88d3cf555f6c12cf247802003884..d4311d6d3a2176fa0a1989755faff38fdfdaabef 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp |
| @@ -91,22 +91,28 @@ void PaintArtifact::replay(const FloatRect& bounds, |
| for (const DisplayItem& displayItem : m_displayItemList) |
| displayItem.replay(graphicsContext); |
| } else { |
| - std::unique_ptr<GeometryMapper> geometryMapper = GeometryMapper::create(); |
| - Vector<const PaintChunk*> pointerPaintChunks; |
| - pointerPaintChunks.reserveInitialCapacity(paintChunks().size()); |
| - |
| - // TODO(chrishtr): it's sad to have to copy this vector just to turn |
| - // references into pointers. |
| - for (const auto& chunk : paintChunks()) |
| - pointerPaintChunks.push_back(&chunk); |
| - scoped_refptr<cc::DisplayItemList> displayItemList = |
| - PaintChunksToCcLayer::convert( |
| - pointerPaintChunks, PropertyTreeState::root(), gfx::Vector2dF(), |
| - getDisplayItemList(), *geometryMapper); |
| - graphicsContext.canvas()->drawDisplayItemList(displayItemList); |
| + replay(bounds, *graphicsContext.canvas()); |
| } |
| } |
| +void PaintArtifact::replay(const FloatRect& bounds, PaintCanvas& canvas) const { |
| + TRACE_EVENT0("blink,benchmark", "PaintArtifact::replay"); |
| + DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| + std::unique_ptr<GeometryMapper> geometryMapper = GeometryMapper::create(); |
|
wkorman
2017/04/01 00:32:40
Separate from this change but commenting while rea
chrishtr
2017/04/01 04:05:25
A good question. I don't think there is a good rea
|
| + Vector<const PaintChunk*> pointerPaintChunks; |
| + pointerPaintChunks.reserveInitialCapacity(paintChunks().size()); |
| + |
| + // TODO(chrishtr): it's sad to have to copy this vector just to turn |
| + // references into pointers. |
| + for (const auto& chunk : paintChunks()) |
| + pointerPaintChunks.push_back(&chunk); |
| + scoped_refptr<cc::DisplayItemList> displayItemList = |
| + PaintChunksToCcLayer::convert(pointerPaintChunks, |
| + PropertyTreeState::root(), gfx::Vector2dF(), |
| + getDisplayItemList(), *geometryMapper); |
| + canvas.drawDisplayItemList(displayItemList); |
| +} |
| + |
| DISABLE_CFI_PERF |
| void PaintArtifact::appendToWebDisplayItemList(WebDisplayItemList* list) const { |
| TRACE_EVENT0("blink,benchmark", "PaintArtifact::appendToWebDisplayItemList"); |