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 "GrContext.h" | 11 #include "GrContext.h" |
12 #include "ProcStats.h" | 12 #include "ProcStats.h" |
13 #include "SkApplication.h" | 13 #include "SkApplication.h" |
14 #include "SkCanvas.h" | 14 #include "SkCanvas.h" |
15 #include "SkCommandLineFlags.h" | 15 #include "SkCommandLineFlags.h" |
16 #include "SkGraphics.h" | 16 #include "SkGraphics.h" |
17 #include "SkGr.h" | 17 #include "SkGr.h" |
18 #include "SkOSFile.h" | 18 #include "SkOSFile.h" |
19 #include "SkStream.h" | 19 #include "SkStream.h" |
20 #include "Stats.h" | 20 #include "Stats.h" |
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 | 28 |
28 VisualBench::VisualBench(void* hwnd, int argc, char** argv) | 29 VisualBench::VisualBench(void* hwnd, int argc, char** argv) |
29 : INHERITED(hwnd) { | 30 : INHERITED(hwnd) { |
30 SkCommandLineFlags::Parse(argc, argv); | 31 SkCommandLineFlags::Parse(argc, argv); |
31 | 32 |
32 // this has to happen after commandline parsing | 33 // these have to happen after commandline parsing |
| 34 if (FLAGS_dif) { |
| 35 const SkSurfaceProps& props(INHERITED::getSurfaceProps()); |
| 36 uint32_t flags = SkSurfaceProps::kUseDeviceIndependentFonts_Flag | props
.flags(); |
| 37 INHERITED::setSurfaceProps(SkSurfaceProps(flags, props.pixelGeometry()))
; |
| 38 } |
33 fModule.reset(new VisualLightweightBenchModule(this)); | 39 fModule.reset(new VisualLightweightBenchModule(this)); |
34 if (FLAGS_interactive) { | 40 if (FLAGS_interactive) { |
35 fModule.reset(new VisualInteractiveModule(this)); | 41 fModule.reset(new VisualInteractiveModule(this)); |
36 } | 42 } |
37 | 43 |
38 this->setTitle(); | 44 this->setTitle(); |
39 this->setupBackend(); | 45 this->setupBackend(); |
40 } | 46 } |
41 | 47 |
42 VisualBench::~VisualBench() { | 48 VisualBench::~VisualBench() { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 165 } |
160 | 166 |
161 void application_term() { | 167 void application_term() { |
162 SkEvent::Term(); | 168 SkEvent::Term(); |
163 } | 169 } |
164 | 170 |
165 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { | 171 SkOSWindow* create_sk_window(void* hwnd, int argc, char** argv) { |
166 return new VisualBench(hwnd, argc, argv); | 172 return new VisualBench(hwnd, argc, argv); |
167 } | 173 } |
168 | 174 |
OLD | NEW |