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

Unified Diff: third_party/WebKit/Source/core/paint/ObjectPaintProperties.cpp

Issue 2782343002: Store local border box property cache outside ObjectPaintProperties (Closed)
Patch Set: Rebase Created 3 years, 9 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
Index: third_party/WebKit/Source/core/paint/ObjectPaintProperties.cpp
diff --git a/third_party/WebKit/Source/core/paint/ObjectPaintProperties.cpp b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.cpp
index eb3bf2556933e153b6eecf8ae3f6c5c711d18c1e..7327f6e9e993de2b9a455fddfe4ecf5203f1f043 100644
--- a/third_party/WebKit/Source/core/paint/ObjectPaintProperties.cpp
+++ b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.cpp
@@ -6,21 +6,27 @@
namespace blink {
-void ObjectPaintProperties::updateContentsProperties() const {
- DCHECK(m_localBorderBoxProperties);
- DCHECK(!m_contentsProperties);
+std::unique_ptr<PropertyTreeState> ObjectPaintProperties::contentsProperties(
+ PropertyTreeState* localBorderBoxProperties,
+ ObjectPaintProperties* paintProperties) {
+ if (!localBorderBoxProperties)
+ return nullptr;
- m_contentsProperties =
- WTF::makeUnique<PropertyTreeState>(*m_localBorderBoxProperties);
+ std::unique_ptr<PropertyTreeState> contents =
+ WTF::makeUnique<PropertyTreeState>(*localBorderBoxProperties);
- if (scrollTranslation())
- m_contentsProperties->setTransform(scrollTranslation());
- if (overflowClip())
- m_contentsProperties->setClip(overflowClip());
- else if (cssClip())
- m_contentsProperties->setClip(cssClip());
+ if (paintProperties) {
+ if (paintProperties->scrollTranslation())
+ contents->setTransform(paintProperties->scrollTranslation());
+ if (paintProperties->overflowClip())
+ contents->setClip(paintProperties->overflowClip());
+ else if (paintProperties->cssClip())
+ contents->setClip(paintProperties->cssClip());
+ }
// TODO(chrishtr): cssClipFixedPosition needs to be handled somehow.
+
+ return contents;
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698