| Index: Source/core/paint/ScrollRecorder.cpp
|
| diff --git a/Source/core/paint/ScrollRecorder.cpp b/Source/core/paint/ScrollRecorder.cpp
|
| index bbc320b683e32d46d749edacfadbc2ce4a72fa05..7fedf69ab3338544b3681c36feaa2688c2bce67f 100644
|
| --- a/Source/core/paint/ScrollRecorder.cpp
|
| +++ b/Source/core/paint/ScrollRecorder.cpp
|
| @@ -12,33 +12,50 @@
|
|
|
| namespace blink {
|
|
|
| -ScrollRecorder::ScrollRecorder(GraphicsContext& context, const DisplayItemClientWrapper& client, PaintPhase phase, const IntSize& currentOffset)
|
| +ScrollRecorder::ScrollRecorder(GraphicsContext& context, const DisplayItemClientWrapper& client, PaintPhase phase)
|
| : m_client(client)
|
| , m_beginItemType(DisplayItem::paintPhaseToScrollType(phase))
|
| , m_context(context)
|
| + , m_engaged(false)
|
| {
|
| +}
|
| +
|
| +ScrollRecorder::ScrollRecorder(GraphicsContext& context, const DisplayItemClientWrapper& client, PaintPhase phase, const IntSize& currentOffset)
|
| + : ScrollRecorder(context, client, phase)
|
| +{
|
| + begin(currentOffset);
|
| +}
|
| +
|
| +ScrollRecorder::~ScrollRecorder()
|
| +{
|
| + if (!m_engaged)
|
| + return;
|
| +
|
| + DisplayItem::Type endItemType = DisplayItem::scrollTypeToEndScrollType(m_beginItemType);
|
| if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
|
| ASSERT(m_context.displayItemList());
|
| if (m_context.displayItemList()->displayItemConstructionIsDisabled())
|
| return;
|
| - m_context.displayItemList()->add(BeginScrollDisplayItem::create(m_client, m_beginItemType, currentOffset));
|
| + m_context.displayItemList()->add(EndScrollDisplayItem::create(m_client, endItemType));
|
| } else {
|
| - BeginScrollDisplayItem scrollDisplayItem(m_client, m_beginItemType, currentOffset);
|
| - scrollDisplayItem.replay(m_context);
|
| + EndScrollDisplayItem endScrollDisplayItem(m_client, endItemType);
|
| + endScrollDisplayItem.replay(m_context);
|
| }
|
| }
|
|
|
| -ScrollRecorder::~ScrollRecorder()
|
| +void ScrollRecorder::begin(const IntSize& currentOffset)
|
| {
|
| - DisplayItem::Type endItemType = DisplayItem::scrollTypeToEndScrollType(m_beginItemType);
|
| + ASSERT(!m_engaged);
|
| + m_engaged = true;
|
| +
|
| if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
|
| ASSERT(m_context.displayItemList());
|
| if (m_context.displayItemList()->displayItemConstructionIsDisabled())
|
| return;
|
| - m_context.displayItemList()->add(EndScrollDisplayItem::create(m_client, endItemType));
|
| + m_context.displayItemList()->add(BeginScrollDisplayItem::create(m_client, m_beginItemType, currentOffset));
|
| } else {
|
| - EndScrollDisplayItem endScrollDisplayItem(m_client, endItemType);
|
| - endScrollDisplayItem.replay(m_context);
|
| + BeginScrollDisplayItem scrollDisplayItem(m_client, m_beginItemType, currentOffset);
|
| + scrollDisplayItem.replay(m_context);
|
| }
|
| }
|
|
|
|
|