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

Side by Side Diff: src/core/SkFDot6.h

Issue 1841123002: Reverse dependency between SkScalar.h and SkFixed.h (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 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
« no previous file with comments | « samplecode/SamplePath.cpp ('k') | src/core/SkFontDescriptor.h » ('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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 8
9 #ifndef SkFDot6_DEFINED 9 #ifndef SkFDot6_DEFINED
10 #define SkFDot6_DEFINED 10 #define SkFDot6_DEFINED
11 11
12 #include "SkFixed.h"
12 #include "SkScalar.h" 13 #include "SkScalar.h"
13 #include "SkMath.h" 14 #include "SkMath.h"
14 15
15 typedef int32_t SkFDot6; 16 typedef int32_t SkFDot6;
16 17
17 /* This uses the magic number approach suggested here: 18 /* This uses the magic number approach suggested here:
18 * http://stereopsis.com/sree/fpu2006.html and used in 19 * http://stereopsis.com/sree/fpu2006.html and used in
19 * _cairo_fixed_from_double. It does banker's rounding 20 * _cairo_fixed_from_double. It does banker's rounding
20 * (i.e. round to nearest even) 21 * (i.e. round to nearest even)
21 */ 22 */
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 SkASSERT(b != 0); 69 SkASSERT(b != 0);
69 70
70 if (a == (int16_t)a) { 71 if (a == (int16_t)a) {
71 return SkLeftShift(a, 16) / b; 72 return SkLeftShift(a, 16) / b;
72 } else { 73 } else {
73 return SkFixedDiv(a, b); 74 return SkFixedDiv(a, b);
74 } 75 }
75 } 76 }
76 77
77 #endif 78 #endif
OLDNEW
« no previous file with comments | « samplecode/SamplePath.cpp ('k') | src/core/SkFontDescriptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698