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

Side by Side Diff: tools/skpdiff/skpdiff_util.cpp

Issue 344213003: Move BenchTimer to tools as Timer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixes Created 6 years, 6 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
OLDNEW
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
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(&currentTime); 91 QueryPerformanceCounter(&currentTime);
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, &currentTime); 96 clock_gettime(CLOCK_REALTIME, &currentTime);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « tools/bench_record.cpp ('k') | tools/timer/GpuTimer.h » ('j') | tools/timer/GpuTimer.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698