| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "Test.h" | 9 #include "Test.h" |
| 10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
| 11 | 11 |
| 12 #include "GrCaps.h" | 12 #include "GrCaps.h" |
| 13 #include "GrContext.h" | 13 #include "GrContext.h" |
| 14 #include "GrContextFactory.h" | |
| 15 #include "GrGpu.h" | 14 #include "GrGpu.h" |
| 16 | 15 |
| 17 static void test_print(skiatest::Reporter*, const GrCaps* caps) { | 16 DEF_GPUTEST_FOR_ALL_CONTEXTS(GrDrawTargetPrint, reporter, context) { |
| 18 // This used to assert. | 17 // This used to assert. |
| 19 SkString result = caps->dump(); | 18 SkString result = context->caps()->dump(); |
| 20 SkASSERT(!result.isEmpty()); | 19 SkASSERT(!result.isEmpty()); |
| 21 SkString shaderResult = caps->shaderCaps()->dump(); | 20 SkString shaderResult = context->caps()->shaderCaps()->dump(); |
| 22 SkASSERT(!shaderResult.isEmpty()); | 21 SkASSERT(!shaderResult.isEmpty()); |
| 23 } | 22 } |
| 24 | 23 |
| 25 DEF_GPUTEST(GrDrawTarget, reporter, factory) { | |
| 26 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) { | |
| 27 GrContextFactory::GLContextType glType = static_cast<GrContextFactory::G
LContextType>(type); | |
| 28 | |
| 29 GrContext* grContext = factory->get(glType); | |
| 30 if (nullptr == grContext) { | |
| 31 continue; | |
| 32 } | |
| 33 | |
| 34 test_print(reporter, grContext->caps()); | |
| 35 } | |
| 36 } | |
| 37 | |
| 38 #endif | 24 #endif |
| OLD | NEW |