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

Side by Side Diff: bench/benchmain.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 2011 Google Inc. 2 * Copyright 2011 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 #include "BenchLogger.h" 8 #include "BenchLogger.h"
9 #include "BenchTimer.h"
10 #include "Benchmark.h" 9 #include "Benchmark.h"
11 #include "CrashHandler.h" 10 #include "CrashHandler.h"
12 #include "GMBench.h" 11 #include "GMBench.h"
13 #include "ResultsWriter.h" 12 #include "ResultsWriter.h"
14 #include "SkBitmapDevice.h" 13 #include "SkBitmapDevice.h"
15 #include "SkCanvas.h" 14 #include "SkCanvas.h"
16 #include "SkColorPriv.h" 15 #include "SkColorPriv.h"
17 #include "SkCommandLineFlags.h" 16 #include "SkCommandLineFlags.h"
18 #include "SkData.h" 17 #include "SkData.h"
19 #include "SkDeferredCanvas.h" 18 #include "SkDeferredCanvas.h"
20 #include "SkGraphics.h" 19 #include "SkGraphics.h"
21 #include "SkImageEncoder.h" 20 #include "SkImageEncoder.h"
22 #include "SkOSFile.h" 21 #include "SkOSFile.h"
23 #include "SkPicture.h" 22 #include "SkPicture.h"
24 #include "SkPictureRecorder.h" 23 #include "SkPictureRecorder.h"
25 #include "SkString.h" 24 #include "SkString.h"
26 #include "SkSurface.h" 25 #include "SkSurface.h"
26 #include "Timer.h"
27 27
28 #if SK_SUPPORT_GPU 28 #if SK_SUPPORT_GPU
29 #include "GrContext.h" 29 #include "GrContext.h"
30 #include "GrContextFactory.h" 30 #include "GrContextFactory.h"
31 #include "GrRenderTarget.h" 31 #include "GrRenderTarget.h"
32 #include "SkGpuDevice.h" 32 #include "SkGpuDevice.h"
33 #include "gl/GrGLDefines.h" 33 #include "gl/GrGLDefines.h"
34 #else 34 #else
35 class GrContext; 35 class GrContext;
36 #endif // SK_SUPPORT_GPU 36 #endif // SK_SUPPORT_GPU
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 if (!loggedBenchName) { 523 if (!loggedBenchName) {
524 loggedBenchName = true; 524 loggedBenchName = true;
525 writer.bench(bench->getName(), dim.fX, dim.fY); 525 writer.bench(bench->getName(), dim.fX, dim.fY);
526 } 526 }
527 527
528 #if SK_SUPPORT_GPU 528 #if SK_SUPPORT_GPU
529 SkGLContextHelper* contextHelper = NULL; 529 SkGLContextHelper* contextHelper = NULL;
530 if (Benchmark::kGPU_Backend == config.backend) { 530 if (Benchmark::kGPU_Backend == config.backend) {
531 contextHelper = gContextFactory.getGLContext(config.contextType) ; 531 contextHelper = gContextFactory.getGLContext(config.contextType) ;
532 } 532 }
533 BenchTimer timer(contextHelper); 533 Timer timer(contextHelper);
534 #else 534 #else
535 BenchTimer timer; 535 Timer timer;
536 #endif 536 #endif
537 537
538 double previous = std::numeric_limits<double>::infinity(); 538 double previous = std::numeric_limits<double>::infinity();
539 bool converged = false; 539 bool converged = false;
540 540
541 // variables used to compute loopsPerFrame 541 // variables used to compute loopsPerFrame
542 double frameIntervalTime = 0.0f; 542 double frameIntervalTime = 0.0f;
543 int frameIntervalTotalLoops = 0; 543 int frameIntervalTotalLoops = 0;
544 544
545 bool frameIntervalComputed = false; 545 bool frameIntervalComputed = false;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 gContextFactory.destroyContexts(); 677 gContextFactory.destroyContexts();
678 #endif 678 #endif
679 return 0; 679 return 0;
680 } 680 }
681 681
682 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) 682 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
683 int main(int argc, char * const argv[]) { 683 int main(int argc, char * const argv[]) {
684 return tool_main(argc, (char**) argv); 684 return tool_main(argc, (char**) argv);
685 } 685 }
686 #endif 686 #endif
OLDNEW
« no previous file with comments | « bench/TimerData.cpp ('k') | debugger/QT/SkDebuggerGUI.cpp » ('j') | tools/timer/GpuTimer.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698