Index: Source/core/paint/BoxClipper.cpp |
diff --git a/Source/core/paint/BoxClipper.cpp b/Source/core/paint/BoxClipper.cpp |
index ce1de5652c9232df953bec572020b00fd471b139..34361623f6b98d4eded1179e3fc03a84175b9378 100644 |
--- a/Source/core/paint/BoxClipper.cpp |
+++ b/Source/core/paint/BoxClipper.cpp |
@@ -52,19 +52,23 @@ BoxClipper::BoxClipper(LayoutBox& box, const PaintInfo& paintInfo, const LayoutP |
return; |
} |
- if (RuntimeEnabledFeatures::slimmingPaintEnabled()) |
- m_clipType = m_paintInfo.displayItemTypeForClipping(); |
- |
- OwnPtr<ClipDisplayItem> clipDisplayItem = ClipDisplayItem::create(m_box, m_clipType, pixelSnappedIntRect(clipRect)); |
- if (hasBorderRadius) |
- clipDisplayItem->roundedRectClips().append(clipRoundedRect); |
- |
if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { |
ASSERT(m_paintInfo.context->displayItemList()); |
- if (!m_paintInfo.context->displayItemList()->displayItemConstructionIsDisabled()) |
- m_paintInfo.context->displayItemList()->add(clipDisplayItem.release()); |
+ m_clipType = m_paintInfo.displayItemTypeForClipping(); |
+ if (!m_paintInfo.context->displayItemList()->displayItemConstructionIsDisabled()) { |
+ if (hasBorderRadius) |
+ m_paintInfo.context->displayItemList()->createAndAppendIfNeeded<ClipDisplayItem>(m_box, m_clipType, pixelSnappedIntRect(clipRect), clipRoundedRect); |
+ else |
+ m_paintInfo.context->displayItemList()->createAndAppendIfNeeded<ClipDisplayItem>(m_box, m_clipType, pixelSnappedIntRect(clipRect)); |
+ } |
} else { |
- clipDisplayItem->replay(*paintInfo.context); |
+ if (hasBorderRadius) { |
+ ClipDisplayItem clipDisplayItem(m_box, m_clipType, pixelSnappedIntRect(clipRect), clipRoundedRect); |
+ clipDisplayItem.replay(*paintInfo.context); |
+ } else { |
+ ClipDisplayItem clipDisplayItem(m_box, m_clipType, pixelSnappedIntRect(clipRect)); |
+ clipDisplayItem.replay(*paintInfo.context); |
+ } |
} |
m_pushedClip = true; |
@@ -81,9 +85,8 @@ BoxClipper::~BoxClipper() |
if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { |
if (m_paintInfo.context->displayItemList()->displayItemConstructionIsDisabled()) |
return; |
- OwnPtr<EndClipDisplayItem> endClipDisplayItem = EndClipDisplayItem::create(m_box, endType); |
ASSERT(m_paintInfo.context->displayItemList()); |
- m_paintInfo.context->displayItemList()->add(endClipDisplayItem.release()); |
+ m_paintInfo.context->displayItemList()->createAndAppendIfNeeded<EndClipDisplayItem>(m_box, endType); |
} else { |
EndClipDisplayItem endClipDisplayItem(m_box, endType); |
endClipDisplayItem.replay(*m_paintInfo.context); |