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

Side by Side Diff: include/core/SkMath.h

Issue 1777213003: Remove version checks for _MSC_VER < 1800 (msvs2013). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | include/gpu/GrConfig.h » ('j') | src/core/SkBitmapProcState_matrixProcs.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkMath_DEFINED 10 #ifndef SkMath_DEFINED
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 int32_t SkSqrtBits(int32_t value, int bitBias); 65 int32_t SkSqrtBits(int32_t value, int bitBias);
66 66
67 /** Return the integer square root of n, treated as a SkFixed (16.16) 67 /** Return the integer square root of n, treated as a SkFixed (16.16)
68 */ 68 */
69 #define SkSqrt32(n) SkSqrtBits(n, 15) 69 #define SkSqrt32(n) SkSqrtBits(n, 15)
70 70
71 //! Returns the number of leading zero bits (0...32) 71 //! Returns the number of leading zero bits (0...32)
72 int SkCLZ_portable(uint32_t); 72 int SkCLZ_portable(uint32_t);
73 73
74 #ifndef SkCLZ 74 #ifndef SkCLZ
75 #if defined(_MSC_VER) && _MSC_VER >= 1400 75 #if defined(_MSC_VER)
76 #include <intrin.h> 76 #include <intrin.h>
77 77
78 static inline int SkCLZ(uint32_t mask) { 78 static inline int SkCLZ(uint32_t mask) {
79 if (mask) { 79 if (mask) {
80 DWORD index; 80 DWORD index;
81 _BitScanReverse(&index, mask); 81 _BitScanReverse(&index, mask);
82 // Suppress this bogus /analyze warning. The check for non-zero 82 // Suppress this bogus /analyze warning. The check for non-zero
83 // guarantees that _BitScanReverse will succeed. 83 // guarantees that _BitScanReverse will succeed.
84 #pragma warning(suppress : 6102) // Using 'index' from failed function call 84 #pragma warning(suppress : 6102) // Using 'index' from failed function call
85 return index ^ 0x1F; 85 return index ^ 0x1F;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 *div = static_cast<Out>(d); 195 *div = static_cast<Out>(d);
196 *mod = static_cast<Out>(numer-d*denom); 196 *mod = static_cast<Out>(numer-d*denom);
197 #else 197 #else
198 // On x86 this will just be a single idiv. 198 // On x86 this will just be a single idiv.
199 *div = static_cast<Out>(numer/denom); 199 *div = static_cast<Out>(numer/denom);
200 *mod = static_cast<Out>(numer%denom); 200 *mod = static_cast<Out>(numer%denom);
201 #endif 201 #endif
202 } 202 }
203 203
204 #endif 204 #endif
OLDNEW
« no previous file with comments | « no previous file | include/gpu/GrConfig.h » ('j') | src/core/SkBitmapProcState_matrixProcs.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698