Flutter Engine
The Flutter Engine
SkMatrix22.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
9
13
15 const SkScalar& a = h.fX;
16 const SkScalar& b = h.fY;
17 SkScalar c, s;
18 if (0 == b) {
20 s = 0;
21 //r = SkScalarAbs(a);
22 } else if (0 == a) {
23 c = 0;
25 //r = SkScalarAbs(b);
26 } else if (SkScalarAbs(b) > SkScalarAbs(a)) {
27 SkScalar t = a / b;
29 s = -SK_Scalar1 / u;
30 c = -s * t;
31 //r = b * u;
32 } else {
33 SkScalar t = b / a;
35 c = SK_Scalar1 / u;
36 s = -c * t;
37 //r = a * u;
38 }
39
40 G->setSinCos(s, c);
41}
void SkComputeGivensRotation(const SkVector &h, SkMatrix *G)
Definition: SkMatrix22.cpp:14
#define SkScalarCopySign(x, y)
Definition: SkScalar.h:40
#define SK_Scalar1
Definition: SkScalar.h:18
#define SkScalarSqrt(x)
Definition: SkScalar.h:42
#define SkScalarAbs(x)
Definition: SkScalar.h:39
float SkScalar
Definition: extension.cpp:12
static bool b
struct MyStruct s
struct MyStruct a[10]
SkScalar h
Definition: SkMD5.cpp:125