| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 | 8 |
| 9 #include "VisualBench.h" | 9 #include "VisualBench.h" |
| 10 | 10 |
| 11 #include "ProcStats.h" | 11 #include "ProcStats.h" |
| 12 #include "SkApplication.h" | 12 #include "SkApplication.h" |
| 13 #include "SkCanvas.h" | 13 #include "SkCanvas.h" |
| 14 #include "SkCommandLineFlags.h" | 14 #include "SkCommandLineFlags.h" |
| 15 #include "SkGraphics.h" | 15 #include "SkGraphics.h" |
| 16 #include "SkGr.h" | 16 #include "SkGr.h" |
| 17 #include "SkOSFile.h" | 17 #include "SkOSFile.h" |
| 18 #include "SkStream.h" | 18 #include "SkStream.h" |
| 19 #include "Stats.h" | 19 #include "Stats.h" |
| 20 #include "VisualLightweightBenchModule.h" | 20 #include "VisualLightweightBenchModule.h" |
| 21 #include "VisualInteractiveModule.h" | 21 #include "VisualInteractiveModule.h" |
| 22 #include "gl/GrGLInterface.h" | 22 #include "gl/GrGLInterface.h" |
| 23 | 23 |
| 24 DEFINE_bool2(fullscreen, f, true, "Run fullscreen."); | 24 DEFINE_bool2(fullscreen, f, true, "Run fullscreen."); |
| 25 DEFINE_bool2(interactive, n, false, "Run in interactive mode."); | 25 DEFINE_bool2(interactive, n, false, "Run in interactive mode."); |
| 26 | 26 |
| 27 VisualBench::VisualBench(void* hwnd, int argc, char** argv) | 27 VisualBench::VisualBench(void* hwnd, int argc, char** argv) |
| 28 : INHERITED(hwnd) | 28 : INHERITED(hwnd) { |
| 29 , fModule(new VisualLightweightBenchModule(this)) { | |
| 30 SkCommandLineFlags::Parse(argc, argv); | 29 SkCommandLineFlags::Parse(argc, argv); |
| 31 | 30 |
| 31 // this has to happen after commandline parsing |
| 32 fModule.reset(new VisualLightweightBenchModule(this)); |
| 32 if (FLAGS_interactive) { | 33 if (FLAGS_interactive) { |
| 33 fModule.reset(new VisualInteractiveModule(this)); | 34 fModule.reset(new VisualInteractiveModule(this)); |
| 34 } | 35 } |
| 35 | 36 |
| 36 this->setTitle(); | 37 this->setTitle(); |
| 37 this->setupBackend(); | 38 this->setupBackend(); |
| 38 } | 39 } |
| 39 | 40 |
| 40 VisualBench::~VisualBench() { | 41 VisualBench::~VisualBench() { |
| 41 INHERITED::detach(); | 42 INHERITED::detach(); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 } | 135 } |
| 135 | 136 |
| 136 void application_term() { | 137 void application_term() { |
| 137 SkEvent::Term(); | 138 SkEvent::Term(); |
| 138 } | 139 } |
| 139 | 140 |
| 140 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { | 141 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { |
| 141 return new VisualBench(hwnd, argc, argv); | 142 return new VisualBench(hwnd, argc, argv); |
| 142 } | 143 } |
| 143 | 144 |
| OLD | NEW |