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

Unified Diff: Source/core/rendering/style/RenderStyle.cpp

Issue 305883002: Switch arguments to const Length references for performance (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | « Source/core/rendering/style/RenderStyle.h ('k') | Source/platform/LengthBox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/style/RenderStyle.cpp
diff --git a/Source/core/rendering/style/RenderStyle.cpp b/Source/core/rendering/style/RenderStyle.cpp
index 9853249c8048f650f98f2e0ff507d00de1a09581..97f88823e1d0ee028956f5c4e7f7d57c98092886 100644
--- a/Source/core/rendering/style/RenderStyle.cpp
+++ b/Source/core/rendering/style/RenderStyle.cpp
@@ -723,7 +723,7 @@ unsigned RenderStyle::computeChangedContextSensitiveProperties(const RenderStyle
return changedContextSensitiveProperties;
}
-void RenderStyle::setClip(Length top, Length right, Length bottom, Length left)
+void RenderStyle::setClip(const Length& top, const Length& right, const Length& bottom, const Length& left)
{
StyleVisualData* data = visual.access();
data->clip.m_top = top;
@@ -1194,7 +1194,8 @@ Length RenderStyle::lineHeight() const
return lh;
}
-void RenderStyle::setLineHeight(Length specifiedLineHeight) { SET_VAR(inherited, line_height, specifiedLineHeight); }
+
+void RenderStyle::setLineHeight(const Length& specifiedLineHeight) { SET_VAR(inherited, line_height, specifiedLineHeight); }
int RenderStyle::computedLineHeight() const
{
@@ -1597,7 +1598,7 @@ unsigned short RenderStyle::borderEndWidth() const
return isLeftToRightDirection() ? borderBottomWidth() : borderTopWidth();
}
-void RenderStyle::setMarginStart(Length margin)
+void RenderStyle::setMarginStart(const Length& margin)
{
if (isHorizontalWritingMode()) {
if (isLeftToRightDirection())
@@ -1612,7 +1613,7 @@ void RenderStyle::setMarginStart(Length margin)
}
}
-void RenderStyle::setMarginEnd(Length margin)
+void RenderStyle::setMarginEnd(const Length& margin)
{
if (isHorizontalWritingMode()) {
if (isLeftToRightDirection())
@@ -1659,7 +1660,7 @@ void RenderStyle::setBorderImageSource(PassRefPtr<StyleImage> image)
surround.access()->border.m_image.setImage(image);
}
-void RenderStyle::setBorderImageSlices(LengthBox slices)
+void RenderStyle::setBorderImageSlices(const LengthBox& slices)
{
if (surround->border.m_image.imageSlices() == slices)
return;
« no previous file with comments | « Source/core/rendering/style/RenderStyle.h ('k') | Source/platform/LengthBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698