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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 #endif | 77 #endif |
78 #if SK_MESA | 78 #if SK_MESA |
79 case kMESA_GLContextType: | 79 case kMESA_GLContextType: |
80 return "mesa"; | 80 return "mesa"; |
81 #endif | 81 #endif |
82 case kNVPR_GLContextType: | 82 case kNVPR_GLContextType: |
83 return "nvpr"; | 83 return "nvpr"; |
84 case kDebug_GLContextType: | 84 case kDebug_GLContextType: |
85 return "debug"; | 85 return "debug"; |
86 default: | 86 default: |
87 GrCrash("Unknown GL Context type."); | 87 SkFAIL("Unknown GL Context type."); |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 GrContextFactory() { | 91 GrContextFactory() { |
92 } | 92 } |
93 | 93 |
94 ~GrContextFactory() { this->destroyContexts(); } | 94 ~GrContextFactory() { this->destroyContexts(); } |
95 | 95 |
96 void destroyContexts() { | 96 void destroyContexts() { |
97 for (int i = 0; i < fContexts.count(); ++i) { | 97 for (int i = 0; i < fContexts.count(); ++i) { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 private: | 188 private: |
189 struct GPUContext { | 189 struct GPUContext { |
190 GLContextType fType; | 190 GLContextType fType; |
191 SkGLContextHelper* fGLContext; | 191 SkGLContextHelper* fGLContext; |
192 GrContext* fGrContext; | 192 GrContext* fGrContext; |
193 }; | 193 }; |
194 SkTArray<GPUContext, true> fContexts; | 194 SkTArray<GPUContext, true> fContexts; |
195 }; | 195 }; |
196 | 196 |
197 #endif | 197 #endif |
OLD | NEW |