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

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

Issue 2751433002: [SPv2] Flatten property trees in PaintRecordBuilder into a single display list. (Closed)
Patch Set: none Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
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..2374165684437891e5ebc5b151e56510c70e9933 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,25 @@ 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 PropertyTreeState& propertyTreeState) 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;
pdr. 2017/03/28 21:01:30 To prevent growing and copying this vector, please
chrishtr 2017/03/28 21:43:23 Done.
+ for (const auto& chunk : paintChunks())
+ pointerPaintChunks.push_back(&chunk);
+
+ scoped_refptr<cc::DisplayItemList> displayItemList =
+ PaintChunksToCcLayer::convert(pointerPaintChunks, propertyTreeState,
+ gfx::Vector2dF(), getDisplayItemList(),
+ *geometryMapper);
+ graphicsContext.canvas()->drawDisplayItemList(displayItemList);
+ }
}
DISABLE_CFI_PERF

Powered by Google App Engine
This is Rietveld 408576698