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

Unified Diff: Source/core/paint/LayerClipRecorder.cpp

Issue 1193433004: Blink-side contiguous allocation of display items. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Minor tweaks to make reviewing easier Created 5 years, 6 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: Source/core/paint/LayerClipRecorder.cpp
diff --git a/Source/core/paint/LayerClipRecorder.cpp b/Source/core/paint/LayerClipRecorder.cpp
index 2d59a79773c626c7e3636569af983922dc7a2399..a10d10b5116d1a15bb69dc5870e3dbd783514b13 100644
--- a/Source/core/paint/LayerClipRecorder.cpp
+++ b/Source/core/paint/LayerClipRecorder.cpp
@@ -30,14 +30,13 @@ LayerClipRecorder::LayerClipRecorder(GraphicsContext& graphicsContext, const Lay
collectRoundedRectClips(*layoutObject.layer(), *localPaintingInfo, graphicsContext, fragmentOffset, paintFlags, rule, *roundedRects);
}
- OwnPtr<ClipDisplayItem> clipDisplayItem = ClipDisplayItem::create(layoutObject, clipType, snappedClipRect, roundedRects.release());
- if (!RuntimeEnabledFeatures::slimmingPaintEnabled()) {
- clipDisplayItem->replay(graphicsContext);
- } else {
- ASSERT(m_graphicsContext.displayItemList());
+ if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
if (m_graphicsContext.displayItemList()->displayItemConstructionIsDisabled())
return;
- m_graphicsContext.displayItemList()->add(clipDisplayItem.release());
+ m_graphicsContext.displayItemList()->createAndAppend<ClipDisplayItem>(layoutObject, m_clipType, snappedClipRect, roundedRects.release());
+ } else {
+ ClipDisplayItem clipDisplayItem(layoutObject, m_clipType, snappedClipRect, roundedRects.release());
+ clipDisplayItem.replay(graphicsContext);
}
}
@@ -88,7 +87,7 @@ LayerClipRecorder::~LayerClipRecorder()
if (m_graphicsContext.displayItemList()->lastDisplayItemIsNoopBegin())
m_graphicsContext.displayItemList()->removeLastDisplayItem();
else
- m_graphicsContext.displayItemList()->add(EndClipDisplayItem::create(m_layoutObject, DisplayItem::clipTypeToEndClipType(m_clipType)));
+ m_graphicsContext.displayItemList()->createAndAppend<EndClipDisplayItem>(m_layoutObject, DisplayItem::clipTypeToEndClipType(m_clipType));
}
} else {
m_graphicsContext.restore();

Powered by Google App Engine
This is Rietveld 408576698