OLD | NEW |
1 // Main binary for DM. | 1 // Main binary for DM. |
2 // For a high-level overview, please see dm/README. | 2 // For a high-level overview, please see dm/README. |
3 | 3 |
4 #include "CrashHandler.h" | 4 #include "CrashHandler.h" |
5 #include "LazyDecodeBitmap.h" | 5 #include "LazyDecodeBitmap.h" |
6 #include "SkCommonFlags.h" | 6 #include "SkCommonFlags.h" |
7 #include "SkForceLinking.h" | 7 #include "SkForceLinking.h" |
8 #include "SkGraphics.h" | 8 #include "SkGraphics.h" |
9 #include "SkPicture.h" | 9 #include "SkPicture.h" |
10 #include "SkString.h" | 10 #include "SkString.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // "FooBar" -> "foobar". Obviously, ASCII only. | 57 // "FooBar" -> "foobar". Obviously, ASCII only. |
58 static SkString lowercase(SkString s) { | 58 static SkString lowercase(SkString s) { |
59 for (size_t i = 0; i < s.size(); i++) { | 59 for (size_t i = 0; i < s.size(); i++) { |
60 s[i] = tolower(s[i]); | 60 s[i] = tolower(s[i]); |
61 } | 61 } |
62 return s; | 62 return s; |
63 } | 63 } |
64 | 64 |
65 static const GrContextFactory::GLContextType native = GrContextFactory::kNative_
GLContextType; | 65 static const GrContextFactory::GLContextType native = GrContextFactory::kNative_
GLContextType; |
66 static const GrContextFactory::GLContextType nvpr = GrContextFactory::kNVPR_GLCo
ntextType; | 66 static const GrContextFactory::GLContextType nvpr = GrContextFactory::kNVPR_GL
ContextType; |
67 static const GrContextFactory::GLContextType null = GrContextFactory::kNull_GL
ContextType; | 67 static const GrContextFactory::GLContextType null = GrContextFactory::kNull_GL
ContextType; |
68 static const GrContextFactory::GLContextType debug = GrContextFactory::kDebug_G
LContextType; | 68 static const GrContextFactory::GLContextType debug = GrContextFactory::kDebug_G
LContextType; |
69 static const GrContextFactory::GLContextType angle = | |
70 #if SK_ANGLE | 69 #if SK_ANGLE |
71 GrContextFactory::kANGLE_GLContextType; | 70 static const GrContextFactory::GLContextType angle = GrContextFactory::kANGLE_G
LContextType; |
72 #else | |
73 native; | |
74 #endif | 71 #endif |
75 static const GrContextFactory::GLContextType mesa = | |
76 #if SK_MESA | 72 #if SK_MESA |
77 GrContextFactory::kMESA_GLContextType; | 73 static const GrContextFactory::GLContextType mesa = GrContextFactory::kMESA_GL
ContextType; |
78 #else | |
79 native; | |
80 #endif | 74 #endif |
81 | 75 |
82 static void kick_off_gms(const SkTDArray<GMRegistry::Factory>& gms, | 76 static void kick_off_gms(const SkTDArray<GMRegistry::Factory>& gms, |
83 const SkTArray<SkString>& configs, | 77 const SkTArray<SkString>& configs, |
84 GrGLStandard gpuAPI, | 78 GrGLStandard gpuAPI, |
85 const DM::Expectations& expectations, | 79 const DM::Expectations& expectations, |
86 DM::Reporter* reporter, | 80 DM::Reporter* reporter, |
87 DM::TaskRunner* tasks) { | 81 DM::TaskRunner* tasks) { |
88 #define START(name, type, ...)
\ | 82 #define START(name, type, ...)
\ |
89 if (lowercase(configs[j]).equals(name)) {
\ | 83 if (lowercase(configs[j]).equals(name)) {
\ |
90 tasks->add(SkNEW_ARGS(DM::type, (name, reporter, tasks, gms[i], ## __VA_
ARGS__))); \ | 84 tasks->add(SkNEW_ARGS(DM::type, (name, reporter, tasks, gms[i], ## __VA_
ARGS__))); \ |
91 } | 85 } |
92 for (int i = 0; i < gms.count(); i++) { | 86 for (int i = 0; i < gms.count(); i++) { |
93 for (int j = 0; j < configs.count(); j++) { | 87 for (int j = 0; j < configs.count(); j++) { |
94 | 88 |
95 START("565", CpuGMTask, expectations, kRGB_565_SkColorType); | 89 START("565", CpuGMTask, expectations, kRGB_565_SkColorType); |
96 START("8888", CpuGMTask, expectations, kN32_SkColorType); | 90 START("8888", CpuGMTask, expectations, kN32_SkColorType); |
97 START("gpu", GpuGMTask, expectations, native, gpuAPI, 0); | 91 START("gpu", GpuGMTask, expectations, native, gpuAPI, 0); |
98 START("msaa4", GpuGMTask, expectations, native, gpuAPI, 4); | 92 START("msaa4", GpuGMTask, expectations, native, gpuAPI, 4); |
99 START("msaa16", GpuGMTask, expectations, native, gpuAPI, 16); | 93 START("msaa16", GpuGMTask, expectations, native, gpuAPI, 16); |
100 START("nvprmsaa4", GpuGMTask, expectations, nvpr, gpuAPI, 4); | 94 START("nvprmsaa4", GpuGMTask, expectations, nvpr, gpuAPI, 4); |
101 START("nvprmsaa16", GpuGMTask, expectations, nvpr, gpuAPI, 16); | 95 START("nvprmsaa16", GpuGMTask, expectations, nvpr, gpuAPI, 16); |
102 START("gpunull", GpuGMTask, expectations, null, gpuAPI, 0); | 96 START("gpunull", GpuGMTask, expectations, null, gpuAPI, 0); |
103 START("gpudebug", GpuGMTask, expectations, debug, gpuAPI, 0); | 97 START("gpudebug", GpuGMTask, expectations, debug, gpuAPI, 0); |
| 98 #if SK_ANGLE |
104 START("angle", GpuGMTask, expectations, angle, gpuAPI, 0); | 99 START("angle", GpuGMTask, expectations, angle, gpuAPI, 0); |
| 100 #endif |
| 101 #if SK_MESA |
105 START("mesa", GpuGMTask, expectations, mesa, gpuAPI, 0); | 102 START("mesa", GpuGMTask, expectations, mesa, gpuAPI, 0); |
| 103 #endif |
106 START("pdf", PDFTask, RASTERIZE_PDF_PROC); | 104 START("pdf", PDFTask, RASTERIZE_PDF_PROC); |
107 } | 105 } |
108 } | 106 } |
109 #undef START | 107 #undef START |
110 } | 108 } |
111 | 109 |
112 static void kick_off_tests(const SkTDArray<TestRegistry::Factory>& tests, | 110 static void kick_off_tests(const SkTDArray<TestRegistry::Factory>& tests, |
113 DM::Reporter* reporter, | 111 DM::Reporter* reporter, |
114 DM::TaskRunner* tasks) { | 112 DM::TaskRunner* tasks) { |
115 for (int i = 0; i < tests.count(); i++) { | 113 for (int i = 0; i < tests.count(); i++) { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 report_failures(failures); | 251 report_failures(failures); |
254 return failures.count() > 0; | 252 return failures.count() > 0; |
255 } | 253 } |
256 | 254 |
257 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 255 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
258 int main(int argc, char** argv) { | 256 int main(int argc, char** argv) { |
259 SkCommandLineFlags::Parse(argc, argv); | 257 SkCommandLineFlags::Parse(argc, argv); |
260 return dm_main(); | 258 return dm_main(); |
261 } | 259 } |
262 #endif | 260 #endif |
OLD | NEW |