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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.h

Issue 1636503005: Avoid unnecessary CoW for outer DataRef when applying transform-origin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/style/ComputedStyle.h
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h
index 26f7320010e555eb7f9e02b38971f02276784a07..752fbe64040debc30f835913d8c53d380d4b92db 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -90,6 +90,10 @@ template<typename T, typename U> inline bool compareEqual(const T& t, const U& u
if (!compareEqual(group->variable, value)) \
group.access()->variable = value
+#define SET_NESTED_VAR(group, base, variable, value) \
+ if (!compareEqual(group->base->variable, value)) \
+ group.access()->base.access()->variable = value
+
#define SET_VAR_WITH_SETTER(group, getter, setter, value) \
if (!compareEqual(group->getter(), value)) \
group.access()->setter(value)
@@ -1404,7 +1408,7 @@ public:
void setTransformOriginX(const Length& v) { setTransformOrigin(TransformOrigin(v, transformOriginY(), transformOriginZ())); }
void setTransformOriginY(const Length& v) { setTransformOrigin(TransformOrigin(transformOriginX(), v, transformOriginZ())); }
void setTransformOriginZ(float f) { setTransformOrigin(TransformOrigin(transformOriginX(), transformOriginY(), f)); }
- void setTransformOrigin(const TransformOrigin& o) { SET_VAR(rareNonInheritedData.access()->m_transform, m_origin, o); }
+ void setTransformOrigin(const TransformOrigin& o) { SET_NESTED_VAR(rareNonInheritedData, m_transform, m_origin, o); }
void setTranslate(PassRefPtr<TranslateTransformOperation> v) { rareNonInheritedData.access()->m_transform.access()->m_translate = v; }
void setRotate(PassRefPtr<RotateTransformOperation> v) { rareNonInheritedData.access()->m_transform.access()->m_rotate = v; }
void setScale(PassRefPtr<ScaleTransformOperation> v) { rareNonInheritedData.access()->m_transform.access()->m_scale = v; }
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698