| 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 8e1d79b9b1be2af718a1fb8673ec45805c9dee55..920c745fe37b88d3cf555f6c12cf247802003884 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp
|
| @@ -4,9 +4,12 @@
|
|
|
| #include "platform/graphics/paint/PaintArtifact.h"
|
|
|
| +#include "cc/paint/display_item_list.h"
|
| #include "platform/geometry/IntRect.h"
|
| #include "platform/graphics/GraphicsLayer.h"
|
| +#include "platform/graphics/compositing/PaintChunksToCcLayer.h"
|
| #include "platform/graphics/paint/DrawingDisplayItem.h"
|
| +#include "platform/graphics/paint/GeometryMapper.h"
|
| #include "platform/instrumentation/tracing/TraceEvent.h"
|
| #include "public/platform/WebDisplayItemList.h"
|
| #include "third_party/skia/include/core/SkRegion.h"
|
| @@ -81,10 +84,27 @@ size_t PaintArtifact::approximateUnsharedMemoryUsage() const {
|
| m_paintChunks.capacity() * sizeof(m_paintChunks[0]);
|
| }
|
|
|
| -void PaintArtifact::replay(GraphicsContext& graphicsContext) const {
|
| +void PaintArtifact::replay(const FloatRect& bounds,
|
| + GraphicsContext& graphicsContext) const {
|
| TRACE_EVENT0("blink,benchmark", "PaintArtifact::replay");
|
| - for (const DisplayItem& displayItem : m_displayItemList)
|
| - displayItem.replay(graphicsContext);
|
| + if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
|
| + 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);
|
| + }
|
| }
|
|
|
| DISABLE_CFI_PERF
|
|
|