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(); |
} |