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