OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 // This is a GPU-backend specific test. It relies on static intializers to work | 8 // This is a GPU-backend specific test. It relies on static intializers to work |
9 | 9 |
10 #include "SkTypes.h" | 10 #include "SkTypes.h" |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 // Some long shaders run out of temporary registers in the D3D compiler on A
NGLE and | 439 // Some long shaders run out of temporary registers in the D3D compiler on A
NGLE and |
440 // command buffer. | 440 // command buffer. |
441 maxStages = SkTMin(maxStages, 2); | 441 maxStages = SkTMin(maxStages, 2); |
442 #endif | 442 #endif |
443 if (maxStages == 0) { | 443 if (maxStages == 0) { |
444 return; | 444 return; |
445 } | 445 } |
446 REPORTER_ASSERT(reporter, GrDrawingManager::ProgramUnitTest(ctxInfo.fGrConte
xt, maxStages)); | 446 REPORTER_ASSERT(reporter, GrDrawingManager::ProgramUnitTest(ctxInfo.fGrConte
xt, maxStages)); |
447 } | 447 } |
448 | 448 |
| 449 static bool is_native_gl_context_type(sk_gpu_test::GrContextFactory::ContextType
type) { |
| 450 return type == sk_gpu_test::GrContextFactory::kNativeGL_ContextType; |
| 451 } |
| 452 |
| 453 static bool is_other_rendering_gl_context_type(sk_gpu_test::GrContextFactory::Co
ntextType type) { |
| 454 return !is_native_gl_context_type(type) && |
| 455 kOpenGL_GrBackend == sk_gpu_test::GrContextFactory::ContextTypeBacken
d(type) && |
| 456 sk_gpu_test::GrContextFactory::IsRenderingContext(type); |
| 457 } |
| 458 |
449 DEF_GPUTEST(GLPrograms, reporter, /*factory*/) { | 459 DEF_GPUTEST(GLPrograms, reporter, /*factory*/) { |
450 // Set a locale that would cause shader compilation to fail because of , as
decimal separator. | 460 // Set a locale that would cause shader compilation to fail because of , as
decimal separator. |
451 // skbug 3330 | 461 // skbug 3330 |
452 #ifdef SK_BUILD_FOR_WIN | 462 #ifdef SK_BUILD_FOR_WIN |
453 GrAutoLocaleSetter als("sv-SE"); | 463 GrAutoLocaleSetter als("sv-SE"); |
454 #else | 464 #else |
455 GrAutoLocaleSetter als("sv_SE.UTF-8"); | 465 GrAutoLocaleSetter als("sv_SE.UTF-8"); |
456 #endif | 466 #endif |
457 | 467 |
458 // We suppress prints to avoid spew | 468 // We suppress prints to avoid spew |
459 GrContextOptions opts; | 469 GrContextOptions opts; |
460 opts.fSuppressPrints = true; | 470 opts.fSuppressPrints = true; |
461 sk_gpu_test::GrContextFactory debugFactory(opts); | 471 sk_gpu_test::GrContextFactory debugFactory(opts); |
462 skiatest::RunWithGPUTestContexts(test_glprograms_native, skiatest::kNative_G
PUTestContexts, | 472 skiatest::RunWithGPUTestContexts(test_glprograms_native, &is_native_gl_conte
xt_type, |
463 reporter, &debugFactory); | 473 reporter, &debugFactory); |
464 skiatest::RunWithGPUTestContexts(test_glprograms_other_contexts, | 474 skiatest::RunWithGPUTestContexts(test_glprograms_other_contexts, |
465 skiatest::kOther_GPUTestContexts, reporter,
&debugFactory); | 475 &is_other_rendering_gl_context_type, report
er, &debugFactory); |
466 } | 476 } |
467 | 477 |
468 #endif | 478 #endif |
OLD | NEW |