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

Side by Side Diff: bench/nanobench.cpp

Issue 657373002: Make nanobench and dm be usable from Chromium build (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: try with dm.cpp being DM.cpp Created 6 years, 1 month 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
« no previous file with comments | « bench/nanobench.h ('k') | bench/nanobench_main.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 <ctype.h> 8 #include <ctype.h>
9 9
10 #include "Benchmark.h" 10 #include "Benchmark.h"
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 SkTArray<SkScalar> fScales; 565 SkTArray<SkScalar> fScales;
566 SkTArray<SkString> fSKPs; 566 SkTArray<SkString> fSKPs;
567 567
568 const char* fSourceType; // What we're benching: bench, GM, SKP, ... 568 const char* fSourceType; // What we're benching: bench, GM, SKP, ...
569 const char* fBenchType; // How we bench it: micro, recording, playback, .. . 569 const char* fBenchType; // How we bench it: micro, recording, playback, .. .
570 int fCurrentRecording; 570 int fCurrentRecording;
571 int fCurrentScale; 571 int fCurrentScale;
572 int fCurrentSKP; 572 int fCurrentSKP;
573 }; 573 };
574 574
575 int nanobench_main();
576 int nanobench_main() { 575 int nanobench_main() {
577 SetupCrashHandler();
578 SkAutoGraphics ag; 576 SkAutoGraphics ag;
579 577
580 #if SK_SUPPORT_GPU 578 #if SK_SUPPORT_GPU
581 GrContext::Options grContextOpts; 579 GrContext::Options grContextOpts;
582 grContextOpts.fDrawPathToCompressedTexture = FLAGS_gpuCompressAlphaMasks; 580 grContextOpts.fDrawPathToCompressedTexture = FLAGS_gpuCompressAlphaMasks;
583 gGrFactory.reset(SkNEW_ARGS(GrContextFactory, (grContextOpts))); 581 gGrFactory.reset(SkNEW_ARGS(GrContextFactory, (grContextOpts)));
584 #endif 582 #endif
585 583
586 if (FLAGS_veryVerbose) { 584 if (FLAGS_veryVerbose) {
587 FLAGS_verbose = true; 585 FLAGS_verbose = true;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 } 743 }
746 if (FLAGS_resetGpuContext || FLAGS_abandonGpuContext) { 744 if (FLAGS_resetGpuContext || FLAGS_abandonGpuContext) {
747 gGrFactory->destroyContexts(); 745 gGrFactory->destroyContexts();
748 } 746 }
749 #endif 747 #endif
750 } 748 }
751 749
752 return 0; 750 return 0;
753 } 751 }
754 752
755 #if !defined SK_BUILD_FOR_IOS
756 int main(int argc, char** argv) {
757 SkCommandLineFlags::Parse(argc, argv);
758 return nanobench_main();
759 }
760 #endif
OLDNEW
« no previous file with comments | « bench/nanobench.h ('k') | bench/nanobench_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698