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

Unified Diff: cc/trees/layer_sorter.cc

Issue 139233002: [#4] Pass gfx structs by const ref (gfx::PointF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected as per review comments! Created 6 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 | « cc/trees/layer_sorter.h ('k') | cc/trees/layer_tree_host_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_sorter.cc
diff --git a/cc/trees/layer_sorter.cc b/cc/trees/layer_sorter.cc
index 73fe3efcb1ea982517198acf640f4c471a9658db..9287f19c05ac598b492d7d11db1133b627426e31 100644
--- a/cc/trees/layer_sorter.cc
+++ b/cc/trees/layer_sorter.cc
@@ -29,10 +29,10 @@ inline static float PerpProduct(gfx::Vector2dF u, gfx::Vector2dF v) {
// Tests if two edges defined by their endpoints (a,b) and (c,d) intersect.
// Returns true and the point of intersection if they do and false otherwise.
-static bool EdgeEdgeTest(gfx::PointF a,
- gfx::PointF b,
- gfx::PointF c,
- gfx::PointF d,
+static bool EdgeEdgeTest(const gfx::PointF& a,
+ const gfx::PointF& b,
+ const gfx::PointF& c,
+ const gfx::PointF& d,
gfx::PointF* r) {
gfx::Vector2dF u = b - a;
gfx::Vector2dF v = d - c;
@@ -242,7 +242,7 @@ LayerShape::~LayerShape() {}
// to point p which lies on the z = 0 plane. It does it by computing the
// intersection of a line starting from p along the Z axis and the plane
// of the layer.
-float LayerShape::LayerZFromProjectedPoint(gfx::PointF p) const {
+float LayerShape::LayerZFromProjectedPoint(const gfx::PointF& p) const {
gfx::Vector3dF z_axis(0.f, 0.f, 1.f);
gfx::Vector3dF w = gfx::Point3F(p) - transform_origin;
« no previous file with comments | « cc/trees/layer_sorter.h ('k') | cc/trees/layer_tree_host_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698