OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "CrashHandler.h" | 8 #include "CrashHandler.h" |
9 #include "DMJsonWriter.h" | 9 #include "DMJsonWriter.h" |
10 #include "DMSrcSink.h" | 10 #include "DMSrcSink.h" |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 #define SINK(t, sink, ...) if (0 == strcmp(t, tag)) { return new sink(__VA_ARGS_
_); } | 602 #define SINK(t, sink, ...) if (0 == strcmp(t, tag)) { return new sink(__VA_ARGS_
_); } |
603 if (gpu_supported()) { | 603 if (gpu_supported()) { |
604 typedef GrContextFactory Gr; | 604 typedef GrContextFactory Gr; |
605 const GrGLStandard api = get_gpu_api(); | 605 const GrGLStandard api = get_gpu_api(); |
606 SINK("gpunull", GPUSink, Gr::kNull_GLContextType, api, 0
, false, FLAGS_gpu_threading); | 606 SINK("gpunull", GPUSink, Gr::kNull_GLContextType, api, 0
, false, FLAGS_gpu_threading); |
607 SINK("gpudebug", GPUSink, Gr::kDebug_GLContextType, api, 0
, false, FLAGS_gpu_threading); | 607 SINK("gpudebug", GPUSink, Gr::kDebug_GLContextType, api, 0
, false, FLAGS_gpu_threading); |
608 SINK("gpu", GPUSink, Gr::kNative_GLContextType, api, 0
, false, FLAGS_gpu_threading); | 608 SINK("gpu", GPUSink, Gr::kNative_GLContextType, api, 0
, false, FLAGS_gpu_threading); |
609 SINK("gpudft", GPUSink, Gr::kNative_GLContextType, api, 0
, true, FLAGS_gpu_threading); | 609 SINK("gpudft", GPUSink, Gr::kNative_GLContextType, api, 0
, true, FLAGS_gpu_threading); |
610 SINK("msaa4", GPUSink, Gr::kNative_GLContextType, api, 4
, false, FLAGS_gpu_threading); | 610 SINK("msaa4", GPUSink, Gr::kNative_GLContextType, api, 4
, false, FLAGS_gpu_threading); |
611 SINK("msaa16", GPUSink, Gr::kNative_GLContextType, api, 16
, false, FLAGS_gpu_threading); | 611 SINK("msaa16", GPUSink, Gr::kNative_GLContextType, api, 16
, false, FLAGS_gpu_threading); |
612 SINK("nvprmsaa4", GPUSink, Gr::kNative_GLContextType, Gr::kEnableNVP
R_GLContextOptions, api, 4, true, FLAGS_gpu_threading); | 612 SINK("nvprmsaa4", GPUSink, Gr::kNVPR_GLContextType, api, 4
, true, FLAGS_gpu_threading); |
613 SINK("nvprmsaa16", GPUSink, Gr::kNative_GLContextType, Gr::kEnableNVP
R_GLContextOptions, api, 16, true, FLAGS_gpu_threading); | 613 SINK("nvprmsaa16", GPUSink, Gr::kNVPR_GLContextType, api, 16
, true, FLAGS_gpu_threading); |
614 #if SK_ANGLE | 614 #if SK_ANGLE |
615 SINK("angle", GPUSink, Gr::kANGLE_GLContextType, api, 0
, false, FLAGS_gpu_threading); | 615 SINK("angle", GPUSink, Gr::kANGLE_GLContextType, api, 0
, false, FLAGS_gpu_threading); |
616 SINK("angle-gl", GPUSink, Gr::kANGLE_GL_GLContextType, api, 0
, false, FLAGS_gpu_threading); | 616 SINK("angle-gl", GPUSink, Gr::kANGLE_GL_GLContextType, api, 0
, false, FLAGS_gpu_threading); |
617 #endif | 617 #endif |
618 #if SK_COMMAND_BUFFER | 618 #if SK_COMMAND_BUFFER |
619 SINK("commandbuffer", GPUSink, Gr::kCommandBuffer_GLContextType, api, 0
, false, FLAGS_gpu_threading); | 619 SINK("commandbuffer", GPUSink, Gr::kCommandBuffer_GLContextType, api, 0
, false, FLAGS_gpu_threading); |
620 #endif | 620 #endif |
621 #if SK_MESA | 621 #if SK_MESA |
622 SINK("mesa", GPUSink, Gr::kMESA_GLContextType, api, 0
, false, FLAGS_gpu_threading); | 622 SINK("mesa", GPUSink, Gr::kMESA_GLContextType, api, 0
, false, FLAGS_gpu_threading); |
623 #endif | 623 #endif |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 test(reporter, context->fGrContext, context->fGLContext); | 1164 test(reporter, context->fGrContext, context->fGLContext); |
1165 } | 1165 } |
1166 #endif | 1166 #endif |
1167 } // namespace | 1167 } // namespace |
1168 | 1168 |
1169 | 1169 |
1170 template<typename T> | 1170 template<typename T> |
1171 void RunWithGPUTestContexts(T test, GPUTestContexts testContexts, Reporter* repo
rter, | 1171 void RunWithGPUTestContexts(T test, GPUTestContexts testContexts, Reporter* repo
rter, |
1172 GrContextFactory* factory) { | 1172 GrContextFactory* factory) { |
1173 #if SK_SUPPORT_GPU | 1173 #if SK_SUPPORT_GPU |
1174 const GrGLStandard api = get_gpu_api(); | |
1175 for (int i = 0; i < GrContextFactory::kGLContextTypeCnt; ++i) { | 1174 for (int i = 0; i < GrContextFactory::kGLContextTypeCnt; ++i) { |
1176 GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContext
Type) i; | 1175 GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContext
Type) i; |
1177 int contextSelector = kNone_GPUTestContexts; | 1176 int contextSelector = kNone_GPUTestContexts; |
1178 if (GrContextFactory::IsRenderingGLContext(glCtxType)) { | 1177 if (GrContextFactory::IsRenderingGLContext(glCtxType)) { |
1179 contextSelector |= kAllRendering_GPUTestContexts; | 1178 contextSelector |= kAllRendering_GPUTestContexts; |
1180 } | 1179 } |
1181 if (glCtxType == GrContextFactory::kNative_GLContextType) { | 1180 if (glCtxType == GrContextFactory::kNative_GLContextType) { |
1182 contextSelector |= kNative_GPUTestContexts; | 1181 contextSelector |= kNative_GPUTestContexts; |
1183 } | 1182 } |
1184 if (glCtxType == GrContextFactory::kNull_GLContextType) { | 1183 if (glCtxType == GrContextFactory::kNull_GLContextType) { |
1185 contextSelector |= kNull_GPUTestContexts; | 1184 contextSelector |= kNull_GPUTestContexts; |
1186 } | 1185 } |
1187 if ((testContexts & contextSelector) == 0) { | 1186 if ((testContexts & contextSelector) == 0) { |
1188 continue; | 1187 continue; |
1189 } | 1188 } |
1190 if (GrContextFactory::ContextInfo* context = factory->getContextInfo(glC
txType, api)) { | 1189 if (GrContextFactory::ContextInfo* context = factory->getContextInfo(glC
txType)) { |
1191 call_test(test, reporter, context); | |
1192 } | |
1193 if (GrContextFactory::ContextInfo* context = | |
1194 factory->getContextInfo(glCtxType, api, | |
1195 GrContextFactory::kEnableNVPR_GLContextOptio
ns)) { | |
1196 call_test(test, reporter, context); | 1190 call_test(test, reporter, context); |
1197 } | 1191 } |
1198 } | 1192 } |
1199 #endif | 1193 #endif |
1200 } | 1194 } |
1201 | 1195 |
1202 template | 1196 template |
1203 void RunWithGPUTestContexts<TestWithGrContext>(TestWithGrContext test, | 1197 void RunWithGPUTestContexts<TestWithGrContext>(TestWithGrContext test, |
1204 GPUTestContexts testContexts, | 1198 GPUTestContexts testContexts, |
1205 Reporter* reporter, | 1199 Reporter* reporter, |
1206 GrContextFactory* factory); | 1200 GrContextFactory* factory); |
1207 template | 1201 template |
1208 void RunWithGPUTestContexts<TestWithGrContextAndGLContext>(TestWithGrContextAndG
LContext test, | 1202 void RunWithGPUTestContexts<TestWithGrContextAndGLContext>(TestWithGrContextAndG
LContext test, |
1209 GPUTestContexts testC
ontexts, | 1203 GPUTestContexts testC
ontexts, |
1210 Reporter* reporter, | 1204 Reporter* reporter, |
1211 GrContextFactory* fac
tory); | 1205 GrContextFactory* fac
tory); |
1212 } // namespace skiatest | 1206 } // namespace skiatest |
1213 | 1207 |
1214 #if !defined(SK_BUILD_FOR_IOS) | 1208 #if !defined(SK_BUILD_FOR_IOS) |
1215 int main(int argc, char** argv) { | 1209 int main(int argc, char** argv) { |
1216 SkCommandLineFlags::Parse(argc, argv); | 1210 SkCommandLineFlags::Parse(argc, argv); |
1217 return dm_main(); | 1211 return dm_main(); |
1218 } | 1212 } |
1219 #endif | 1213 #endif |
OLD | NEW |