OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrContextFactory.h" | 9 #include "GrContextFactory.h" |
10 #include "gl/GLTestContext.h" | 10 #include "gl/GLTestContext.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 if (!glInterface) { | 156 if (!glInterface) { |
157 return ContextInfo(); | 157 return ContextInfo(); |
158 } | 158 } |
159 } | 159 } |
160 backendContext = reinterpret_cast<GrBackendContext>(glInterface.get(
)); | 160 backendContext = reinterpret_cast<GrBackendContext>(glInterface.get(
)); |
161 break; | 161 break; |
162 } | 162 } |
163 #ifdef SK_VULKAN | 163 #ifdef SK_VULKAN |
164 case kVulkan_GrBackend: | 164 case kVulkan_GrBackend: |
165 SkASSERT(kVulkan_ContextType == type); | 165 SkASSERT(kVulkan_ContextType == type); |
166 if ((kEnableNVPR_ContextOptions & options) || | 166 if (kEnableNVPR_ContextOptions & options) { |
167 (kRequireSRGBSupport_ContextOptions & options)) { | |
168 return ContextInfo(); | 167 return ContextInfo(); |
169 } | 168 } |
170 testCtx.reset(CreatePlatformVkTestContext()); | 169 testCtx.reset(CreatePlatformVkTestContext()); |
171 if (!testCtx) { | 170 if (!testCtx) { |
172 return ContextInfo(); | 171 return ContextInfo(); |
173 } | 172 } |
174 | 173 |
175 // There is some bug (either in Skia or the NV Vulkan driver) where
VkDevice | 174 // There is some bug (either in Skia or the NV Vulkan driver) where
VkDevice |
176 // destruction will hang occaisonally. For some reason having an exi
sting GL | 175 // destruction will hang occaisonally. For some reason having an exi
sting GL |
177 // context fixes this. | 176 // context fixes this. |
(...skipping 29 matching lines...) Expand all Loading... |
207 Context& context = fContexts.push_back(); | 206 Context& context = fContexts.push_back(); |
208 context.fBackend = backend; | 207 context.fBackend = backend; |
209 context.fTestContext = testCtx.release(); | 208 context.fTestContext = testCtx.release(); |
210 context.fGrContext = SkRef(grCtx.get()); | 209 context.fGrContext = SkRef(grCtx.get()); |
211 context.fType = type; | 210 context.fType = type; |
212 context.fOptions = options; | 211 context.fOptions = options; |
213 context.fAbandoned = false; | 212 context.fAbandoned = false; |
214 return ContextInfo(context.fBackend, context.fTestContext, context.fGrContex
t); | 213 return ContextInfo(context.fBackend, context.fTestContext, context.fGrContex
t); |
215 } | 214 } |
216 } // namespace sk_gpu_test | 215 } // namespace sk_gpu_test |
OLD | NEW |