| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 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 #if SK_BUILD_FOR_MAC || SK_BUILD_FOR_UNIX || SK_BUILD_FOR_ANDROID | 8 #if SK_BUILD_FOR_MAC || SK_BUILD_FOR_UNIX || SK_BUILD_FOR_ANDROID |
| 9 # include <unistd.h> | 9 # include <unistd.h> |
| 10 # include <sys/time.h> | 10 # include <sys/time.h> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 case CL_INVALID_OPERATION: return "CL_INVALID_OPERATION"; | 76 case CL_INVALID_OPERATION: return "CL_INVALID_OPERATION"; |
| 77 case CL_INVALID_GL_OBJECT: return "CL_INVALID_GL_OBJECT"; | 77 case CL_INVALID_GL_OBJECT: return "CL_INVALID_GL_OBJECT"; |
| 78 case CL_INVALID_BUFFER_SIZE: return "CL_INVALID_BUFFER_SIZE"
; | 78 case CL_INVALID_BUFFER_SIZE: return "CL_INVALID_BUFFER_SIZE"
; |
| 79 case CL_INVALID_MIP_LEVEL: return "CL_INVALID_MIP_LEVEL"; | 79 case CL_INVALID_MIP_LEVEL: return "CL_INVALID_MIP_LEVEL"; |
| 80 default: return "UNKNOWN"; | 80 default: return "UNKNOWN"; |
| 81 } | 81 } |
| 82 return "UNKNOWN"; | 82 return "UNKNOWN"; |
| 83 } | 83 } |
| 84 #endif | 84 #endif |
| 85 | 85 |
| 86 // TODO refactor BenchTimer to be used here | 86 // TODO refactor Timer to be used here |
| 87 double get_seconds() { | 87 double get_seconds() { |
| 88 #if SK_BUILD_FOR_WIN32 | 88 #if SK_BUILD_FOR_WIN32 |
| 89 LARGE_INTEGER currentTime; | 89 LARGE_INTEGER currentTime; |
| 90 LARGE_INTEGER frequency; | 90 LARGE_INTEGER frequency; |
| 91 QueryPerformanceCounter(¤tTime); | 91 QueryPerformanceCounter(¤tTime); |
| 92 QueryPerformanceFrequency(&frequency); | 92 QueryPerformanceFrequency(&frequency); |
| 93 return (double)currentTime.QuadPart / (double)frequency.QuadPart; | 93 return (double)currentTime.QuadPart / (double)frequency.QuadPart; |
| 94 #elif _POSIX_TIMERS > 0 && defined(CLOCK_REALTIME) | 94 #elif _POSIX_TIMERS > 0 && defined(CLOCK_REALTIME) |
| 95 struct timespec currentTime; | 95 struct timespec currentTime; |
| 96 clock_gettime(CLOCK_REALTIME, ¤tTime); | 96 clock_gettime(CLOCK_REALTIME, ¤tTime); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 #elif SK_BUILD_FOR_WIN32 | 197 #elif SK_BUILD_FOR_WIN32 |
| 198 SkString fullPath(MAX_PATH); | 198 SkString fullPath(MAX_PATH); |
| 199 if (_fullpath(fullPath.writable_str(), path.c_str(), MAX_PATH) == NULL) { | 199 if (_fullpath(fullPath.writable_str(), path.c_str(), MAX_PATH) == NULL) { |
| 200 fullPath.reset(); | 200 fullPath.reset(); |
| 201 } | 201 } |
| 202 return fullPath; | 202 return fullPath; |
| 203 #else | 203 #else |
| 204 return SkString(); | 204 return SkString(); |
| 205 #endif | 205 #endif |
| 206 } | 206 } |
| OLD | NEW |