| Index: third_party/WebKit/Source/core/layout/LayoutObject.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
|
| index a23fb37c132ecd3600fe51a9c70cc3bbea488fe6..da487f6d549f2634cc1ee0e63bf9756d02b07eee 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
|
| @@ -128,6 +128,7 @@ struct SameSizeAsLayoutObject : DisplayItemClient {
|
| unsigned m_bitfields2;
|
| LayoutRect m_visualRect;
|
| LayoutPoint m_paintOffset;
|
| + std::unique_ptr<void*> m_paintProperties;
|
| };
|
|
|
| static_assert(sizeof(LayoutObject) == sizeof(SameSizeAsLayoutObject),
|
| @@ -135,15 +136,6 @@ static_assert(sizeof(LayoutObject) == sizeof(SameSizeAsLayoutObject),
|
|
|
| bool LayoutObject::s_affectsParentBlock = false;
|
|
|
| -// The pointer to paint properties is implemented as a global hash map
|
| -// temporarily, to avoid memory regression during the transition towards SPv2.
|
| -typedef HashMap<const LayoutObject*, std::unique_ptr<ObjectPaintProperties>>
|
| - PaintPropertiesMap;
|
| -static PaintPropertiesMap& paintPropertiesMap() {
|
| - DEFINE_STATIC_LOCAL(PaintPropertiesMap, staticPaintPropertiesMap, ());
|
| - return staticPaintPropertiesMap;
|
| -}
|
| -
|
| void* LayoutObject::operator new(size_t sz) {
|
| ASSERT(isMainThread());
|
| return partitionAlloc(WTF::Partitions::layoutPartition(), sz,
|
| @@ -2578,9 +2570,6 @@ void LayoutObject::willBeDestroyed() {
|
|
|
| ObjectPaintInvalidator::objectWillBeDestroyed(*this);
|
|
|
| - if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
|
| - paintPropertiesMap().remove(this);
|
| -
|
| clearLayoutRootIfNeeded();
|
|
|
| if (m_style) {
|
| @@ -3498,16 +3487,14 @@ void LayoutObject::setIsBackgroundAttachmentFixedObject(
|
|
|
| const ObjectPaintProperties* LayoutObject::paintProperties() const {
|
| DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
|
| - return paintPropertiesMap().get(this);
|
| + return m_paintProperties.get();
|
| }
|
|
|
| ObjectPaintProperties& LayoutObject::ensurePaintProperties() {
|
| DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled());
|
| - auto addResult = paintPropertiesMap().add(this, nullptr);
|
| - if (addResult.isNewEntry)
|
| - addResult.storedValue->value = ObjectPaintProperties::create();
|
| -
|
| - return *addResult.storedValue->value;
|
| + if (!m_paintProperties)
|
| + m_paintProperties = ObjectPaintProperties::create();
|
| + return *m_paintProperties;
|
| }
|
|
|
| LayoutRect LayoutObject::debugRect() const {
|
|
|