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

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: Ready for review 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 8ed407eb3a00945912f0a74413a992922bf1cfe9..575ae232e142fbef27068a48aeeb8a9741065b1d 100644
--- a/Source/core/paint/LayerClipRecorder.cpp
+++ b/Source/core/paint/LayerClipRecorder.cpp
@@ -24,16 +24,19 @@ LayerClipRecorder::LayerClipRecorder(GraphicsContext& graphicsContext, const Lay
, m_clipType(clipType)
{
IntRect snappedClipRect = pixelSnappedIntRect(clipRect.rect());
- OwnPtr<ClipDisplayItem> clipDisplayItem = ClipDisplayItem::create(layoutObject, clipType, snappedClipRect);
- if (localPaintingInfo && clipRect.hasRadius())
- collectRoundedRectClips(*layoutObject.layer(), *localPaintingInfo, graphicsContext, fragmentOffset, paintFlags, rule, clipDisplayItem->roundedRectClips());
+ OwnPtr<Vector<FloatRoundedRect>> roundedRectClips;
+ if (localPaintingInfo && clipRect.hasRadius()) {
+ roundedRectClips = adoptPtr(new Vector<FloatRoundedRect>());
+ collectRoundedRectClips(*layoutObject.layer(), *localPaintingInfo, graphicsContext, fragmentOffset, paintFlags, rule, *roundedRectClips);
+ }
if (!RuntimeEnabledFeatures::slimmingPaintEnabled()) {
- clipDisplayItem->replay(graphicsContext);
+ ClipDisplayItem clipDisplayItem(layoutObject, clipType, snappedClipRect, roundedRectClips.release());
+ clipDisplayItem.replay(graphicsContext);
} else {
ASSERT(m_graphicsContext.displayItemList());
if (m_graphicsContext.displayItemList()->displayItemConstructionIsDisabled())
return;
- m_graphicsContext.displayItemList()->add(clipDisplayItem.release());
+ m_graphicsContext.displayItemList()->createAndAppendIfNeeded<ClipDisplayItem>(layoutObject, clipType, snappedClipRect, roundedRectClips.release());
}
}
@@ -83,8 +86,7 @@ LayerClipRecorder::~LayerClipRecorder()
if (m_graphicsContext.displayItemList()->displayItemConstructionIsDisabled())
return;
DisplayItem::Type endType = DisplayItem::clipTypeToEndClipType(m_clipType);
- OwnPtr<EndClipDisplayItem> endClip = EndClipDisplayItem::create(m_layoutObject, endType);
- m_graphicsContext.displayItemList()->add(endClip.release());
+ m_graphicsContext.displayItemList()->createAndAppendIfNeeded<EndClipDisplayItem>(m_layoutObject, endType);
} else {
m_graphicsContext.restore();
}

Powered by Google App Engine
This is Rietveld 408576698