commit-bot@chromium.org | 9901727 | 2013-11-08 18:45:27 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2013 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
| 8 | |
bsalomon | 4b91f76 | 2015-05-19 09:29:46 -0700 | [diff] [blame] | 9 | #include "Test.h" |
commit-bot@chromium.org | 9901727 | 2013-11-08 18:45:27 +0000 | [diff] [blame] | 10 | #if SK_SUPPORT_GPU |
| 11 | |
bsalomon | eb1cb5c | 2015-05-22 08:01:09 -0700 | [diff] [blame] | 12 | #include "GrCaps.h" |
commit-bot@chromium.org | 9901727 | 2013-11-08 18:45:27 +0000 | [diff] [blame] | 13 | #include "GrContext.h" |
| 14 | #include "GrContextFactory.h" |
tfarina@chromium.org | 8f6884a | 2014-01-24 20:56:26 +0000 | [diff] [blame] | 15 | #include "GrGpu.h" |
commit-bot@chromium.org | 9901727 | 2013-11-08 18:45:27 +0000 | [diff] [blame] | 16 | |
bsalomon | 4b91f76 | 2015-05-19 09:29:46 -0700 | [diff] [blame] | 17 | static void test_print(skiatest::Reporter*, const GrCaps* caps) { |
commit-bot@chromium.org | 9901727 | 2013-11-08 18:45:27 +0000 | [diff] [blame] | 18 | // This used to assert. |
commit-bot@chromium.org | 8b656c6 | 2013-11-21 15:23:15 +0000 | [diff] [blame] | 19 | SkString result = caps->dump(); |
| 20 | SkASSERT(!result.isEmpty()); |
cdalton | 626e1ff | 2015-06-12 13:56:46 -0700 | [diff] [blame] | 21 | SkString shaderResult = caps->shaderCaps()->dump(); |
| 22 | SkASSERT(!shaderResult.isEmpty()); |
commit-bot@chromium.org | 9901727 | 2013-11-08 18:45:27 +0000 | [diff] [blame] | 23 | } |
| 24 | |
tfarina@chromium.org | 4ee16bf | 2014-01-10 22:08:27 +0000 | [diff] [blame] | 25 | DEF_GPUTEST(GrDrawTarget, reporter, factory) { |
commit-bot@chromium.org | 9901727 | 2013-11-08 18:45:27 +0000 | [diff] [blame] | 26 | for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) { |
| 27 | GrContextFactory::GLContextType glType = static_cast<GrContextFactory::GLContextType>(type); |
| 28 | |
| 29 | GrContext* grContext = factory->get(glType); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 30 | if (nullptr == grContext) { |
commit-bot@chromium.org | 9901727 | 2013-11-08 18:45:27 +0000 | [diff] [blame] | 31 | continue; |
| 32 | } |
| 33 | |
bsalomon | 7622863 | 2015-05-29 08:02:10 -0700 | [diff] [blame] | 34 | test_print(reporter, grContext->caps()); |
commit-bot@chromium.org | 9901727 | 2013-11-08 18:45:27 +0000 | [diff] [blame] | 35 | } |
| 36 | } |
| 37 | |
commit-bot@chromium.org | 9901727 | 2013-11-08 18:45:27 +0000 | [diff] [blame] | 38 | #endif |