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

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

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/SkLuaCanvas.cpp ('k') | src/utils/SkMatrix22.cpp » ('j') | 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 #ifndef SkMatrix22_DEFINED
9 #define SkMatrix22_DEFINED
10
8 #include "SkPoint.h" 11 #include "SkPoint.h"
9 12
10 class SkMatrix; 13 class SkMatrix;
11 14
12 /** Find the Givens matrix G, which is the rotational matrix 15 /** Find the Givens matrix G, which is the rotational matrix
13 * that rotates the vector h to the positive hoizontal axis. 16 * that rotates the vector h to the positive hoizontal axis.
14 * G * h = [hypot(h), 0] 17 * G * h = [hypot(h), 0]
15 * 18 *
16 * This is equivalent to 19 * This is equivalent to
17 * 20 *
18 * SkScalar r = h.length(); 21 * SkScalar r = h.length();
19 * SkScalar r_inv = r ? SkScalarInvert(r) : 0; 22 * SkScalar r_inv = r ? SkScalarInvert(r) : 0;
20 * h.scale(r_inv); 23 * h.scale(r_inv);
21 * G->setSinCos(-h.fY, h.fX); 24 * G->setSinCos(-h.fY, h.fX);
22 * 25 *
23 * but has better numerical stability by using (partial) hypot, 26 * but has better numerical stability by using (partial) hypot,
24 * and saves a multiply by not computing r. 27 * and saves a multiply by not computing r.
25 */ 28 */
26 void SkComputeGivensRotation(const SkVector& h, SkMatrix* G); 29 void SkComputeGivensRotation(const SkVector& h, SkMatrix* G);
30
31 #endif
OLDNEW
« no previous file with comments | « src/utils/SkLuaCanvas.cpp ('k') | src/utils/SkMatrix22.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698