| Index: Source/platform/graphics/paint/DisplayItems.cpp
|
| diff --git a/Source/platform/graphics/paint/DisplayItems.cpp b/Source/platform/graphics/paint/DisplayItems.cpp
|
| index 78c940dd9fbb388db8aafa2f38485e799f974a76..26aba57f1b8331b5450dc217b960da99a080012e 100644
|
| --- a/Source/platform/graphics/paint/DisplayItems.cpp
|
| +++ b/Source/platform/graphics/paint/DisplayItems.cpp
|
| @@ -7,44 +7,42 @@
|
|
|
| namespace blink {
|
|
|
| -DisplayItems::DisplayItems()
|
| -{
|
| -}
|
| -
|
| DisplayItems::~DisplayItems()
|
| {
|
| }
|
|
|
| -void DisplayItems::append(PassOwnPtr<DisplayItem> displayItem)
|
| -{
|
| - m_items.append(displayItem);
|
| -}
|
| -
|
| -void DisplayItems::appendByMoving(const Iterator& it)
|
| +void DisplayItems::appendByMoving(const Iterator& other)
|
| {
|
| - // Release the underlying OwnPtr to move the display item ownership.
|
| - ASSERT(!it->isGone());
|
| - append(it.m_iterator->release());
|
| + ASSERT(!other->isGone());
|
| + size_t indexInSource = other.m_iterator - other.m_owningList->m_ptrs.begin();
|
| + DisplayItem* source = other.m_owningList->m_ptrs[indexInSource];
|
| + m_items.appendByMoving(source);
|
| + m_ptrs.append(source);
|
| + other.m_owningList->m_ptrs[indexInSource] = nullptr;
|
| }
|
|
|
| void DisplayItems::removeLast()
|
| {
|
| + m_ptrs.removeLast();
|
| m_items.removeLast();
|
| }
|
|
|
| void DisplayItems::clear()
|
| {
|
| + m_ptrs.clear();
|
| m_items.clear();
|
| }
|
|
|
| void DisplayItems::swap(DisplayItems& other)
|
| {
|
| + m_ptrs.swap(other.m_ptrs);
|
| m_items.swap(other.m_items);
|
| }
|
|
|
| void DisplayItems::setGone(const Iterator& it)
|
| {
|
| - it.m_iterator->clear();
|
| + size_t index = it.m_iterator - it.m_owningList->m_ptrs.begin();
|
| + m_ptrs[index] = nullptr;
|
| }
|
|
|
| } // namespace blink
|
|
|