Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2802593004: Move RarePaintData to its own file (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/paint/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 76e34c4046635df02b7f052821457153b56b6562..ff16f20edcffdd3aa34564354b8ddd79c237ff73 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -77,8 +77,8 @@
#include "core/page/AutoscrollController.h"
#include "core/page/Page.h"
#include "core/paint/ObjectPaintInvalidator.h"
-#include "core/paint/ObjectPaintProperties.h"
#include "core/paint/PaintLayer.h"
+#include "core/paint/RarePaintData.h"
#include "core/style/ContentData.h"
#include "core/style/CursorData.h"
#include "platform/InstanceCounters.h"
@@ -3557,59 +3557,7 @@ void LayoutObject::setIsBackgroundAttachmentFixedObject(
frameView()->removeBackgroundAttachmentFixedObject(this);
}
-LayoutObject::RarePaintData::RarePaintData() {}
-
-LayoutObject::RarePaintData::~RarePaintData() {}
-
-ObjectPaintProperties& LayoutObject::RarePaintData::ensurePaintProperties() {
- if (!m_paintProperties)
- m_paintProperties = ObjectPaintProperties::create();
- return *m_paintProperties.get();
-}
-
-void LayoutObject::RarePaintData::clearLocalBorderBoxProperties() {
- m_localBorderBoxProperties = nullptr;
-
- // The contents properties are based on the border box so we need to clear
- // the cached value.
- m_contentsProperties = nullptr;
-}
-
-void LayoutObject::RarePaintData::setLocalBorderBoxProperties(
- PropertyTreeState& state) {
- if (!m_localBorderBoxProperties)
- m_localBorderBoxProperties = WTF::makeUnique<PropertyTreeState>(state);
- else
- *m_localBorderBoxProperties = state;
-
- // The contents properties are based on the border box so we need to clear
- // the cached value.
- m_contentsProperties = nullptr;
-}
-
-const PropertyTreeState* LayoutObject::RarePaintData::contentsProperties()
- const {
- if (!m_contentsProperties) {
- if (m_localBorderBoxProperties) {
- m_contentsProperties = ObjectPaintProperties::contentsProperties(
- m_localBorderBoxProperties.get(), m_paintProperties.get());
- }
- } else {
-#if DCHECK_IS_ON()
- // Check that the cached contents properties are valid by checking that they
- // do not change if recalculated.
- DCHECK(m_localBorderBoxProperties);
- std::unique_ptr<PropertyTreeState> oldProperties =
- std::move(m_contentsProperties);
- m_contentsProperties = ObjectPaintProperties::contentsProperties(
- m_localBorderBoxProperties.get(), m_paintProperties.get());
- DCHECK(*m_contentsProperties == *oldProperties);
-#endif
- }
- return m_contentsProperties.get();
-}
-
-LayoutObject::RarePaintData& LayoutObject::ensureRarePaintData() {
+RarePaintData& LayoutObject::ensureRarePaintData() {
if (!m_rarePaintData)
m_rarePaintData = WTF::makeUnique<RarePaintData>();
return *m_rarePaintData.get();
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/paint/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698