diff options
-rw-r--r-- | bench/TimerData.cpp | 11 | ||||
-rw-r--r-- | include/core/SkPostConfig.h | 10 | ||||
-rw-r--r-- | src/utils/win/SkWGL_win.cpp | 2 |
3 files changed, 16 insertions, 7 deletions
diff --git a/bench/TimerData.cpp b/bench/TimerData.cpp index 18d41e4de1..3b4baacfcd 100644 --- a/bench/TimerData.cpp +++ b/bench/TimerData.cpp @@ -20,16 +20,15 @@ TimerData::TimerData(const SkString& perIterTimeFormat, const SkString& normalTi , fTruncatedCpuStr(" Cmsecs = ") , fGpuStr(" gmsecs = ") , fWallSum(0.0) -, fWallMin((numeric_limits<double>::max)()) // Extra parens to make the windows build work, due to - // 'max' macro +, fWallMin(numeric_limits<double>::max()) , fTruncatedWallSum(0.0) -, fTruncatedWallMin((numeric_limits<double>::max)()) +, fTruncatedWallMin(numeric_limits<double>::max()) , fCpuSum(0.0) -, fCpuMin((numeric_limits<double>::max)()) +, fCpuMin(numeric_limits<double>::max()) , fTruncatedCpuSum(0.0) -, fTruncatedCpuMin((numeric_limits<double>::max)()) +, fTruncatedCpuMin(numeric_limits<double>::max()) , fGpuSum(0.0) -, fGpuMin((numeric_limits<double>::max)()) +, fGpuMin(numeric_limits<double>::max()) , fPerIterTimeFormat(perIterTimeFormat) , fNormalTimeFormat(normalTimeFormat) {} diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h index 39d4eb73ab..022757554c 100644 --- a/include/core/SkPostConfig.h +++ b/include/core/SkPostConfig.h @@ -140,13 +140,23 @@ #define WIN32_LEAN_AND_MEAN #define WIN32_IS_MEAN_WAS_LOCALLY_DEFINED #endif + #ifndef NOMINMAX + #define NOMINMAX + #define NOMINMAX_WAS_LOCALLY_DEFINED + #endif #include <windows.h> #ifdef WIN32_IS_MEAN_WAS_LOCALLY_DEFINED + #undef WIN32_IS_MEAN_WAS_LOCALLY_DEFINED #undef WIN32_LEAN_AND_MEAN #endif + #ifdef NOMINMAX_WAS_LOCALLY_DEFINED + #undef NOMINMAX_WAS_LOCALLY_DEFINED + #undef NOMINMAX + #endif + #ifndef SK_DEBUGBREAK #define SK_DEBUGBREAK(cond) do { if (!(cond)) { SkNO_RETURN_HINT(); __debugbreak(); }} while (false) #endif diff --git a/src/utils/win/SkWGL_win.cpp b/src/utils/win/SkWGL_win.cpp index f20262b818..4b3b3e63ae 100644 --- a/src/utils/win/SkWGL_win.cpp +++ b/src/utils/win/SkWGL_win.cpp @@ -312,7 +312,7 @@ HGLRC SkCreateWGLContext(HDC dc, int msaaSampleCount, bool preferCoreProfile) { unsigned int num; int formats[64]; extensions.choosePixelFormat(dc, msaaIAttrs, fAttrs, 64, formats, &num); - num = min(num,64); + num = SkTMin(num, 64U); int formatToTry = extensions.selectFormat(formats, num, dc, |