Remove unnecessary static function

Use gfx::CrossProduct() instead of defining a new static function.

BUG=

Review URL: https://codereview.chromium.org/444983002

Cr-Commit-Position: refs/heads/master@{#288372}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288372 0039d316-1c4b-4281-b951-d872f2087c98
parent 993aa3f8
......@@ -23,11 +23,6 @@ namespace cc {
// the test scene went away.
const float k_layer_epsilon = 1e-4f;
inline static float PerpProduct(const gfx::Vector2dF& u,
const gfx::Vector2dF& v) {
return u.x() * v.y() - u.y() * v.x();
}
// 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(const gfx::PointF& a,
......@@ -39,7 +34,7 @@ static bool EdgeEdgeTest(const gfx::PointF& a,
gfx::Vector2dF v = d - c;
gfx::Vector2dF w = a - c;
float denom = PerpProduct(u, v);
float denom = static_cast<float>(gfx::CrossProduct(u, v));
// If denom == 0 then the edges are parallel. While they could be overlapping
// we don't bother to check here as the we'll find their intersections from
......@@ -47,11 +42,11 @@ static bool EdgeEdgeTest(const gfx::PointF& a,
if (!denom)
return false;
float s = PerpProduct(v, w) / denom;
float s = static_cast<float>(gfx::CrossProduct(v, w)) / denom;
if (s < 0.f || s > 1.f)
return false;
float t = PerpProduct(u, w) / denom;
float t = static_cast<float>(gfx::CrossProduct(u, w)) / denom;
if (t < 0.f || t > 1.f)
return false;
......
......@@ -11,10 +11,10 @@
#include "base/containers/hash_tables.h"
#include "cc/base/cc_export.h"
#include "cc/layers/layer_impl.h"
#include "ui/gfx/point3_f.h"
#include "ui/gfx/quad_f.h"
#include "ui/gfx/rect_f.h"
#include "ui/gfx/vector3d_f.h"
#include "ui/gfx/geometry/point3_f.h"
#include "ui/gfx/geometry/quad_f.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/vector3d_f.h"
#if defined(COMPILER_GCC)
namespace cc { struct GraphEdge; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment