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 #if SK_SUPPORT_GPU | 9 #if SK_SUPPORT_GPU |
10 | 10 |
11 #include "GrContext.h" | 11 #include "GrContext.h" |
12 #include "GrContextFactory.h" | 12 #include "GrContextFactory.h" |
13 #include "GrGpu.h" | 13 #include "GrGpu.h" |
14 #include "GrDrawTargetCaps.h" | 14 #include "GrDrawTargetCaps.h" |
15 #include "Test.h" | 15 #include "Test.h" |
16 #include "TestClassDef.h" | |
17 | 16 |
18 static void test_print(skiatest::Reporter*, const GrDrawTargetCaps* caps) { | 17 static void test_print(skiatest::Reporter*, const GrDrawTargetCaps* caps) { |
19 // This used to assert. | 18 // This used to assert. |
20 SkString result = caps->dump(); | 19 SkString result = caps->dump(); |
21 SkASSERT(!result.isEmpty()); | 20 SkASSERT(!result.isEmpty()); |
22 } | 21 } |
23 | 22 |
24 DEF_GPUTEST(GrDrawTarget, reporter, factory) { | 23 DEF_GPUTEST(GrDrawTarget, reporter, factory) { |
25 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) { | 24 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) { |
26 GrContextFactory::GLContextType glType = static_cast<GrContextFactory::G
LContextType>(type); | 25 GrContextFactory::GLContextType glType = static_cast<GrContextFactory::G
LContextType>(type); |
27 | 26 |
28 GrContext* grContext = factory->get(glType); | 27 GrContext* grContext = factory->get(glType); |
29 if (NULL == grContext) { | 28 if (NULL == grContext) { |
30 continue; | 29 continue; |
31 } | 30 } |
32 | 31 |
33 test_print(reporter, grContext->getGpu()->caps()); | 32 test_print(reporter, grContext->getGpu()->caps()); |
34 } | 33 } |
35 } | 34 } |
36 | 35 |
37 #endif | 36 #endif |
OLD | NEW |