| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 #ifndef GrContextFactory_DEFINED | 8 #ifndef GrContextFactory_DEFINED |
| 9 #define GrContextFactory_DEFINED | 9 #define GrContextFactory_DEFINED |
| 10 | 10 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 static bool IsRenderingContext(ContextType type) { | 73 static bool IsRenderingContext(ContextType type) { |
| 74 switch (type) { | 74 switch (type) { |
| 75 case kNullGL_ContextType: | 75 case kNullGL_ContextType: |
| 76 case kDebugGL_ContextType: | 76 case kDebugGL_ContextType: |
| 77 return false; | 77 return false; |
| 78 default: | 78 default: |
| 79 return true; | 79 return true; |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 static GrBackend ContextTypeBackend(ContextType type) { |
| 84 // Currently all the context types use the GL backed |
| 85 return kOpenGL_GrBackend; |
| 86 } |
| 87 |
| 83 static const char* ContextTypeName(ContextType type) { | 88 static const char* ContextTypeName(ContextType type) { |
| 84 switch (type) { | 89 switch (type) { |
| 85 case kGL_ContextType: | 90 case kGL_ContextType: |
| 86 return "gl"; | 91 return "gl"; |
| 87 case kGLES_ContextType: | 92 case kGLES_ContextType: |
| 88 return "gles"; | 93 return "gles"; |
| 89 #if SK_ANGLE | 94 #if SK_ANGLE |
| 90 #ifdef SK_BUILD_FOR_WIN | 95 #ifdef SK_BUILD_FOR_WIN |
| 91 case kANGLE_ContextType: | 96 case kANGLE_ContextType: |
| 92 return "angle"; | 97 return "angle"; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 ContextType fType; | 143 ContextType fType; |
| 139 ContextOptions fOptions; | 144 ContextOptions fOptions; |
| 140 GLTestContext* fGLContext; // null if non-GL | 145 GLTestContext* fGLContext; // null if non-GL |
| 141 GrContext* fGrContext; | 146 GrContext* fGrContext; |
| 142 }; | 147 }; |
| 143 SkTArray<Context, true> fContexts; | 148 SkTArray<Context, true> fContexts; |
| 144 const GrContextOptions fGlobalOptions; | 149 const GrContextOptions fGlobalOptions; |
| 145 }; | 150 }; |
| 146 } // namespace sk_gpu_test | 151 } // namespace sk_gpu_test |
| 147 #endif | 152 #endif |
| OLD | NEW |