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

Side by Side Diff: tests/GLInterfaceValidationTest.cpp

Issue 630843002: Make the Sk GL context class an abstract base class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix android link problem and ios compile problem Created 6 years, 2 months 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/gl/win/SkNativeGLContext_win.cpp ('k') | tests/Test.cpp » ('j') | 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 "Test.h" 8 #include "Test.h"
9 9
10 // This is a GPU-backend specific test 10 // This is a GPU-backend specific test
11 #if SK_SUPPORT_GPU 11 #if SK_SUPPORT_GPU
12 12
13 #include "GrContextFactory.h" 13 #include "GrContextFactory.h"
14 14
15 DEF_GPUTEST(GLInterfaceValidation, reporter, factory) { 15 DEF_GPUTEST(GLInterfaceValidation, reporter, factory) {
16 for (int i = 0; i <= GrContextFactory::kLastGLContextType; ++i) { 16 for (int i = 0; i <= GrContextFactory::kLastGLContextType; ++i) {
17 GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContext Type)i; 17 GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContext Type)i;
18 // this forces the factory to make the context if it hasn't yet 18 // this forces the factory to make the context if it hasn't yet
19 factory->get(glCtxType); 19 factory->get(glCtxType);
20 SkGLContextHelper* glCtxHelper = factory->getGLContext(glCtxType); 20 SkGLContext* glCtx = factory->getGLContext(glCtxType);
21 21
22 // We're supposed to fail the NVPR context type when we the native conte xt that does not 22 // We're supposed to fail the NVPR context type when we the native conte xt that does not
23 // support the NVPR extension. 23 // support the NVPR extension.
24 if (GrContextFactory::kNVPR_GLContextType == glCtxType && 24 if (GrContextFactory::kNVPR_GLContextType == glCtxType &&
25 factory->getGLContext(GrContextFactory::kNative_GLContextType) && 25 factory->getGLContext(GrContextFactory::kNative_GLContextType) &&
26 !factory->getGLContext(GrContextFactory::kNative_GLContextType)->has Extension("GL_NV_path_rendering")) { 26 !factory->getGLContext(GrContextFactory::kNative_GLContextType)->has Extension("GL_NV_path_rendering")) {
27 REPORTER_ASSERT(reporter, NULL == glCtxHelper); 27 REPORTER_ASSERT(reporter, NULL == glCtx);
28 continue; 28 continue;
29 } 29 }
30 30
31 REPORTER_ASSERT(reporter, glCtxHelper); 31 REPORTER_ASSERT(reporter, glCtx);
32 if (glCtxHelper) { 32 if (glCtx) {
33 const GrGLInterface* interface = glCtxHelper->gl(); 33 const GrGLInterface* interface = glCtx->gl();
34 REPORTER_ASSERT(reporter, interface->validate()); 34 REPORTER_ASSERT(reporter, interface->validate());
35 } 35 }
36 } 36 }
37 } 37 }
38 38
39 #endif 39 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/win/SkNativeGLContext_win.cpp ('k') | tests/Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698