| Index: Source/core/paint/FloatClipRecorder.cpp
|
| diff --git a/Source/core/paint/FloatClipRecorder.cpp b/Source/core/paint/FloatClipRecorder.cpp
|
| index 8797c065c2010645b3bf154ea8cc24d13bdd432e..7a77f9837b7a36736de93e6fee48423b5bd5fa0f 100644
|
| --- a/Source/core/paint/FloatClipRecorder.cpp
|
| +++ b/Source/core/paint/FloatClipRecorder.cpp
|
| @@ -12,33 +12,49 @@
|
|
|
| namespace blink {
|
|
|
| -FloatClipRecorder::FloatClipRecorder(GraphicsContext& context, const DisplayItemClientWrapper& client, PaintPhase paintPhase, const FloatRect& clipRect)
|
| +FloatClipRecorder::FloatClipRecorder(GraphicsContext& context, const DisplayItemClientWrapper& client, PaintPhase paintPhase)
|
| : m_context(context)
|
| , m_client(client)
|
| , m_clipType(DisplayItem::paintPhaseToFloatClipType(paintPhase))
|
| {
|
| +}
|
| +
|
| +FloatClipRecorder::FloatClipRecorder(GraphicsContext& context, const DisplayItemClientWrapper& client, PaintPhase paintPhase, const FloatRect& clipRect)
|
| + : FloatClipRecorder(context, client, paintPhase)
|
| +{
|
| + begin(clipRect);
|
| +}
|
| +
|
| +FloatClipRecorder::~FloatClipRecorder()
|
| +{
|
| + if (!m_engaged)
|
| + return;
|
| +
|
| + DisplayItem::Type endType = DisplayItem::floatClipTypeToEndFloatClipType(m_clipType);
|
| if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
|
| ASSERT(m_context.displayItemList());
|
| if (m_context.displayItemList()->displayItemConstructionIsDisabled())
|
| return;
|
| - m_context.displayItemList()->add(FloatClipDisplayItem::create(m_client, m_clipType, clipRect));
|
| + m_context.displayItemList()->add(EndFloatClipDisplayItem::create(m_client, endType));
|
| } else {
|
| - FloatClipDisplayItem clipDisplayItem(m_client, m_clipType, clipRect);
|
| - clipDisplayItem.replay(m_context);
|
| + EndFloatClipDisplayItem endClipDisplayItem(m_client, endType);
|
| + endClipDisplayItem.replay(m_context);
|
| }
|
| }
|
|
|
| -FloatClipRecorder::~FloatClipRecorder()
|
| +void FloatClipRecorder::begin(const FloatRect& clipRect)
|
| {
|
| - DisplayItem::Type endType = DisplayItem::floatClipTypeToEndFloatClipType(m_clipType);
|
| + ASSERT(!m_engaged);
|
| + m_engaged = true;
|
| +
|
| if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
|
| ASSERT(m_context.displayItemList());
|
| if (m_context.displayItemList()->displayItemConstructionIsDisabled())
|
| return;
|
| - m_context.displayItemList()->add(EndFloatClipDisplayItem::create(m_client, endType));
|
| + m_context.displayItemList()->add(FloatClipDisplayItem::create(m_client, m_clipType, clipRect));
|
| } else {
|
| - EndFloatClipDisplayItem endClipDisplayItem(m_client, endType);
|
| - endClipDisplayItem.replay(m_context);
|
| + FloatClipDisplayItem clipDisplayItem(m_client, m_clipType, clipRect);
|
| + clipDisplayItem.replay(m_context);
|
| }
|
| }
|
|
|
|
|