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 #include "SkTypes.h" | 8 #include "SkTypes.h" |
9 | 9 |
10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
11 | 11 |
12 #include "GrContextFactory.h" | 12 #include "GrContextFactory.h" |
13 #include "GrCaps.h" | 13 #include "GrCaps.h" |
14 #include "Test.h" | 14 #include "Test.h" |
15 | 15 |
16 DEF_GPUTEST(GrContextFactory_NVPRContextTypeHasPathRenderingSupport, reporter, /
*factory*/) { | 16 DEF_GPUTEST(GrContextFactory_NVPRContextOptionHasPathRenderingSupport, reporter,
/*factory*/) { |
17 // Test that if NVPR is requested, the context always has path rendering | 17 // Test that if NVPR is requested, the context always has path rendering |
18 // or the context creation fails. | 18 // or the context creation fails. |
19 GrContextFactory testFactory; | 19 GrContextFactory testFactory; |
20 GrContext* context = testFactory.get(GrContextFactory::kNVPR_GLContextType); | 20 GrContext* context = testFactory.get(GrContextFactory::kNative_GLContextType
, |
| 21 kNone_GrGLStandard, |
| 22 GrContextFactory::kEnableNVPR_GLContext
Options); |
21 if (context) { | 23 if (context) { |
22 REPORTER_ASSERT( | 24 REPORTER_ASSERT( |
23 reporter, | 25 reporter, |
24 context->caps()->shaderCaps()->pathRenderingSupport()); | 26 context->caps()->shaderCaps()->pathRenderingSupport()); |
25 } | 27 } |
26 } | 28 } |
27 | 29 |
28 DEF_GPUTEST(GrContextFactory_NoPathRenderingUnlessNVPRRequested, reporter, /*fac
tory*/) { | 30 DEF_GPUTEST(GrContextFactory_NoPathRenderingUnlessNVPRRequested, reporter, /*fac
tory*/) { |
29 // Test that if NVPR is not requested, the context never has path rendering
support. | 31 // Test that if NVPR is not requested, the context never has path rendering
support. |
30 | 32 |
31 GrContextFactory testFactory; | 33 GrContextFactory testFactory; |
32 for (int i = 0; i <= GrContextFactory::kLastGLContextType; ++i) { | 34 for (int i = 0; i <= GrContextFactory::kLastGLContextType; ++i) { |
33 GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContext
Type)i; | 35 GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContext
Type)i; |
34 if (glCtxType == GrContextFactory::kNVPR_GLContextType) { | |
35 continue; | |
36 } | |
37 GrContext* context = testFactory.get(glCtxType); | 36 GrContext* context = testFactory.get(glCtxType); |
38 if (context) { | 37 if (context) { |
39 REPORTER_ASSERT( | 38 REPORTER_ASSERT( |
40 reporter, | 39 reporter, |
41 !context->caps()->shaderCaps()->pathRenderingSupport()); | 40 !context->caps()->shaderCaps()->pathRenderingSupport()); |
42 } | 41 } |
43 } | 42 } |
44 } | 43 } |
45 | 44 |
46 #endif | 45 #endif |
OLD | NEW |