Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(591)

Side by Side Diff: src/utils/SkMatrix22.cpp

Issue 242643008: fix warnings around size_t/int (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/utils/SkMatrix22.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkMatrix.h" 8 #include "SkMatrix.h"
9 #include "SkMatrix22.h"
9 #include "SkPoint.h" 10 #include "SkPoint.h"
10 #include "SkScalar.h" 11 #include "SkScalar.h"
11 12
12 void SkComputeGivensRotation(const SkVector& h, SkMatrix* G) { 13 void SkComputeGivensRotation(const SkVector& h, SkMatrix* G) {
13 const SkScalar& a = h.fX; 14 const SkScalar& a = h.fX;
14 const SkScalar& b = h.fY; 15 const SkScalar& b = h.fY;
15 SkScalar c, s; 16 SkScalar c, s;
16 if (0 == b) { 17 if (0 == b) {
17 c = SkScalarCopySign(SK_Scalar1, a); 18 c = SkScalarCopySign(SK_Scalar1, a);
18 s = 0; 19 s = 0;
(...skipping 11 matching lines...) Expand all
30 } else { 31 } else {
31 SkScalar t = b / a; 32 SkScalar t = b / a;
32 SkScalar u = SkScalarCopySign(SkScalarSqrt(SK_Scalar1 + t*t), a); 33 SkScalar u = SkScalarCopySign(SkScalarSqrt(SK_Scalar1 + t*t), a);
33 c = SK_Scalar1 / u; 34 c = SK_Scalar1 / u;
34 s = -c * t; 35 s = -c * t;
35 //r = a * u; 36 //r = a * u;
36 } 37 }
37 38
38 G->setSinCos(s, c); 39 G->setSinCos(s, c);
39 } 40 }
OLDNEW
« no previous file with comments | « src/utils/SkMatrix22.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698