| Index: Source/core/paint/ScopeRecorder.cpp
|
| diff --git a/Source/core/paint/ScopeRecorder.cpp b/Source/core/paint/ScopeRecorder.cpp
|
| index 5b96bc7f0bd87c0764990d18e1784bd472e8c419..8b9eef1d5da98e1a1063f5087f46d8a31ec021f9 100644
|
| --- a/Source/core/paint/ScopeRecorder.cpp
|
| +++ b/Source/core/paint/ScopeRecorder.cpp
|
| @@ -12,23 +12,35 @@
|
|
|
| namespace blink {
|
|
|
| -ScopeRecorder::ScopeRecorder(GraphicsContext& context, const LayoutObject& object)
|
| +ScopeRecorder::ScopeRecorder(GraphicsContext& context, const LayoutObject& object, ShouldBegin shouldBegin)
|
| : m_displayItemList(context.displayItemList())
|
| , m_object(object)
|
| + , m_engaged(false)
|
| {
|
| + if (shouldBegin == BeginOnConstruction)
|
| + begin();
|
| +}
|
| +
|
| +ScopeRecorder::~ScopeRecorder()
|
| +{
|
| + if (!m_engaged)
|
| + return;
|
| if (!RuntimeEnabledFeatures::slimmingPaintEnabled())
|
| return;
|
|
|
| - ASSERT(m_displayItemList);
|
| - m_displayItemList->beginScope(m_object.displayItemClient());
|
| + m_displayItemList->endScope(m_object.displayItemClient());
|
| }
|
|
|
| -ScopeRecorder::~ScopeRecorder()
|
| +void ScopeRecorder::begin()
|
| {
|
| + ASSERT(!m_engaged);
|
| + m_engaged = true;
|
| +
|
| if (!RuntimeEnabledFeatures::slimmingPaintEnabled())
|
| return;
|
|
|
| - m_displayItemList->endScope(m_object.displayItemClient());
|
| + ASSERT(m_displayItemList);
|
| + m_displayItemList->beginScope(m_object.displayItemClient());
|
| }
|
|
|
| } // namespace blink
|
|
|