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 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 bool IsNullGLContextType(int) { return false; } | 1435 bool IsNullGLContextType(int) { return false; } |
1436 #endif | 1436 #endif |
1437 | 1437 |
1438 void RunWithGPUTestContexts(GrContextTestFn* test, GrContextTypeFilterFn* contex
tTypeFilter, | 1438 void RunWithGPUTestContexts(GrContextTestFn* test, GrContextTypeFilterFn* contex
tTypeFilter, |
1439 Reporter* reporter, GrContextFactory* factory) { | 1439 Reporter* reporter, GrContextFactory* factory) { |
1440 #if SK_SUPPORT_GPU | 1440 #if SK_SUPPORT_GPU |
1441 | 1441 |
1442 for (int typeInt = 0; typeInt < GrContextFactory::kContextTypeCnt; ++typeInt
) { | 1442 for (int typeInt = 0; typeInt < GrContextFactory::kContextTypeCnt; ++typeInt
) { |
1443 GrContextFactory::ContextType contextType = (GrContextFactory::ContextTy
pe) typeInt; | 1443 GrContextFactory::ContextType contextType = (GrContextFactory::ContextTy
pe) typeInt; |
1444 ContextInfo ctxInfo = factory->getContextInfo(contextType); | 1444 ContextInfo ctxInfo = factory->getContextInfo(contextType); |
1445 if (!(*contextTypeFilter)(contextType)) { | 1445 if (contextTypeFilter && !(*contextTypeFilter)(contextType)) { |
1446 continue; | 1446 continue; |
1447 } | 1447 } |
1448 // Use "native" instead of explicitly trying OpenGL and OpenGL ES. Do no
t use GLES on, | 1448 // Use "native" instead of explicitly trying OpenGL and OpenGL ES. Do no
t use GLES on, |
1449 // desktop since tests do not account for not fixing http://skbug.com/28
09 | 1449 // desktop since tests do not account for not fixing http://skbug.com/28
09 |
1450 if (contextType == GrContextFactory::kGL_ContextType || | 1450 if (contextType == GrContextFactory::kGL_ContextType || |
1451 contextType == GrContextFactory::kGLES_ContextType) { | 1451 contextType == GrContextFactory::kGLES_ContextType) { |
1452 if (contextType != GrContextFactory::kNativeGL_ContextType) { | 1452 if (contextType != GrContextFactory::kNativeGL_ContextType) { |
1453 continue; | 1453 continue; |
1454 } | 1454 } |
1455 } | 1455 } |
1456 if (ctxInfo.fGrContext) { | 1456 if (ctxInfo.fGrContext) { |
1457 (*test)(reporter, ctxInfo); | 1457 (*test)(reporter, ctxInfo); |
1458 } | 1458 } |
1459 ctxInfo = factory->getContextInfo(contextType, | 1459 ctxInfo = factory->getContextInfo(contextType, |
1460 GrContextFactory::kEnableNVPR_ContextO
ptions); | 1460 GrContextFactory::kEnableNVPR_ContextO
ptions); |
1461 if (ctxInfo.fGrContext) { | 1461 if (ctxInfo.fGrContext) { |
1462 (*test)(reporter, ctxInfo); | 1462 (*test)(reporter, ctxInfo); |
1463 } | 1463 } |
1464 } | 1464 } |
1465 #endif | 1465 #endif |
1466 } | 1466 } |
1467 } // namespace skiatest | 1467 } // namespace skiatest |
1468 | 1468 |
1469 #if !defined(SK_BUILD_FOR_IOS) | 1469 #if !defined(SK_BUILD_FOR_IOS) |
1470 int main(int argc, char** argv) { | 1470 int main(int argc, char** argv) { |
1471 SkCommandLineFlags::Parse(argc, argv); | 1471 SkCommandLineFlags::Parse(argc, argv); |
1472 return dm_main(); | 1472 return dm_main(); |
1473 } | 1473 } |
1474 #endif | 1474 #endif |
OLD | NEW |