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 using sk_gpu_test::GrContextFactory; |
| 17 |
16 DEF_GPUTEST(GrContextFactory_NVPRContextOptionHasPathRenderingSupport, reporter,
/*factory*/) { | 18 DEF_GPUTEST(GrContextFactory_NVPRContextOptionHasPathRenderingSupport, reporter,
/*factory*/) { |
17 // Test that if NVPR is requested, the context always has path rendering | 19 // Test that if NVPR is requested, the context always has path rendering |
18 // or the context creation fails. | 20 // or the context creation fails. |
19 GrContextFactory testFactory; | 21 GrContextFactory testFactory; |
20 // Test that if NVPR is possible, caps are in sync. | 22 // Test that if NVPR is possible, caps are in sync. |
21 for (int i = 0; i < GrContextFactory::kGLContextTypeCnt; ++i) { | 23 for (int i = 0; i < GrContextFactory::kGLContextTypeCnt; ++i) { |
22 GrContextFactory::GLContextType glCtxType = static_cast<GrContextFactory
::GLContextType>(i); | 24 GrContextFactory::GLContextType glCtxType = static_cast<GrContextFactory
::GLContextType>(i); |
23 GrContext* context = testFactory.get(glCtxType, | 25 GrContext* context = testFactory.get(glCtxType, |
24 GrContextFactory::kEnableNVPR_GLCon
textOptions); | 26 GrContextFactory::kEnableNVPR_GLCon
textOptions); |
25 if (!context) { | 27 if (!context) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 REPORTER_ASSERT(reporter, info2.fGrContext); | 68 REPORTER_ASSERT(reporter, info2.fGrContext); |
67 REPORTER_ASSERT(reporter, info2.fGLContext); | 69 REPORTER_ASSERT(reporter, info2.fGLContext); |
68 REPORTER_ASSERT(reporter, info1.fGrContext != info2.fGrContext); | 70 REPORTER_ASSERT(reporter, info1.fGrContext != info2.fGrContext); |
69 // fGLContext should also change, but it also could get the same address
. | 71 // fGLContext should also change, but it also could get the same address
. |
70 | 72 |
71 info1.fGrContext->unref(); | 73 info1.fGrContext->unref(); |
72 } | 74 } |
73 } | 75 } |
74 | 76 |
75 #endif | 77 #endif |
OLD | NEW |