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

Unified Diff: cc/debug/overdraw_metrics.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/base/math_util.cc ('k') | cc/layers/layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/overdraw_metrics.cc
diff --git a/cc/debug/overdraw_metrics.cc b/cc/debug/overdraw_metrics.cc
index f707db0cba81b7064163e6225aeb96af5fb341fa..02f074535d73f2b90bf0d2e5bb901e78f8465b35 100644
--- a/cc/debug/overdraw_metrics.cc
+++ b/cc/debug/overdraw_metrics.cc
@@ -27,12 +27,13 @@ OverdrawMetrics::OverdrawMetrics(bool record_metrics_for_frame)
pixels_drawn_translucent_(0),
pixels_culled_for_drawing_(0) {}
-static inline float WedgeProduct(gfx::PointF p1, gfx::PointF p2) {
+static inline float WedgeProduct(const gfx::PointF& p1, const gfx::PointF& p2) {
return p1.x() * p2.y() - p1.y() * p2.x();
}
// Calculates area of an arbitrary convex polygon with up to 8 points.
-static inline float PolygonArea(gfx::PointF points[8], int num_points) {
+static inline float PolygonArea(const gfx::PointF (&points)[8],
+ int num_points) {
if (num_points < 3)
return 0;
« no previous file with comments | « cc/base/math_util.cc ('k') | cc/layers/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698