Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(559)

Side by Side Diff: tests/GrContextFactoryTest.cpp

Issue 1511613004: Revert of Make NVPR a GL context option instead of a GL context (Closed) Base URL: https://skia.googlesource.com/skia.git@commandbuffer-as-api-02-other-tests-refactor
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrContextFactory.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_NVPRContextOptionHasPathRenderingSupport, reporter, /*factory*/) { 16 DEF_GPUTEST(GrContextFactory_NVPRContextTypeHasPathRenderingSupport, 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::kNative_GLContextType , 20 GrContext* context = testFactory.get(GrContextFactory::kNVPR_GLContextType);
21 kNone_GrGLStandard,
22 GrContextFactory::kEnableNVPR_GLContext Options);
23 if (context) { 21 if (context) {
24 REPORTER_ASSERT( 22 REPORTER_ASSERT(
25 reporter, 23 reporter,
26 context->caps()->shaderCaps()->pathRenderingSupport()); 24 context->caps()->shaderCaps()->pathRenderingSupport());
27 } 25 }
28 } 26 }
29 27
30 DEF_GPUTEST(GrContextFactory_NoPathRenderingUnlessNVPRRequested, reporter, /*fac tory*/) { 28 DEF_GPUTEST(GrContextFactory_NoPathRenderingUnlessNVPRRequested, reporter, /*fac tory*/) {
31 // Test that if NVPR is not requested, the context never has path rendering support. 29 // Test that if NVPR is not requested, the context never has path rendering support.
32 30
33 GrContextFactory testFactory; 31 GrContextFactory testFactory;
34 for (int i = 0; i <= GrContextFactory::kLastGLContextType; ++i) { 32 for (int i = 0; i <= GrContextFactory::kLastGLContextType; ++i) {
35 GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContext Type)i; 33 GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContext Type)i;
34 if (glCtxType == GrContextFactory::kNVPR_GLContextType) {
35 continue;
36 }
36 GrContext* context = testFactory.get(glCtxType); 37 GrContext* context = testFactory.get(glCtxType);
37 if (context) { 38 if (context) {
38 REPORTER_ASSERT( 39 REPORTER_ASSERT(
39 reporter, 40 reporter,
40 !context->caps()->shaderCaps()->pathRenderingSupport()); 41 !context->caps()->shaderCaps()->pathRenderingSupport());
41 } 42 }
42 } 43 }
43 } 44 }
44 45
45 #endif 46 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrContextFactory.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698