aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/core/SkMath.h2
-rw-r--r--include/gpu/GrConfig.h16
-rw-r--r--include/private/SkFloatingPoint.h28
-rw-r--r--src/animator/SkDisplayType.cpp2
-rw-r--r--src/animator/SkDrawColor.cpp4
-rw-r--r--src/core/SkBitmapProcState_matrixProcs.cpp10
-rw-r--r--src/core/SkBlitter_ARGB32.cpp4
-rw-r--r--src/core/SkDraw.cpp4
-rw-r--r--src/core/SkRegion.cpp4
-rw-r--r--src/core/SkScan_Path.cpp4
-rw-r--r--src/effects/gradients/SkGradientShaderPriv.h10
-rw-r--r--src/effects/gradients/SkLinearGradient.cpp10
-rw-r--r--src/sfnt/SkTypedEnum.h2
-rw-r--r--src/utils/SkBase64.cpp4
14 files changed, 18 insertions, 86 deletions
diff --git a/include/core/SkMath.h b/include/core/SkMath.h
index e5069592d0..abb685f6da 100644
--- a/include/core/SkMath.h
+++ b/include/core/SkMath.h
@@ -72,7 +72,7 @@ int32_t SkSqrtBits(int32_t value, int bitBias);
int SkCLZ_portable(uint32_t);
#ifndef SkCLZ
- #if defined(_MSC_VER) && _MSC_VER >= 1400
+ #if defined(_MSC_VER)
#include <intrin.h>
static inline int SkCLZ(uint32_t mask) {
diff --git a/include/gpu/GrConfig.h b/include/gpu/GrConfig.h
index bb653b6a7d..8e0efbd472 100644
--- a/include/gpu/GrConfig.h
+++ b/include/gpu/GrConfig.h
@@ -106,7 +106,7 @@ typedef unsigned __int64 uint64_t;
* particular compiler.
* To insert compiler warnings use "#pragma message GR_WARN(<string>)"
*/
-#if defined(_MSC_VER) && _MSC_VER
+#if defined(_MSC_VER)
#define GR_WARN(MSG) (GR_FILE_AND_LINE_STR "WARNING: " MSG)
#else//__GNUC__ - may need other defines for different compilers
#define GR_WARN(MSG) ("WARNING: " MSG)
@@ -171,19 +171,7 @@ typedef unsigned __int64 uint64_t;
* it may print the message in the compiler log. Obviously, the condition must
* be evaluatable at compile time.
*/
-// VS 2010 and GCC compiled with c++0x or gnu++0x support the new
-// static_assert.
-#if !defined(GR_STATIC_ASSERT)
- #if (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)
- #define GR_STATIC_ASSERT(CONDITION) static_assert(CONDITION, "bug")
- #else
- template <bool> class GR_STATIC_ASSERT_FAILURE;
- template <> class GR_STATIC_ASSERT_FAILURE<true> {};
- #define GR_STATIC_ASSERT(CONDITION) \
- enum {GR_CONCAT(X,__LINE__) = \
- sizeof(GR_STATIC_ASSERT_FAILURE<CONDITION>)}
- #endif
-#endif
+#define GR_STATIC_ASSERT(CONDITION) static_assert(CONDITION, "bug")
/**
* Set to 1 to enable pixel local storage path rendering on supported devices.
diff --git a/include/private/SkFloatingPoint.h b/include/private/SkFloatingPoint.h
index ffed5c0747..efaf4109f1 100644
--- a/include/private/SkFloatingPoint.h
+++ b/include/private/SkFloatingPoint.h
@@ -29,33 +29,6 @@ static inline float sk_float_pow(float base, float exp) {
return powf(base, exp);
}
-static inline float sk_float_copysign(float x, float y) {
-// c++11 contains a 'float copysign(float, float)' function in <cmath>.
-// clang-cl reports __cplusplus for clang, not the __cplusplus vc++ version _MSC_VER would report.
-#if (defined(_MSC_VER) && defined(__clang__))
-# define SK_BUILD_WITH_CLANG_CL 1
-#else
-# define SK_BUILD_WITH_CLANG_CL 0
-#endif
-#if (!SK_BUILD_WITH_CLANG_CL && __cplusplus >= 201103L) || (_MSC_VER >= 1800)
- return copysignf(x, y);
-
-// Posix has demanded 'float copysignf(float, float)' (from C99) since Issue 6.
-#elif defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L
- return copysignf(x, y);
-
-// Visual studio prior to 13 only has 'double _copysign(double, double)'.
-#elif defined(_MSC_VER)
- return (float)_copysign(x, y);
-
-// Otherwise convert to bits and extract sign.
-#else
- int32_t xbits = SkFloat2Bits(x);
- int32_t ybits = SkFloat2Bits(y);
- return SkBits2Float((xbits & 0x7FFFFFFF) | (ybits & 0x80000000));
-#endif
-}
-
#define sk_float_sqrt(x) sqrtf(x)
#define sk_float_sin(x) sinf(x)
#define sk_float_cos(x) cosf(x)
@@ -71,6 +44,7 @@ static inline float sk_float_copysign(float x, float y) {
#endif
#define sk_float_atan2(y,x) atan2f(y,x)
#define sk_float_abs(x) fabsf(x)
+#define sk_float_copysign(x, y) copysignf(x, y)
#define sk_float_mod(x,y) fmodf(x,y)
#define sk_float_exp(x) expf(x)
#define sk_float_log(x) logf(x)
diff --git a/src/animator/SkDisplayType.cpp b/src/animator/SkDisplayType.cpp
index 7ee8dab5a4..92d120eb96 100644
--- a/src/animator/SkDisplayType.cpp
+++ b/src/animator/SkDisplayType.cpp
@@ -730,7 +730,7 @@ void SkDisplayType::UnitTest() {
SkDisplayable* test = CreateInstance(maker, gTypeNames[index].fType);
if (test == nullptr)
continue;
-#if defined _WIN32 && _MSC_VER >= 1300 && defined _INC_CRTDBG // only on windows, only if using "crtdbg.h"
+#if defined _WIN32 && defined _INC_CRTDBG // only on windows, only if using "crtdbg.h"
// we know that crtdbg puts 0xfdfdfdfd at the end of the block
// look for unitialized memory, signature 0xcdcdcdcd prior to that
int* start = (int*) test;
diff --git a/src/animator/SkDrawColor.cpp b/src/animator/SkDrawColor.cpp
index c2d0dae8fe..529d9a5954 100644
--- a/src/animator/SkDrawColor.cpp
+++ b/src/animator/SkDrawColor.cpp
@@ -52,7 +52,7 @@ static SkScalar RGB_to_HSV(SkColor color, HSV_Choice choice) {
return hue;
}
-#if defined _WIN32 && _MSC_VER >= 1300 // disable 'red', etc. may be used without having been initialized
+#if defined _WIN32 // disable 'red', etc. may be used without having been initialized
#pragma warning ( push )
#pragma warning ( disable : 4701 )
#endif
@@ -89,7 +89,7 @@ static SkColor HSV_to_RGB(SkColor color, HSV_Choice choice, SkScalar hsv) {
SkScalarRoundToInt(green), SkScalarRoundToInt(blue));
}
-#if defined _WIN32 && _MSC_VER >= 1300
+#if defined _WIN32
#pragma warning ( pop )
#endif
diff --git a/src/core/SkBitmapProcState_matrixProcs.cpp b/src/core/SkBitmapProcState_matrixProcs.cpp
index de97a905d4..16f1bc6f28 100644
--- a/src/core/SkBitmapProcState_matrixProcs.cpp
+++ b/src/core/SkBitmapProcState_matrixProcs.cpp
@@ -171,22 +171,12 @@ static inline U16CPU fixed_repeat(SkFixed x) {
return x & 0xFFFF;
}
-// Visual Studio 2010 (MSC_VER=1600) optimizes bit-shift code incorrectly.
-// See http://code.google.com/p/skia/issues/detail?id=472
-#if defined(_MSC_VER) && (_MSC_VER >= 1600)
-#pragma optimize("", off)
-#endif
-
static inline U16CPU fixed_mirror(SkFixed x) {
SkFixed s = SkLeftShift(x, 15) >> 31;
// s is FFFFFFFF if we're on an odd interval, or 0 if an even interval
return (x ^ s) & 0xFFFF;
}
-#if defined(_MSC_VER) && (_MSC_VER >= 1600)
-#pragma optimize("", on)
-#endif
-
static SkBitmapProcState::FixedTileProc choose_tile_proc(unsigned m) {
if (SkShader::kClamp_TileMode == m) {
return fixed_clamp;
diff --git a/src/core/SkBlitter_ARGB32.cpp b/src/core/SkBlitter_ARGB32.cpp
index a00ed86d8e..af62f2eb1d 100644
--- a/src/core/SkBlitter_ARGB32.cpp
+++ b/src/core/SkBlitter_ARGB32.cpp
@@ -62,7 +62,7 @@ const SkPixmap* SkARGB32_Blitter::justAnOpaqueColor(uint32_t* value) {
return nullptr;
}
-#if defined _WIN32 && _MSC_VER >= 1300 // disable warning : local variable used without having been initialized
+#if defined _WIN32 // disable warning : local variable used without having been initialized
#pragma warning ( push )
#pragma warning ( disable : 4701 )
#endif
@@ -252,7 +252,7 @@ void SkARGB32_Blitter::blitRect(int x, int y, int width, int height) {
}
}
-#if defined _WIN32 && _MSC_VER >= 1300
+#if defined _WIN32
#pragma warning ( pop )
#endif
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 409b652e93..70eb5732e1 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1435,7 +1435,7 @@ void SkDraw::drawText_asPaths(const char text[], size_t byteLength,
}
// disable warning : local variable used without having been initialized
-#if defined _WIN32 && _MSC_VER >= 1300
+#if defined _WIN32
#pragma warning ( push )
#pragma warning ( disable : 4701 )
#endif
@@ -1671,7 +1671,7 @@ void SkDraw::drawPosText(const char text[], size_t byteLength,
offset, *fMatrix, pos, scalarsPerPosition, textAlignment, cache.get(), drawOneGlyph);
}
-#if defined _WIN32 && _MSC_VER >= 1300
+#if defined _WIN32
#pragma warning ( pop )
#endif
diff --git a/src/core/SkRegion.cpp b/src/core/SkRegion.cpp
index 3a542c6169..ba6658182a 100644
--- a/src/core/SkRegion.cpp
+++ b/src/core/SkRegion.cpp
@@ -599,7 +599,7 @@ bool SkRegion::setRects(const SkIRect rects[], int count) {
///////////////////////////////////////////////////////////////////////////////
-#if defined _WIN32 && _MSC_VER >= 1300 // disable warning : local variable used without having been initialized
+#if defined _WIN32 // disable warning : local variable used without having been initialized
#pragma warning ( push )
#pragma warning ( disable : 4701 )
#endif
@@ -737,7 +737,7 @@ static SkRegion::RunType* operate_on_span(const SkRegion::RunType a_runs[],
return dst;
}
-#if defined _WIN32 && _MSC_VER >= 1300
+#if defined _WIN32
#pragma warning ( pop )
#endif
diff --git a/src/core/SkScan_Path.cpp b/src/core/SkScan_Path.cpp
index 4508865a99..6c1f1c052d 100644
--- a/src/core/SkScan_Path.cpp
+++ b/src/core/SkScan_Path.cpp
@@ -119,7 +119,7 @@ static void validate_edges_for_y(const SkEdge* edge, int curr_y) {
#define validate_edges_for_y(edge, curr_y)
#endif
-#if defined _WIN32 && _MSC_VER >= 1300 // disable warning : local variable used without having been initialized
+#if defined _WIN32 // disable warning : local variable used without having been initialized
#pragma warning ( push )
#pragma warning ( disable : 4701 )
#endif
@@ -392,7 +392,7 @@ static void PrePostInverseBlitterProc(SkBlitter* blitter, int y, bool isStart) {
///////////////////////////////////////////////////////////////////////////////
-#if defined _WIN32 && _MSC_VER >= 1300
+#if defined _WIN32
#pragma warning ( pop )
#endif
diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h
index 5b1b09b9fc..1a6d391de3 100644
--- a/src/effects/gradients/SkGradientShaderPriv.h
+++ b/src/effects/gradients/SkGradientShaderPriv.h
@@ -51,21 +51,11 @@ static inline SkFixed repeat_tileproc(SkFixed x) {
// Mirror
-// Visual Studio 2010 (MSC_VER=1600) optimizes bit-shift code incorrectly.
-// See http://code.google.com/p/skia/issues/detail?id=472
-#if defined(_MSC_VER) && (_MSC_VER >= 1600)
-#pragma optimize("", off)
-#endif
-
static inline SkFixed mirror_tileproc(SkFixed x) {
int s = SkLeftShift(x, 15) >> 31;
return (x ^ s) & 0xFFFF;
}
-#if defined(_MSC_VER) && (_MSC_VER >= 1600)
-#pragma optimize("", on)
-#endif
-
///////////////////////////////////////////////////////////////////////////////
typedef SkFixed (*TileProc)(SkFixed);
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index 8ad120991d..0a2b1581d5 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -17,12 +17,6 @@ static inline int repeat_8bits(int x) {
return x & 0xFF;
}
-// Visual Studio 2010 (MSC_VER=1600) optimizes bit-shift code incorrectly.
-// See http://code.google.com/p/skia/issues/detail?id=472
-#if defined(_MSC_VER) && (_MSC_VER >= 1600)
-#pragma optimize("", off)
-#endif
-
static inline int mirror_8bits(int x) {
if (x & 256) {
x = ~x;
@@ -30,10 +24,6 @@ static inline int mirror_8bits(int x) {
return x & 255;
}
-#if defined(_MSC_VER) && (_MSC_VER >= 1600)
-#pragma optimize("", on)
-#endif
-
static SkMatrix pts_to_unit_matrix(const SkPoint pts[2]) {
SkVector vec = pts[1] - pts[0];
SkScalar mag = vec.length();
diff --git a/src/sfnt/SkTypedEnum.h b/src/sfnt/SkTypedEnum.h
index 73d7314885..19d57acf0a 100644
--- a/src/sfnt/SkTypedEnum.h
+++ b/src/sfnt/SkTypedEnum.h
@@ -19,7 +19,7 @@
#endif
//Detect if typed enums are supported.
-#if defined(_MSC_VER) && _MSC_VER >= 1400
+#if defined(_MSC_VER)
#define SK_TYPED_ENUMS
#elif defined(__clang__) && __has_extension(cxx_strong_enums)
diff --git a/src/utils/SkBase64.cpp b/src/utils/SkBase64.cpp
index 4c3078f255..b0268921ed 100644
--- a/src/utils/SkBase64.cpp
+++ b/src/utils/SkBase64.cpp
@@ -29,7 +29,7 @@ static const signed char decodeData[] = {
SkBase64::SkBase64() : fLength((size_t) -1), fData(nullptr) {
}
-#if defined _WIN32 && _MSC_VER >= 1300 // disable 'two', etc. may be used without having been initialized
+#if defined _WIN32 // disable 'two', etc. may be used without having been initialized
#pragma warning ( push )
#pragma warning ( disable : 4701 )
#endif
@@ -105,7 +105,7 @@ goHome:
return kNoError;
}
-#if defined _WIN32 && _MSC_VER >= 1300
+#if defined _WIN32
#pragma warning ( pop )
#endif