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

Unified Diff: Source/core/rendering/style/BasicShapes.h

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/RenderBoxModelObject.cpp ('k') | Source/core/rendering/style/FillLayer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/style/BasicShapes.h
diff --git a/Source/core/rendering/style/BasicShapes.h b/Source/core/rendering/style/BasicShapes.h
index 21bd8f8a8268aea1d3331e7c6b41c597d4c7475f..6f414688e28b28863473fbd014663e6b250a4069 100644
--- a/Source/core/rendering/style/BasicShapes.h
+++ b/Source/core/rendering/style/BasicShapes.h
@@ -88,7 +88,7 @@ public:
updateComputedLength();
}
- BasicShapeCenterCoordinate(Direction direction, Length length)
+ BasicShapeCenterCoordinate(Direction direction, const Length& length)
: m_direction(direction)
, m_length(length)
{
@@ -129,7 +129,7 @@ public:
FarthestSide
};
BasicShapeRadius() : m_value(Undefined), m_type(ClosestSide) { }
- explicit BasicShapeRadius(Length v) : m_value(v), m_type(Value) { }
+ explicit BasicShapeRadius(const Length& v) : m_value(v), m_type(Value) { }
explicit BasicShapeRadius(Type t) : m_value(Undefined), m_type(t) { }
BasicShapeRadius(const BasicShapeRadius& other) : m_value(other.value()), m_type(other.type()) { }
bool operator==(const BasicShapeRadius& other) const { return m_type == other.m_type && m_value == other.m_value; }
@@ -225,7 +225,7 @@ public:
Length getYAt(unsigned i) const { return m_values.at(2 * i + 1); }
void setWindRule(WindRule windRule) { m_windRule = windRule; }
- void appendPoint(Length x, Length y) { m_values.append(x); m_values.append(y); }
+ void appendPoint(const Length& x, const Length& y) { m_values.append(x); m_values.append(y); }
virtual void path(Path&, const FloatRect&) OVERRIDE;
virtual PassRefPtr<BasicShape> blend(const BasicShape*, double) const OVERRIDE;
@@ -259,15 +259,15 @@ public:
const LengthSize& bottomRightRadius() const { return m_bottomRightRadius; }
const LengthSize& bottomLeftRadius() const { return m_bottomLeftRadius; }
- void setTop(Length top) { m_top = top; }
- void setRight(Length right) { m_right = right; }
- void setBottom(Length bottom) { m_bottom = bottom; }
- void setLeft(Length left) { m_left = left; }
+ void setTop(const Length& top) { m_top = top; }
+ void setRight(const Length& right) { m_right = right; }
+ void setBottom(const Length& bottom) { m_bottom = bottom; }
+ void setLeft(const Length& left) { m_left = left; }
- void setTopLeftRadius(LengthSize radius) { m_topLeftRadius = radius; }
- void setTopRightRadius(LengthSize radius) { m_topRightRadius = radius; }
- void setBottomRightRadius(LengthSize radius) { m_bottomRightRadius = radius; }
- void setBottomLeftRadius(LengthSize radius) { m_bottomLeftRadius = radius; }
+ void setTopLeftRadius(const LengthSize& radius) { m_topLeftRadius = radius; }
+ void setTopRightRadius(const LengthSize& radius) { m_topRightRadius = radius; }
+ void setBottomRightRadius(const LengthSize& radius) { m_bottomRightRadius = radius; }
+ void setBottomLeftRadius(const LengthSize& radius) { m_bottomLeftRadius = radius; }
virtual void path(Path&, const FloatRect&) OVERRIDE;
virtual PassRefPtr<BasicShape> blend(const BasicShape*, double) const OVERRIDE;
« no previous file with comments | « Source/core/rendering/RenderBoxModelObject.cpp ('k') | Source/core/rendering/style/FillLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698