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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 //! OpenGL or OpenGL ES context depending on the platform. To be removed. | 86 //! OpenGL or OpenGL ES context depending on the platform. To be removed. |
87 static const ContextType kNativeGL_ContextType; | 87 static const ContextType kNativeGL_ContextType; |
88 | 88 |
89 static const int kContextTypeCnt = kLastContextType + 1; | 89 static const int kContextTypeCnt = kLastContextType + 1; |
90 | 90 |
91 /** | 91 /** |
92 * Options for GL context creation. For historical and testing reasons the o
ptions will default | 92 * Options for GL context creation. For historical and testing reasons the o
ptions will default |
93 * to not using GL_NV_path_rendering extension even when the driver support
s it. | 93 * to not using GL_NV_path_rendering extension even when the driver support
s it. |
94 */ | 94 */ |
95 enum class ContextOptions { | 95 enum class ContextOptions { |
96 kNone = 0x0, | 96 kNone = 0x0, |
97 kEnableNVPR = 0x1, | 97 kEnableNVPR = 0x1, |
98 kUseInstanced = 0x2, | 98 kUseInstanced = 0x2, |
99 kRequireSRGBSupport = 0x4, | 99 kRequireSRGBSupport = 0x4, |
100 kRequireSRGBDecodeDisableSupport = 0x8, | |
101 }; | 100 }; |
102 | 101 |
103 static ContextType NativeContextTypeForBackend(GrBackend backend) { | 102 static ContextType NativeContextTypeForBackend(GrBackend backend) { |
104 switch (backend) { | 103 switch (backend) { |
105 case kOpenGL_GrBackend: | 104 case kOpenGL_GrBackend: |
106 return kNativeGL_ContextType; | 105 return kNativeGL_ContextType; |
107 case kVulkan_GrBackend: | 106 case kVulkan_GrBackend: |
108 return kVulkan_ContextType; | 107 return kVulkan_ContextType; |
109 default: | 108 default: |
110 SkFAIL("Unknown backend"); | 109 SkFAIL("Unknown backend"); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 }; | 163 }; |
165 SkTArray<Context, true> fContexts; | 164 SkTArray<Context, true> fContexts; |
166 std::unique_ptr<GLTestContext> fSentinelGLContext; | 165 std::unique_ptr<GLTestContext> fSentinelGLContext; |
167 const GrContextOptions fGlobalOptions; | 166 const GrContextOptions fGlobalOptions; |
168 }; | 167 }; |
169 } // namespace sk_gpu_test | 168 } // namespace sk_gpu_test |
170 | 169 |
171 GR_MAKE_BITFIELD_CLASS_OPS(sk_gpu_test::GrContextFactory::ContextOptions); | 170 GR_MAKE_BITFIELD_CLASS_OPS(sk_gpu_test::GrContextFactory::ContextOptions); |
172 | 171 |
173 #endif | 172 #endif |
OLD | NEW |