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

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

Issue 1484163002: Raster display item lists via a visual rect RTree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head. Created 5 years 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 e792755782bba1f3be89e58b1eaffa171e62c53f..1a19cad77298f784c9672aeee7375cd9701427d4 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.cpp
@@ -38,12 +38,20 @@ void PaintArtifact::replay(GraphicsContext& graphicsContext) const
displayItem.replay(graphicsContext);
}
-void PaintArtifact::appendToWebDisplayItemList(WebDisplayItemList* list) const
+void PaintArtifact::appendToWebDisplayItemList(const DisplayItemRectMap& itemRects, WebDisplayItemList* list) const
{
TRACE_EVENT0("blink,benchmark", "PaintArtifact::appendToWebDisplayItemList");
- for (const DisplayItem& displayItem : m_displayItemList) {
- // TODO(wkorman): Pass the actual visual rect for the display item.
- displayItem.appendToWebDisplayItemList(IntRect(), list);
+ for (const auto& displayItem : m_displayItemList) {
+ if (itemRects.contains(displayItem.client())) {
+ IntRect visualRect = itemRects.get(displayItem.client());
+ // fprintf(stderr, "Got visual rect [rect=(%d, %d, %d, %d), item=%s].\n",
+ // visualRect.x(), visualRect.y(), visualRect.width(), visualRect.height(),
+ // displayItem.asDebugString().ascii().data());
+ displayItem.appendToWebDisplayItemList(visualRect, list);
+ } else {
+ // fprintf(stderr, "Missing visual rect [item=%s].\n", displayItem.asDebugString().ascii().data());
+ displayItem.appendToWebDisplayItemList(IntRect(), list);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698