| 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 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "VisualLightweightBenchModule.h" | 21 #include "VisualLightweightBenchModule.h" |
| 22 #include "VisualInteractiveModule.h" | 22 #include "VisualInteractiveModule.h" |
| 23 #include "gl/GrGLInterface.h" | 23 #include "gl/GrGLInterface.h" |
| 24 | 24 |
| 25 DEFINE_bool2(fullscreen, f, true, "Run fullscreen."); | 25 DEFINE_bool2(fullscreen, f, true, "Run fullscreen."); |
| 26 DEFINE_bool2(interactive, n, false, "Run in interactive mode."); | 26 DEFINE_bool2(interactive, n, false, "Run in interactive mode."); |
| 27 DEFINE_bool2(dif, d, false, "Use device-independent fonts."); | 27 DEFINE_bool2(dif, d, false, "Use device-independent fonts."); |
| 28 | 28 |
| 29 VisualBench::VisualBench(void* hwnd, int argc, char** argv) | 29 VisualBench::VisualBench(void* hwnd, int argc, char** argv) |
| 30 : INHERITED(hwnd) { | 30 : INHERITED(hwnd) { |
| 31 SkCommandLineFlags::Parse(argc, argv); | |
| 32 | |
| 33 SkDebugf("Command line arguments:"); | 31 SkDebugf("Command line arguments:"); |
| 34 for (int i = 0; i < argc; ++i) { | 32 for (int i = 0; i < argc; ++i) { |
| 35 SkDebugf("%s\n", argv[i]); | 33 SkDebugf("%s\n", argv[i]); |
| 36 } | 34 } |
| 37 | 35 |
| 36 SkCommandLineFlags::Parse(argc, argv); |
| 37 |
| 38 // these have to happen after commandline parsing | 38 // these have to happen after commandline parsing |
| 39 if (FLAGS_dif) { | 39 if (FLAGS_dif) { |
| 40 const SkSurfaceProps& props(INHERITED::getSurfaceProps()); | 40 const SkSurfaceProps& props(INHERITED::getSurfaceProps()); |
| 41 uint32_t flags = SkSurfaceProps::kUseDeviceIndependentFonts_Flag | props
.flags(); | 41 uint32_t flags = SkSurfaceProps::kUseDeviceIndependentFonts_Flag | props
.flags(); |
| 42 INHERITED::setSurfaceProps(SkSurfaceProps(flags, props.pixelGeometry()))
; | 42 INHERITED::setSurfaceProps(SkSurfaceProps(flags, props.pixelGeometry()))
; |
| 43 } | 43 } |
| 44 fModule.reset(new VisualLightweightBenchModule(this)); | 44 fModule.reset(new VisualLightweightBenchModule(this)); |
| 45 if (FLAGS_interactive) { | 45 if (FLAGS_interactive) { |
| 46 fModule.reset(new VisualInteractiveModule(this)); | 46 fModule.reset(new VisualInteractiveModule(this)); |
| 47 } | 47 } |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 } | 170 } |
| 171 | 171 |
| 172 void application_term() { | 172 void application_term() { |
| 173 SkEvent::Term(); | 173 SkEvent::Term(); |
| 174 } | 174 } |
| 175 | 175 |
| 176 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { | 176 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { |
| 177 return new VisualBench(hwnd, argc, argv); | 177 return new VisualBench(hwnd, argc, argv); |
| 178 } | 178 } |
| 179 | 179 |
| OLD | NEW |