Chromium Code Reviews| 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 2ad2dafd5ad4efee4139334035aa2744f7f2ee39..77a4e3d57718b037499ec70e144e0487df158d69 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
| @@ -126,7 +126,7 @@ struct SameSizeAsLayoutObject : DisplayItemClient { |
| unsigned m_bitfields2; |
| LayoutRect m_visualRect; |
| LayoutPoint m_paintOffset; |
| - std::unique_ptr<void*> m_paintProperties; |
| + std::unique_ptr<void*> m_rarePaintData; |
| }; |
| static_assert(sizeof(LayoutObject) == sizeof(SameSizeAsLayoutObject), |
| @@ -3552,16 +3552,20 @@ void LayoutObject::setIsBackgroundAttachmentFixedObject( |
| frameView()->removeBackgroundAttachmentFixedObject(this); |
| } |
| -const ObjectPaintProperties* LayoutObject::paintProperties() const { |
| - DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); |
| - return m_paintProperties.get(); |
| -} |
| +LayoutObject::RarePaintData::RarePaintData() {} |
|
Xianzhu
2017/03/30 03:11:18
Nit: I think we can just use the default construct
pdr.
2017/03/30 18:57:33
This does have to be here. Windows puts the defaul
|
| + |
| +LayoutObject::RarePaintData::~RarePaintData() {} |
| -ObjectPaintProperties& LayoutObject::ensurePaintProperties() { |
| - DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); |
| +ObjectPaintProperties& LayoutObject::RarePaintData::ensurePaintProperties() { |
| if (!m_paintProperties) |
| m_paintProperties = ObjectPaintProperties::create(); |
| - return *m_paintProperties; |
| + return *m_paintProperties.get(); |
| +} |
| + |
| +LayoutObject::RarePaintData& LayoutObject::ensureRarePaintData() { |
| + if (!m_rarePaintData) |
| + m_rarePaintData = WTF::makeUnique<RarePaintData>(); |
| + return *m_rarePaintData.get(); |
| } |
| LayoutRect LayoutObject::debugRect() const { |