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

Side by Side 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, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 #include "wtf/RefCounted.h" 83 #include "wtf/RefCounted.h"
84 #include "wtf/StdLibExtras.h" 84 #include "wtf/StdLibExtras.h"
85 #include "wtf/Vector.h" 85 #include "wtf/Vector.h"
86 86
87 template<typename T, typename U> inline bool compareEqual(const T& t, const U& u ) { return t == static_cast<T>(u); } 87 template<typename T, typename U> inline bool compareEqual(const T& t, const U& u ) { return t == static_cast<T>(u); }
88 88
89 #define SET_VAR(group, variable, value) \ 89 #define SET_VAR(group, variable, value) \
90 if (!compareEqual(group->variable, value)) \ 90 if (!compareEqual(group->variable, value)) \
91 group.access()->variable = value 91 group.access()->variable = value
92 92
93 #define SET_NESTED_VAR(group, base, variable, value) \
94 if (!compareEqual(group->base->variable, value)) \
95 group.access()->base.access()->variable = value
96
93 #define SET_VAR_WITH_SETTER(group, getter, setter, value) \ 97 #define SET_VAR_WITH_SETTER(group, getter, setter, value) \
94 if (!compareEqual(group->getter(), value)) \ 98 if (!compareEqual(group->getter(), value)) \
95 group.access()->setter(value) 99 group.access()->setter(value)
96 100
97 #define SET_BORDERVALUE_COLOR(group, variable, value) \ 101 #define SET_BORDERVALUE_COLOR(group, variable, value) \
98 if (!compareEqual(group->variable.color(), value)) \ 102 if (!compareEqual(group->variable.color(), value)) \
99 group.access()->variable.setColor(value) 103 group.access()->variable.setColor(value)
100 104
101 namespace blink { 105 namespace blink {
102 106
(...skipping 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1397 // For valid values of column-break-inside see http://www.w3.org/TR/css3-mul ticol/#break-before-break-after-break-inside 1401 // For valid values of column-break-inside see http://www.w3.org/TR/css3-mul ticol/#break-before-break-after-break-inside
1398 void setColumnBreakInside(EPageBreak p) { ASSERT(p == PBAUTO || p == PBAVOID ); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakInside, p); } 1402 void setColumnBreakInside(EPageBreak p) { ASSERT(p == PBAUTO || p == PBAVOID ); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakInside, p); }
1399 void setColumnBreakAfter(EPageBreak p) { SET_VAR(rareNonInheritedData.access ()->m_multiCol, m_breakAfter, p); } 1403 void setColumnBreakAfter(EPageBreak p) { SET_VAR(rareNonInheritedData.access ()->m_multiCol, m_breakAfter, p); }
1400 void inheritColumnPropertiesFrom(const ComputedStyle& parent) { rareNonInher itedData.access()->m_multiCol = parent.rareNonInheritedData->m_multiCol; } 1404 void inheritColumnPropertiesFrom(const ComputedStyle& parent) { rareNonInher itedData.access()->m_multiCol = parent.rareNonInheritedData->m_multiCol; }
1401 void setHasInlineTransform(bool b) { SET_VAR(rareNonInheritedData, m_hasInli neTransform, b); } 1405 void setHasInlineTransform(bool b) { SET_VAR(rareNonInheritedData, m_hasInli neTransform, b); }
1402 void setHasCompositorProxy(bool b) { SET_VAR(rareNonInheritedData, m_hasComp ositorProxy, b); } 1406 void setHasCompositorProxy(bool b) { SET_VAR(rareNonInheritedData, m_hasComp ositorProxy, b); }
1403 void setTransform(const TransformOperations& ops) { SET_VAR(rareNonInherited Data.access()->m_transform, m_operations, ops); } 1407 void setTransform(const TransformOperations& ops) { SET_VAR(rareNonInherited Data.access()->m_transform, m_operations, ops); }
1404 void setTransformOriginX(const Length& v) { setTransformOrigin(TransformOrig in(v, transformOriginY(), transformOriginZ())); } 1408 void setTransformOriginX(const Length& v) { setTransformOrigin(TransformOrig in(v, transformOriginY(), transformOriginZ())); }
1405 void setTransformOriginY(const Length& v) { setTransformOrigin(TransformOrig in(transformOriginX(), v, transformOriginZ())); } 1409 void setTransformOriginY(const Length& v) { setTransformOrigin(TransformOrig in(transformOriginX(), v, transformOriginZ())); }
1406 void setTransformOriginZ(float f) { setTransformOrigin(TransformOrigin(trans formOriginX(), transformOriginY(), f)); } 1410 void setTransformOriginZ(float f) { setTransformOrigin(TransformOrigin(trans formOriginX(), transformOriginY(), f)); }
1407 void setTransformOrigin(const TransformOrigin& o) { SET_VAR(rareNonInherited Data.access()->m_transform, m_origin, o); } 1411 void setTransformOrigin(const TransformOrigin& o) { SET_NESTED_VAR(rareNonIn heritedData, m_transform, m_origin, o); }
1408 void setTranslate(PassRefPtr<TranslateTransformOperation> v) { rareNonInheri tedData.access()->m_transform.access()->m_translate = v; } 1412 void setTranslate(PassRefPtr<TranslateTransformOperation> v) { rareNonInheri tedData.access()->m_transform.access()->m_translate = v; }
1409 void setRotate(PassRefPtr<RotateTransformOperation> v) { rareNonInheritedDat a.access()->m_transform.access()->m_rotate = v; } 1413 void setRotate(PassRefPtr<RotateTransformOperation> v) { rareNonInheritedDat a.access()->m_transform.access()->m_rotate = v; }
1410 void setScale(PassRefPtr<ScaleTransformOperation> v) { rareNonInheritedData. access()->m_transform.access()->m_scale = v; } 1414 void setScale(PassRefPtr<ScaleTransformOperation> v) { rareNonInheritedData. access()->m_transform.access()->m_scale = v; }
1411 1415
1412 void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); } 1416 void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); }
1413 void setTextCombine(TextCombine v) { SET_VAR(rareInheritedData, m_textCombin e, v); } 1417 void setTextCombine(TextCombine v) { SET_VAR(rareInheritedData, m_textCombin e, v); }
1414 void setTextDecorationColor(const StyleColor& c) { SET_VAR(rareNonInheritedD ata, m_textDecorationColor, c); } 1418 void setTextDecorationColor(const StyleColor& c) { SET_VAR(rareNonInheritedD ata, m_textDecorationColor, c); }
1415 void setTextEmphasisColor(const StyleColor& c) { SET_VAR_WITH_SETTER(rareInh eritedData, textEmphasisColor, setTextEmphasisColor, c); } 1419 void setTextEmphasisColor(const StyleColor& c) { SET_VAR_WITH_SETTER(rareInh eritedData, textEmphasisColor, setTextEmphasisColor, c); }
1416 void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(rareInheritedData, textEmphasisFill, fill); } 1420 void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(rareInheritedData, textEmphasisFill, fill); }
1417 void setTextEmphasisMark(TextEmphasisMark mark) { SET_VAR(rareInheritedData, textEmphasisMark, mark); } 1421 void setTextEmphasisMark(TextEmphasisMark mark) { SET_VAR(rareInheritedData, textEmphasisMark, mark); }
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
2017 } 2021 }
2018 2022
2019 inline bool ComputedStyle::hasPseudoElementStyle() const 2023 inline bool ComputedStyle::hasPseudoElementStyle() const
2020 { 2024 {
2021 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK; 2025 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK;
2022 } 2026 }
2023 2027
2024 } // namespace blink 2028 } // namespace blink
2025 2029
2026 #endif // ComputedStyle_h 2030 #endif // ComputedStyle_h
OLDNEW
« 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