| * Copyright 2014 Google Inc. |
| * Use of this source code is governed by a BSD-style license that can be |
| * found in the LICENSE file. |
| #include "src/utils/SkMatrix22.h" |
| #include "include/core/SkMatrix.h" |
| #include "include/core/SkPoint.h" |
| #include "include/core/SkScalar.h" |
| void SkComputeGivensRotation(const SkVector& h, SkMatrix* G) { |
| const SkScalar& a = h.fX; |
| const SkScalar& b = h.fY; |
| c = SkScalarCopySign(SK_Scalar1, a); |
| s = -SkScalarCopySign(SK_Scalar1, b); |
| } else if (SkScalarAbs(b) > SkScalarAbs(a)) { |
| SkScalar u = SkScalarCopySign(SkScalarSqrt(SK_Scalar1 + t*t), b); |
| SkScalar u = SkScalarCopySign(SkScalarSqrt(SK_Scalar1 + t*t), a); |