LCOV - code coverage report
Current view: top level - gfx/skia/skia/src/utils - SkMatrix22.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 20 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 1 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : 
       8             : #include "SkMatrix.h"
       9             : #include "SkMatrix22.h"
      10             : #include "SkPoint.h"
      11             : #include "SkScalar.h"
      12             : 
      13           0 : void SkComputeGivensRotation(const SkVector& h, SkMatrix* G) {
      14           0 :     const SkScalar& a = h.fX;
      15           0 :     const SkScalar& b = h.fY;
      16             :     SkScalar c, s;
      17           0 :     if (0 == b) {
      18           0 :         c = SkScalarCopySign(SK_Scalar1, a);
      19           0 :         s = 0;
      20             :         //r = SkScalarAbs(a);
      21           0 :     } else if (0 == a) {
      22           0 :         c = 0;
      23           0 :         s = -SkScalarCopySign(SK_Scalar1, b);
      24             :         //r = SkScalarAbs(b);
      25           0 :     } else if (SkScalarAbs(b) > SkScalarAbs(a)) {
      26           0 :         SkScalar t = a / b;
      27           0 :         SkScalar u = SkScalarCopySign(SkScalarSqrt(SK_Scalar1 + t*t), b);
      28           0 :         s = -SK_Scalar1 / u;
      29           0 :         c = -s * t;
      30             :         //r = b * u;
      31             :     } else {
      32           0 :         SkScalar t = b / a;
      33           0 :         SkScalar u = SkScalarCopySign(SkScalarSqrt(SK_Scalar1 + t*t), a);
      34           0 :         c = SK_Scalar1 / u;
      35           0 :         s = -c * t;
      36             :         //r = a * u;
      37             :     }
      38             : 
      39           0 :     G->setSinCos(s, c);
      40           0 : }

Generated by: LCOV version 1.13