| Index: Source/core/paint/RoundedInnerRectClipper.cpp
|
| diff --git a/Source/core/paint/RoundedInnerRectClipper.cpp b/Source/core/paint/RoundedInnerRectClipper.cpp
|
| index 5f4274cc6bdedd8a7e88c758d4c57acecfb6c2de..6408caf9ce304facb13188bb4aff4f7c64437575 100644
|
| --- a/Source/core/paint/RoundedInnerRectClipper.cpp
|
| +++ b/Source/core/paint/RoundedInnerRectClipper.cpp
|
| @@ -18,34 +18,34 @@ RoundedInnerRectClipper::RoundedInnerRectClipper(LayoutObject& layoutObject, con
|
| , m_useDisplayItemList(RuntimeEnabledFeatures::slimmingPaintEnabled() && behavior == ApplyToDisplayListIfEnabled)
|
| , m_clipType(m_useDisplayItemList ? m_paintInfo.displayItemTypeForClipping() : DisplayItem::ClipBoxPaintPhaseFirst)
|
| {
|
| - OwnPtr<ClipDisplayItem> clipDisplayItem = ClipDisplayItem::create(layoutObject, m_clipType, LayoutRect::infiniteIntRect());
|
| + ClipDisplayItem clipDisplayItem(layoutObject, m_clipType, LayoutRect::infiniteIntRect());
|
|
|
| if (clipRect.isRenderable()) {
|
| - clipDisplayItem->roundedRectClips().append(clipRect);
|
| + clipDisplayItem.roundedRectClips().append(clipRect);
|
| } else {
|
| // We create a rounded rect for each of the corners and clip it, while making sure we clip opposing corners together.
|
| if (!clipRect.radii().topLeft().isEmpty() || !clipRect.radii().bottomRight().isEmpty()) {
|
| FloatRect topCorner(clipRect.rect().x(), clipRect.rect().y(), rect.maxX() - clipRect.rect().x(), rect.maxY() - clipRect.rect().y());
|
| FloatRoundedRect::Radii topCornerRadii;
|
| topCornerRadii.setTopLeft(clipRect.radii().topLeft());
|
| - clipDisplayItem->roundedRectClips().append(FloatRoundedRect(topCorner, topCornerRadii));
|
| + clipDisplayItem.roundedRectClips().append(FloatRoundedRect(topCorner, topCornerRadii));
|
|
|
| FloatRect bottomCorner(rect.x().toFloat(), rect.y().toFloat(), clipRect.rect().maxX() - rect.x().toFloat(), clipRect.rect().maxY() - rect.y().toFloat());
|
| FloatRoundedRect::Radii bottomCornerRadii;
|
| bottomCornerRadii.setBottomRight(clipRect.radii().bottomRight());
|
| - clipDisplayItem->roundedRectClips().append(FloatRoundedRect(bottomCorner, bottomCornerRadii));
|
| + clipDisplayItem.roundedRectClips().append(FloatRoundedRect(bottomCorner, bottomCornerRadii));
|
| }
|
|
|
| if (!clipRect.radii().topRight().isEmpty() || !clipRect.radii().bottomLeft().isEmpty()) {
|
| FloatRect topCorner(rect.x().toFloat(), clipRect.rect().y(), clipRect.rect().maxX() - rect.x().toFloat(), rect.maxY() - clipRect.rect().y());
|
| FloatRoundedRect::Radii topCornerRadii;
|
| topCornerRadii.setTopRight(clipRect.radii().topRight());
|
| - clipDisplayItem->roundedRectClips().append(FloatRoundedRect(topCorner, topCornerRadii));
|
| + clipDisplayItem.roundedRectClips().append(FloatRoundedRect(topCorner, topCornerRadii));
|
|
|
| FloatRect bottomCorner(clipRect.rect().x(), rect.y().toFloat(), rect.maxX() - clipRect.rect().x(), clipRect.rect().maxY() - rect.y().toFloat());
|
| FloatRoundedRect::Radii bottomCornerRadii;
|
| bottomCornerRadii.setBottomLeft(clipRect.radii().bottomLeft());
|
| - clipDisplayItem->roundedRectClips().append(FloatRoundedRect(bottomCorner, bottomCornerRadii));
|
| + clipDisplayItem.roundedRectClips().append(FloatRoundedRect(bottomCorner, bottomCornerRadii));
|
| }
|
| }
|
|
|
| @@ -53,23 +53,22 @@ RoundedInnerRectClipper::RoundedInnerRectClipper(LayoutObject& layoutObject, con
|
| ASSERT(m_paintInfo.context->displayItemList());
|
| if (m_paintInfo.context->displayItemList()->displayItemConstructionIsDisabled())
|
| return;
|
| - m_paintInfo.context->displayItemList()->add(clipDisplayItem.release());
|
| + m_paintInfo.context->displayItemList()->add(clipDisplayItem);
|
| } else {
|
| - clipDisplayItem->replay(*paintInfo.context);
|
| + clipDisplayItem.replay(*paintInfo.context);
|
| }
|
| }
|
|
|
| RoundedInnerRectClipper::~RoundedInnerRectClipper()
|
| {
|
| DisplayItem::Type endType = DisplayItem::clipTypeToEndClipType(m_clipType);
|
| + EndClipDisplayItem endClipDisplayItem(m_layoutObject, endType);
|
| if (m_useDisplayItemList) {
|
| ASSERT(m_paintInfo.context->displayItemList());
|
| if (m_paintInfo.context->displayItemList()->displayItemConstructionIsDisabled())
|
| return;
|
| - OwnPtr<EndClipDisplayItem> endClipDisplayItem = EndClipDisplayItem::create(m_layoutObject, endType);
|
| - m_paintInfo.context->displayItemList()->add(endClipDisplayItem.release());
|
| + m_paintInfo.context->displayItemList()->add(endClipDisplayItem);
|
| } else {
|
| - EndClipDisplayItem endClipDisplayItem(m_layoutObject, endType);
|
| endClipDisplayItem.replay(*m_paintInfo.context);
|
| }
|
| }
|
|
|