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

Side by Side Diff: src/core/SkMath.cpp

Issue 2233853002: constexpr NaN,+Inf,-Inf (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 | « src/core/SkLiteDL.cpp ('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 2008 The Android Open Source Project 2 * Copyright 2008 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 #include "SkMathPriv.h" 8 #include "SkMathPriv.h"
9 #include "SkFixed.h" 9 #include "SkFixed.h"
10 #include "SkFloatBits.h" 10 #include "SkFloatBits.h"
11 #include "SkFloatingPoint.h" 11 #include "SkFloatingPoint.h"
12 #include "SkScalar.h" 12 #include "SkScalar.h"
13 13
14 const uint32_t gIEEENotANumber = 0x7FFFFFFF;
15 const uint32_t gIEEEInfinity = 0x7F800000;
16 const uint32_t gIEEENegativeInfinity = 0xFF800000;
17
18 #define sub_shift(zeros, x, n) \ 14 #define sub_shift(zeros, x, n) \
19 zeros -= n; \ 15 zeros -= n; \
20 x >>= n 16 x >>= n
21 17
22 int SkCLZ_portable(uint32_t x) { 18 int SkCLZ_portable(uint32_t x) {
23 if (x == 0) { 19 if (x == 0) {
24 return 32; 20 return 32;
25 } 21 }
26 22
27 int zeros = 31; 23 int zeros = 31;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 if (SkScalarNearlyZero(*cosValue)) { 77 if (SkScalarNearlyZero(*cosValue)) {
82 *cosValue = 0; 78 *cosValue = 0;
83 } 79 }
84 } 80 }
85 81
86 if (SkScalarNearlyZero(sinValue)) { 82 if (SkScalarNearlyZero(sinValue)) {
87 sinValue = 0; 83 sinValue = 0;
88 } 84 }
89 return sinValue; 85 return sinValue;
90 } 86 }
OLDNEW
« no previous file with comments | « src/core/SkLiteDL.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698