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 16 matching lines...) Expand all Loading... |
27 * Types of GL contexts supported. For historical and testing reasons the na
tive GrContext will | 27 * Types of GL contexts supported. For historical and testing reasons the na
tive GrContext will |
28 * not use "GL_NV_path_rendering" even when the driver supports it. There is
a separate context | 28 * not use "GL_NV_path_rendering" even when the driver supports it. There is
a separate context |
29 * type that does not remove NVPR support and which will fail when the drive
r does not support | 29 * type that does not remove NVPR support and which will fail when the drive
r does not support |
30 * the extension. | 30 * the extension. |
31 */ | 31 */ |
32 enum GLContextType { | 32 enum GLContextType { |
33 kNative_GLContextType, | 33 kNative_GLContextType, |
34 #if SK_ANGLE | 34 #if SK_ANGLE |
35 kANGLE_GLContextType, | 35 kANGLE_GLContextType, |
36 #endif | 36 #endif |
| 37 #if SK_COMMAND_BUFFER |
| 38 kCommandBuffer_GLContextType, |
| 39 #endif |
37 #if SK_MESA | 40 #if SK_MESA |
38 kMESA_GLContextType, | 41 kMESA_GLContextType, |
39 #endif | 42 #endif |
40 /** Similar to kNative but does not filter NVPR. It will fail if the GL dr
iver does not | 43 /** Similar to kNative but does not filter NVPR. It will fail if the GL dr
iver does not |
41 support NVPR */ | 44 support NVPR */ |
42 kNVPR_GLContextType, | 45 kNVPR_GLContextType, |
43 kNull_GLContextType, | 46 kNull_GLContextType, |
44 kDebug_GLContextType, | 47 kDebug_GLContextType, |
45 | 48 |
46 kLastGLContextType = kDebug_GLContextType | 49 kLastGLContextType = kDebug_GLContextType |
(...skipping 14 matching lines...) Expand all Loading... |
61 static const char* GLContextTypeName(GLContextType type) { | 64 static const char* GLContextTypeName(GLContextType type) { |
62 switch (type) { | 65 switch (type) { |
63 case kNative_GLContextType: | 66 case kNative_GLContextType: |
64 return "native"; | 67 return "native"; |
65 case kNull_GLContextType: | 68 case kNull_GLContextType: |
66 return "null"; | 69 return "null"; |
67 #if SK_ANGLE | 70 #if SK_ANGLE |
68 case kANGLE_GLContextType: | 71 case kANGLE_GLContextType: |
69 return "angle"; | 72 return "angle"; |
70 #endif | 73 #endif |
| 74 #if SK_COMMAND_BUFFER |
| 75 case kCommandBuffer_GLContextType: |
| 76 return "commandbuffer"; |
| 77 #endif |
71 #if SK_MESA | 78 #if SK_MESA |
72 case kMESA_GLContextType: | 79 case kMESA_GLContextType: |
73 return "mesa"; | 80 return "mesa"; |
74 #endif | 81 #endif |
75 case kNVPR_GLContextType: | 82 case kNVPR_GLContextType: |
76 return "nvpr"; | 83 return "nvpr"; |
77 case kDebug_GLContextType: | 84 case kDebug_GLContextType: |
78 return "debug"; | 85 return "debug"; |
79 default: | 86 default: |
80 SkFAIL("Unknown GL Context type."); | 87 SkFAIL("Unknown GL Context type."); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 struct GPUContext { | 140 struct GPUContext { |
134 GLContextType fType; | 141 GLContextType fType; |
135 SkGLContext* fGLContext; | 142 SkGLContext* fGLContext; |
136 GrContext* fGrContext; | 143 GrContext* fGrContext; |
137 }; | 144 }; |
138 SkTArray<GPUContext, true> fContexts; | 145 SkTArray<GPUContext, true> fContexts; |
139 const GrContextOptions fGlobalOptions; | 146 const GrContextOptions fGlobalOptions; |
140 }; | 147 }; |
141 | 148 |
142 #endif | 149 #endif |
OLD | NEW |