Lines Matching refs:SkV2
15 struct SK_API SkV2 { struct
18 bool operator==(const SkV2 v) const { return x == v.x && y == v.y; } argument
19 bool operator!=(const SkV2 v) const { return !(*this == v); }
21 static SkScalar Dot(SkV2 a, SkV2 b) { return a.x * b.x + a.y * b.y; } in Dot() argument
22 static SkScalar Cross(SkV2 a, SkV2 b) { return a.x * b.y - a.y * b.x; } in Cross() argument
23 static SkV2 Normalize(SkV2 v) { return v * (1.0f / v.length()); } in Normalize() argument
25 SkV2 operator-() const { return {-x, -y}; }
26 SkV2 operator+(SkV2 v) const { return {x+v.x, y+v.y}; }
27 SkV2 operator-(SkV2 v) const { return {x-v.x, y-v.y}; }
29 SkV2 operator*(SkV2 v) const { return {x*v.x, y*v.y}; }
30 friend SkV2 operator*(SkV2 v, SkScalar s) { return {v.x*s, v.y*s}; }
31 friend SkV2 operator*(SkScalar s, SkV2 v) { return {v.x*s, v.y*s}; }
32 friend SkV2 operator/(SkV2 v, SkScalar s) { return {v.x/s, v.y/s}; }
34 void operator+=(SkV2 v) { *this = *this + v; }
35 void operator-=(SkV2 v) { *this = *this - v; }
36 void operator*=(SkV2 v) { *this = *this * v; }
43 SkScalar dot(SkV2 v) const { return Dot(*this, v); } in dot() argument
44 SkScalar cross(SkV2 v) const { return Cross(*this, v); } in cross() argument
45 SkV2 normalize() const { return Normalize(*this); } in normalize() argument