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

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

Issue 2404213004: Implement incremental paint property tree rebuilding (Closed)
Patch Set: Fix bug in how svg local to border box was updated, no longer crash in tests Created 4 years, 2 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.h
diff --git a/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
index 24a60a96f90161c15e7736ec7149f7d90b846124..07eea523491c895dbdd002b50ecbd6f8ee7fe31d 100644
--- a/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
+++ b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
@@ -143,6 +143,7 @@ class CORE_EXPORT ObjectPaintProperties {
void clearCssClipFixedPosition() { m_cssClipFixedPosition = nullptr; }
void clearInnerBorderRadiusClip() { m_innerBorderRadiusClip = nullptr; }
void clearOverflowClip() { m_overflowClip = nullptr; }
+ void clearLocalBorderBoxProperties() { m_localBorderBoxProperties = nullptr; }
void clearPerspective() { m_perspective = nullptr; }
void clearSvgLocalToBorderBoxTransform() {
m_svgLocalToBorderBoxTransform = nullptr;
@@ -209,6 +210,45 @@ class CORE_EXPORT ObjectPaintProperties {
return updateProperty(m_overflowClip, std::forward<Args>(args)...);
}
+ std::unique_ptr<ObjectPaintProperties> clone() const {
chrishtr 2016/10/21 22:03:09 It would be cool to make this with copy constructo
pdr. 2016/10/26 03:10:48 I played with this for a while but couldn't find a
+ std::unique_ptr<ObjectPaintProperties> cloned = create();
+ if (m_paintOffsetTranslation)
+ cloned->m_paintOffsetTranslation = m_paintOffsetTranslation->clone();
+ if (m_transform)
+ cloned->m_transform = m_transform->clone();
+ if (m_effect)
+ cloned->m_effect = m_effect->clone();
+ if (m_cssClip)
+ cloned->m_cssClip = m_cssClip->clone();
+ if (m_cssClipFixedPosition)
+ cloned->m_cssClipFixedPosition = m_cssClipFixedPosition->clone();
+ if (m_innerBorderRadiusClip)
+ cloned->m_innerBorderRadiusClip = m_innerBorderRadiusClip->clone();
+ if (m_overflowClip)
+ cloned->m_overflowClip = m_overflowClip->clone();
+ if (m_perspective)
+ cloned->m_perspective = m_perspective->clone();
+ if (m_svgLocalToBorderBoxTransform) {
+ cloned->m_svgLocalToBorderBoxTransform =
+ m_svgLocalToBorderBoxTransform->clone();
+ }
+ if (m_scrollTranslation)
+ cloned->m_scrollTranslation = m_scrollTranslation->clone();
+ if (m_scrollbarPaintOffset)
+ cloned->m_scrollbarPaintOffset = m_scrollbarPaintOffset->clone();
+ if (m_scroll)
+ cloned->m_scroll = m_scroll->clone();
+ if (m_localBorderBoxProperties) {
+ auto& state = m_localBorderBoxProperties->propertyTreeState;
+ cloned->m_localBorderBoxProperties =
+ wrapUnique(new PropertyTreeStateWithOffset(
+ m_localBorderBoxProperties->paintOffset,
+ PropertyTreeState(state.transform(), state.clip(), state.effect(),
+ state.scroll())));
+ }
+ return cloned;
+ }
+
private:
ObjectPaintProperties() {}

Powered by Google App Engine
This is Rietveld 408576698