diff options
author | Chris Dalton <csmartdalton@google.com> | 2017-10-05 18:58:21 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-05 18:58:35 +0000 |
commit | 38ace8a1339e7dbc7126887037af11a6d34f6887 (patch) | |
tree | 15f74fdd5cc1b71aa7a61ce89c35f3eb5a5b6818 /dm/DM.cpp | |
parent | ac279d736bb2b44bc00db646b9f88ddd50c39743 (diff) |
Revert "Attempt both GL and GLES for GPU unit tests"
This reverts commit 454818b80ae57edfa410f884de3ed31db1e7ea9c.
Reason for revert: the GPU unit tests on Chromebook that this change enabled are not surprisingly broken.
Original change's description:
> Attempt both GL and GLES for GPU unit tests
>
> The hardcoded logic was not all inclusive and caused Chromebooks to
> not run GPU unit tests.
>
> Bug: skia:
> Change-Id: I7688adab314d12234ee03363609a1c4bf8f2edb5
> Reviewed-on: https://skia-review.googlesource.com/55561
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=bsalomon@google.com,brianosman@google.com,csmartdalton@google.com
Change-Id: I48a6fdf0b21d3f3a795d9cf20564208f7c35ff5b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/55960
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'dm/DM.cpp')
-rw-r--r-- | dm/DM.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -1466,37 +1466,38 @@ bool IsNullGLContextType(int) { return false; } void RunWithGPUTestContexts(GrContextTestFn* test, GrContextTypeFilterFn* contextTypeFilter, Reporter* reporter, GrContextFactory* factory) { #if SK_SUPPORT_GPU - // Make sure we try OpenGL before OpenGL ES. GLES tests on desktop do not account for not fixing - // http://skbug.com/2809 - GR_STATIC_ASSERT(GrContextFactory::kGL_ContextType < GrContextFactory::kGLES_ContextType); - bool didTestGL = false; + +#if defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_WIN) || defined(SK_BUILD_FOR_MAC) + static constexpr auto kNativeGLType = GrContextFactory::kGL_ContextType; +#else + static constexpr auto kNativeGLType = GrContextFactory::kGLES_ContextType; +#endif for (int typeInt = 0; typeInt < GrContextFactory::kContextTypeCnt; ++typeInt) { GrContextFactory::ContextType contextType = (GrContextFactory::ContextType) typeInt; + // Use "native" instead of explicitly trying OpenGL and OpenGL ES. Do not use GLES on + // desktop since tests do not account for not fixing http://skbug.com/2809 + if (contextType == GrContextFactory::kGL_ContextType || + contextType == GrContextFactory::kGLES_ContextType) { + if (contextType != kNativeGLType) { + continue; + } + } ContextInfo ctxInfo = factory->getContextInfo(contextType, GrContextFactory::ContextOverrides::kDisableNVPR); if (contextTypeFilter && !(*contextTypeFilter)(contextType)) { continue; } - bool isGL = contextType == GrContextFactory::kGL_ContextType || - contextType == GrContextFactory::kGLES_ContextType; - if (isGL && didTestGL) { - continue; - } ReporterContext ctx(reporter, SkString(GrContextFactory::ContextTypeName(contextType))); if (ctxInfo.grContext()) { (*test)(reporter, ctxInfo); ctxInfo.grContext()->flush(); - if (isGL) { - didTestGL = true; - } } ctxInfo = factory->getContextInfo(contextType, GrContextFactory::ContextOverrides::kRequireNVPRSupport); if (ctxInfo.grContext()) { (*test)(reporter, ctxInfo); ctxInfo.grContext()->flush(); - SkASSERT(!isGL || didTestGL); // Null context also has nvpr. } } #endif |