| 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 10 matching lines...) Expand all Loading... |
| 21 #include "GrContext.h" | 21 #include "GrContext.h" |
| 22 #include "SkTArray.h" | 22 #include "SkTArray.h" |
| 23 | 23 |
| 24 /** | 24 /** |
| 25 * This is a simple class that is useful in test apps that use different | 25 * This is a simple class that is useful in test apps that use different |
| 26 * GrContexts backed by different types of GL contexts. It manages creating the | 26 * GrContexts backed by different types of GL contexts. It manages creating the |
| 27 * GL context and a GrContext that uses it. The GL/Gr contexts persist until the | 27 * GL context and a GrContext that uses it. The GL/Gr contexts persist until the |
| 28 * factory is destroyed (though the caller can always grab a ref on the returned | 28 * factory is destroyed (though the caller can always grab a ref on the returned |
| 29 * Gr and GL contexts to make them outlive the factory). | 29 * Gr and GL contexts to make them outlive the factory). |
| 30 */ | 30 */ |
| 31 class GrContextFactory : public SkNoncopyable { | 31 class GrContextFactory : SkNoncopyable { |
| 32 public: | 32 public: |
| 33 /** | 33 /** |
| 34 * Types of GL contexts supported. For historical and testing reasons the na
tive GrContext will | 34 * Types of GL contexts supported. For historical and testing reasons the na
tive GrContext will |
| 35 * not use "GL_NV_path_rendering" even when the driver supports it. There is
a separate context | 35 * not use "GL_NV_path_rendering" even when the driver supports it. There is
a separate context |
| 36 * type that does not remove NVPR support and which will fail when the drive
r does not support | 36 * type that does not remove NVPR support and which will fail when the drive
r does not support |
| 37 * the extension. | 37 * the extension. |
| 38 */ | 38 */ |
| 39 enum GLContextType { | 39 enum GLContextType { |
| 40 kNative_GLContextType, | 40 kNative_GLContextType, |
| 41 #if SK_ANGLE | 41 #if SK_ANGLE |
| (...skipping 146 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 |