| Index: Source/core/paint/RoundedInnerRectClipper.cpp
|
| diff --git a/Source/core/paint/RoundedInnerRectClipper.cpp b/Source/core/paint/RoundedInnerRectClipper.cpp
|
| index 5f4274cc6bdedd8a7e88c758d4c57acecfb6c2de..b9f8484ee71b96fa74190a30f21f41b10e5102d8 100644
|
| --- a/Source/core/paint/RoundedInnerRectClipper.cpp
|
| +++ b/Source/core/paint/RoundedInnerRectClipper.cpp
|
| @@ -12,13 +12,48 @@
|
|
|
| namespace blink {
|
|
|
| -RoundedInnerRectClipper::RoundedInnerRectClipper(LayoutObject& layoutObject, const PaintInfo& paintInfo, const LayoutRect& rect, const FloatRoundedRect& clipRect, RoundedInnerRectClipperBehavior behavior)
|
| +RoundedInnerRectClipper::RoundedInnerRectClipper(LayoutObject& layoutObject, const PaintInfo& paintInfo)
|
| : m_layoutObject(layoutObject)
|
| , m_paintInfo(paintInfo)
|
| - , m_useDisplayItemList(RuntimeEnabledFeatures::slimmingPaintEnabled() && behavior == ApplyToDisplayListIfEnabled)
|
| - , m_clipType(m_useDisplayItemList ? m_paintInfo.displayItemTypeForClipping() : DisplayItem::ClipBoxPaintPhaseFirst)
|
| + , m_useDisplayItemList(false)
|
| + , m_clipType(DisplayItem::ClipBoxPaintPhaseFirst)
|
| + , m_engaged(false)
|
| +{
|
| +}
|
| +
|
| +RoundedInnerRectClipper::RoundedInnerRectClipper(LayoutObject& layoutObject, const PaintInfo& paintInfo, const LayoutRect& rect, const FloatRoundedRect& clipRect, RoundedInnerRectClipperBehavior behavior)
|
| + : RoundedInnerRectClipper(layoutObject, paintInfo)
|
| {
|
| - OwnPtr<ClipDisplayItem> clipDisplayItem = ClipDisplayItem::create(layoutObject, m_clipType, LayoutRect::infiniteIntRect());
|
| + begin(rect, clipRect, behavior);
|
| +}
|
| +
|
| +RoundedInnerRectClipper::~RoundedInnerRectClipper()
|
| +{
|
| + if (!m_engaged)
|
| + return;
|
| +
|
| + DisplayItem::Type endType = DisplayItem::clipTypeToEndClipType(m_clipType);
|
| + 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());
|
| + } else {
|
| + EndClipDisplayItem endClipDisplayItem(m_layoutObject, endType);
|
| + endClipDisplayItem.replay(*m_paintInfo.context);
|
| + }
|
| +}
|
| +
|
| +void RoundedInnerRectClipper::begin(const LayoutRect& rect, const FloatRoundedRect& clipRect, RoundedInnerRectClipperBehavior behavior)
|
| +{
|
| + ASSERT(!m_engaged);
|
| + m_engaged = true;
|
| +
|
| + m_useDisplayItemList = RuntimeEnabledFeatures::slimmingPaintEnabled() && behavior == ApplyToDisplayListIfEnabled;
|
| + m_clipType = m_useDisplayItemList ? m_paintInfo.displayItemTypeForClipping() : DisplayItem::ClipBoxPaintPhaseFirst;
|
| +
|
| + OwnPtr<ClipDisplayItem> clipDisplayItem = ClipDisplayItem::create(m_layoutObject, m_clipType, LayoutRect::infiniteIntRect());
|
|
|
| if (clipRect.isRenderable()) {
|
| clipDisplayItem->roundedRectClips().append(clipRect);
|
| @@ -55,22 +90,7 @@ RoundedInnerRectClipper::RoundedInnerRectClipper(LayoutObject& layoutObject, con
|
| return;
|
| m_paintInfo.context->displayItemList()->add(clipDisplayItem.release());
|
| } else {
|
| - clipDisplayItem->replay(*paintInfo.context);
|
| - }
|
| -}
|
| -
|
| -RoundedInnerRectClipper::~RoundedInnerRectClipper()
|
| -{
|
| - DisplayItem::Type endType = DisplayItem::clipTypeToEndClipType(m_clipType);
|
| - 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());
|
| - } else {
|
| - EndClipDisplayItem endClipDisplayItem(m_layoutObject, endType);
|
| - endClipDisplayItem.replay(*m_paintInfo.context);
|
| + clipDisplayItem->replay(*m_paintInfo.context);
|
| }
|
| }
|
|
|
|
|