blob: 3198247e857bccb285871590dbd04f76d656c072 [file] [log] [blame]
bsalomon3724e572016-03-30 18:56:19 -07001
djsollene4545212014-11-13 11:12:41 -08002/*
3 * Copyright 2014 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
Robert Phillips00f78de2020-07-01 16:09:43 -04009#include "include/gpu/GrDirectContext.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050010#include "src/gpu/GrContextPriv.h"
11#include "tools/gpu/GrContextFactory.h"
John Rosascoa9b348f2019-11-08 13:18:15 -080012#ifdef SK_GL
Mike Kleinc0bd9f92019-04-23 12:05:21 -050013#include "tools/gpu/gl/GLTestContext.h"
John Rosascoa9b348f2019-11-08 13:18:15 -080014#endif
djsollene4545212014-11-13 11:12:41 -080015
Mike Kleinc168a3a2016-11-14 14:53:13 +000016#if SK_ANGLE
Jim Van Verthb01e12b2020-02-18 14:34:38 -050017#include "tools/gpu/gl/angle/GLTestContext_angle.h"
Mike Kleinc168a3a2016-11-14 14:53:13 +000018#endif
Mike Kleinc0bd9f92019-04-23 12:05:21 -050019#include "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.h"
djsollen7e731082016-06-09 13:07:13 -070020#ifdef SK_VULKAN
Mike Kleinc0bd9f92019-04-23 12:05:21 -050021#include "tools/gpu/vk/VkTestContext.h"
bsalomon7c62b472016-04-01 07:42:05 -070022#endif
Greg Danielb76a72a2017-07-13 15:07:54 -040023#ifdef SK_METAL
Mike Kleinc0bd9f92019-04-23 12:05:21 -050024#include "tools/gpu/mtl/MtlTestContext.h"
Greg Danielb76a72a2017-07-13 15:07:54 -040025#endif
Jim Van Verthb01e12b2020-02-18 14:34:38 -050026#ifdef SK_DIRECT3D
27#include "tools/gpu/d3d/D3DTestContext.h"
28#endif
Stephen White985741a2019-07-18 11:43:45 -040029#ifdef SK_DAWN
30#include "tools/gpu/dawn/DawnTestContext.h"
31#endif
Mike Kleinc0bd9f92019-04-23 12:05:21 -050032#include "src/gpu/GrCaps.h"
Robert Phillips08ba0852019-05-22 20:23:43 +000033#include "src/gpu/gl/GrGLGpu.h"
Mike Kleinc0bd9f92019-04-23 12:05:21 -050034#include "tools/gpu/mock/MockTestContext.h"
djsollene4545212014-11-13 11:12:41 -080035
Mike Klein8f11d4d2018-01-24 12:42:55 -050036#if defined(SK_BUILD_FOR_WIN) && defined(SK_ENABLE_DISCRETE_GPU)
Brian Osman3f375d02016-12-28 11:19:22 -050037extern "C" {
38 // NVIDIA documents that the presence and value of this symbol programmatically enable the high
39 // performance GPU in laptops with switchable graphics.
40 // https://docs.nvidia.com/gameworks/content/technologies/desktop/optimus.htm
41 // From testing, including this symbol, even if it is set to 0, we still get the NVIDIA GPU.
42 _declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001;
43
44 // AMD has a similar mechanism, although I don't have an AMD laptop, so this is untested.
45 // https://community.amd.com/thread/169965
46 __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
47}
48#endif
49
bsalomon3724e572016-03-30 18:56:19 -070050namespace sk_gpu_test {
kkinnunen34058002016-01-06 23:49:30 -080051GrContextFactory::GrContextFactory() { }
52
53GrContextFactory::GrContextFactory(const GrContextOptions& opts)
54 : fGlobalOptions(opts) {
55}
56
57GrContextFactory::~GrContextFactory() {
58 this->destroyContexts();
59}
60
61void GrContextFactory::destroyContexts() {
Greg Danielf0fe02f2018-01-16 11:20:41 -050062 // We must delete the test contexts in reverse order so that any child context is finished and
63 // deleted before a parent context. This relies on the fact that when we make a new context we
64 // append it to the end of fContexts array.
65 // TODO: Look into keeping a dependency dag for contexts and deletion order
66 for (int i = fContexts.count() - 1; i >= 0; --i) {
67 Context& context = fContexts[i];
Brian Salomon55ad7742017-11-17 09:25:23 -050068 SkScopeExit restore(nullptr);
bsalomon18a2f9d2016-05-11 10:09:18 -070069 if (context.fTestContext) {
Brian Salomon55ad7742017-11-17 09:25:23 -050070 restore = context.fTestContext->makeCurrentAndAutoRestore();
kkinnunen34058002016-01-06 23:49:30 -080071 }
72 if (!context.fGrContext->unique()) {
bsalomondc0fcd42016-04-11 14:21:33 -070073 context.fGrContext->releaseResourcesAndAbandonContext();
74 context.fAbandoned = true;
kkinnunen34058002016-01-06 23:49:30 -080075 }
76 context.fGrContext->unref();
bsalomon18a2f9d2016-05-11 10:09:18 -070077 delete context.fTestContext;
kkinnunen34058002016-01-06 23:49:30 -080078 }
79 fContexts.reset();
80}
81
82void GrContextFactory::abandonContexts() {
Greg Danielf0fe02f2018-01-16 11:20:41 -050083 // We must abandon the test contexts in reverse order so that any child context is finished and
84 // abandoned before a parent context. This relies on the fact that when we make a new context we
85 // append it to the end of fContexts array.
86 // TODO: Look into keeping a dependency dag for contexts and deletion order
87 for (int i = fContexts.count() - 1; i >= 0; --i) {
88 Context& context = fContexts[i];
bsalomondc0fcd42016-04-11 14:21:33 -070089 if (!context.fAbandoned) {
bsalomon18a2f9d2016-05-11 10:09:18 -070090 if (context.fTestContext) {
Brian Salomon55ad7742017-11-17 09:25:23 -050091 auto restore = context.fTestContext->makeCurrentAndAutoRestore();
bsalomon18a2f9d2016-05-11 10:09:18 -070092 context.fTestContext->testAbandon();
Greg Danielf0e04f02019-12-04 15:17:54 -050093 }
Stephen White37a46d22020-06-05 11:42:39 -040094 GrBackendApi api = context.fGrContext->backend();
95 bool requiresEarlyAbandon = api == GrBackendApi::kVulkan || api == GrBackendApi::kDawn;
Greg Danielf0e04f02019-12-04 15:17:54 -050096 if (requiresEarlyAbandon) {
97 context.fGrContext->abandonContext();
98 }
99 if (context.fTestContext) {
bsalomon18a2f9d2016-05-11 10:09:18 -0700100 delete(context.fTestContext);
101 context.fTestContext = nullptr;
bsalomondc0fcd42016-04-11 14:21:33 -0700102 }
Greg Danielf0e04f02019-12-04 15:17:54 -0500103 if (!requiresEarlyAbandon) {
104 context.fGrContext->abandonContext();
105 }
bsalomondc0fcd42016-04-11 14:21:33 -0700106 context.fAbandoned = true;
kkinnunen34058002016-01-06 23:49:30 -0800107 }
kkinnunen34058002016-01-06 23:49:30 -0800108 }
109}
110
bsalomon6e2aad42016-04-01 11:54:31 -0700111void GrContextFactory::releaseResourcesAndAbandonContexts() {
Greg Danielf0fe02f2018-01-16 11:20:41 -0500112 // We must abandon the test contexts in reverse order so that any child context is finished and
113 // abandoned before a parent context. This relies on the fact that when we make a new context we
114 // append it to the end of fContexts array.
115 // TODO: Look into keeping a dependency dag for contexts and deletion order
116 for (int i = fContexts.count() - 1; i >= 0; --i) {
117 Context& context = fContexts[i];
Brian Salomon55ad7742017-11-17 09:25:23 -0500118 SkScopeExit restore(nullptr);
bsalomondc0fcd42016-04-11 14:21:33 -0700119 if (!context.fAbandoned) {
bsalomon18a2f9d2016-05-11 10:09:18 -0700120 if (context.fTestContext) {
Brian Salomon55ad7742017-11-17 09:25:23 -0500121 restore = context.fTestContext->makeCurrentAndAutoRestore();
bsalomondc0fcd42016-04-11 14:21:33 -0700122 }
bsalomon6e2aad42016-04-01 11:54:31 -0700123 context.fGrContext->releaseResourcesAndAbandonContext();
bsalomon18a2f9d2016-05-11 10:09:18 -0700124 if (context.fTestContext) {
125 delete context.fTestContext;
126 context.fTestContext = nullptr;
bsalomondc0fcd42016-04-11 14:21:33 -0700127 }
Greg Danielf0e04f02019-12-04 15:17:54 -0500128 context.fAbandoned = true;
bsalomon6e2aad42016-04-01 11:54:31 -0700129 }
130 }
131}
132
Robert Phillips00f78de2020-07-01 16:09:43 -0400133GrDirectContext* GrContextFactory::get(ContextType type, ContextOverrides overrides) {
134 return this->getContextInfo(type, overrides).directContext();
Robert Phillipscdabbcc2017-06-08 16:03:17 -0400135}
136
Brian Osman9eac2ea2017-02-24 14:51:44 -0500137ContextInfo GrContextFactory::getContextInfoInternal(ContextType type, ContextOverrides overrides,
Robert Phillips00f78de2020-07-01 16:09:43 -0400138 GrDirectContext* shareContext,
139 uint32_t shareIndex) {
Brian Osman60c774d2017-02-21 16:58:08 -0500140 // (shareIndex != 0) -> (shareContext != nullptr)
141 SkASSERT((shareIndex == 0) || (shareContext != nullptr));
142
djsollene4545212014-11-13 11:12:41 -0800143 for (int i = 0; i < fContexts.count(); ++i) {
kkinnunen34058002016-01-06 23:49:30 -0800144 Context& context = fContexts[i];
kkinnunen34058002016-01-06 23:49:30 -0800145 if (context.fType == type &&
csmartdaltone812d492017-02-21 12:36:05 -0700146 context.fOverrides == overrides &&
Brian Osman60c774d2017-02-21 16:58:08 -0500147 context.fShareContext == shareContext &&
148 context.fShareIndex == shareIndex &&
bsalomondc0fcd42016-04-11 14:21:33 -0700149 !context.fAbandoned) {
bsalomon18a2f9d2016-05-11 10:09:18 -0700150 context.fTestContext->makeCurrent();
Brian Salomon43f8bf02017-10-18 08:33:29 -0400151 return ContextInfo(context.fType, context.fTestContext, context.fGrContext,
152 context.fOptions);
djsollene4545212014-11-13 11:12:41 -0800153 }
154 }
Brian Osman60c774d2017-02-21 16:58:08 -0500155
156 // If we're trying to create a context in a share group, find the master context
157 Context* masterContext = nullptr;
158 if (shareContext) {
159 for (int i = 0; i < fContexts.count(); ++i) {
160 if (!fContexts[i].fAbandoned && fContexts[i].fGrContext == shareContext) {
161 masterContext = &fContexts[i];
162 break;
163 }
164 }
Brian Osman9eac2ea2017-02-24 14:51:44 -0500165 SkASSERT(masterContext && masterContext->fType == type);
Brian Osman60c774d2017-02-21 16:58:08 -0500166 }
167
Ben Wagner145dbcd2016-11-03 14:40:50 -0400168 std::unique_ptr<TestContext> testCtx;
Greg Danielbdf12ad2018-10-12 09:31:11 -0400169 GrBackendApi backend = ContextTypeBackend(type);
bsalomondc0fcd42016-04-11 14:21:33 -0700170 switch (backend) {
John Rosascoa9b348f2019-11-08 13:18:15 -0800171#ifdef SK_GL
Greg Danielbdf12ad2018-10-12 09:31:11 -0400172 case GrBackendApi::kOpenGL: {
Brian Osman60c774d2017-02-21 16:58:08 -0500173 GLTestContext* glShareContext = masterContext
174 ? static_cast<GLTestContext*>(masterContext->fTestContext) : nullptr;
bsalomon18a2f9d2016-05-11 10:09:18 -0700175 GLTestContext* glCtx;
bsalomondc0fcd42016-04-11 14:21:33 -0700176 switch (type) {
177 case kGL_ContextType:
Brian Osman60c774d2017-02-21 16:58:08 -0500178 glCtx = CreatePlatformGLTestContext(kGL_GrGLStandard, glShareContext);
bsalomondc0fcd42016-04-11 14:21:33 -0700179 break;
180 case kGLES_ContextType:
Brian Osman60c774d2017-02-21 16:58:08 -0500181 glCtx = CreatePlatformGLTestContext(kGLES_GrGLStandard, glShareContext);
bsalomondc0fcd42016-04-11 14:21:33 -0700182 break;
Mike Kleinc168a3a2016-11-14 14:53:13 +0000183#if SK_ANGLE
bsalomon11abd8d2016-10-14 08:13:48 -0700184 case kANGLE_D3D9_ES2_ContextType:
Brian Osman60c774d2017-02-21 16:58:08 -0500185 glCtx = MakeANGLETestContext(ANGLEBackend::kD3D9, ANGLEContextVersion::kES2,
186 glShareContext).release();
Brian Salomon414782d2020-04-17 09:34:17 -0400187 // Chrome will only run on D3D9 with NVIDIA for 2012 and earlier drivers.
188 // (<= 269.73). We get shader link failures when testing on recent drivers
189 // using this backend.
190 if (glCtx) {
191 auto [backend, vendor, renderer] = GrGLGetANGLEInfo(glCtx->gl());
192 if (vendor == GrGLANGLEVendor::kNVIDIA) {
193 delete glCtx;
194 return ContextInfo();
195 }
196 }
bsalomondc0fcd42016-04-11 14:21:33 -0700197 break;
bsalomon11abd8d2016-10-14 08:13:48 -0700198 case kANGLE_D3D11_ES2_ContextType:
Brian Osman60c774d2017-02-21 16:58:08 -0500199 glCtx = MakeANGLETestContext(ANGLEBackend::kD3D11, ANGLEContextVersion::kES2,
200 glShareContext).release();
bsalomon11abd8d2016-10-14 08:13:48 -0700201 break;
202 case kANGLE_D3D11_ES3_ContextType:
Brian Osman60c774d2017-02-21 16:58:08 -0500203 glCtx = MakeANGLETestContext(ANGLEBackend::kD3D11, ANGLEContextVersion::kES3,
204 glShareContext).release();
bsalomon11abd8d2016-10-14 08:13:48 -0700205 break;
206 case kANGLE_GL_ES2_ContextType:
Brian Osman60c774d2017-02-21 16:58:08 -0500207 glCtx = MakeANGLETestContext(ANGLEBackend::kOpenGL, ANGLEContextVersion::kES2,
208 glShareContext).release();
bsalomon11abd8d2016-10-14 08:13:48 -0700209 break;
210 case kANGLE_GL_ES3_ContextType:
Brian Osman60c774d2017-02-21 16:58:08 -0500211 glCtx = MakeANGLETestContext(ANGLEBackend::kOpenGL, ANGLEContextVersion::kES3,
212 glShareContext).release();
bsalomondc0fcd42016-04-11 14:21:33 -0700213 break;
Mike Kleinc168a3a2016-11-14 14:53:13 +0000214#endif
Kevin Lubickffce0792017-05-24 15:30:35 -0400215#ifndef SK_NO_COMMAND_BUFFER
bsalomondc0fcd42016-04-11 14:21:33 -0700216 case kCommandBuffer_ContextType:
Brian Osman60c774d2017-02-21 16:58:08 -0500217 glCtx = CommandBufferGLTestContext::Create(glShareContext);
bsalomondc0fcd42016-04-11 14:21:33 -0700218 break;
Kevin Lubickffce0792017-05-24 15:30:35 -0400219#endif
bsalomondc0fcd42016-04-11 14:21:33 -0700220 default:
221 return ContextInfo();
222 }
bsalomon18a2f9d2016-05-11 10:09:18 -0700223 if (!glCtx) {
bsalomondc0fcd42016-04-11 14:21:33 -0700224 return ContextInfo();
225 }
bsalomon18a2f9d2016-05-11 10:09:18 -0700226 testCtx.reset(glCtx);
djsollene4545212014-11-13 11:12:41 -0800227 break;
bsalomon18a2f9d2016-05-11 10:09:18 -0700228 }
John Rosascoa9b348f2019-11-08 13:18:15 -0800229#endif // SK_GL
jvanvertha50e17a2015-08-12 12:19:36 -0700230#ifdef SK_VULKAN
Greg Danielbdf12ad2018-10-12 09:31:11 -0400231 case GrBackendApi::kVulkan: {
Greg Daniel604b1972017-05-15 13:50:35 -0400232 VkTestContext* vkSharedContext = masterContext
233 ? static_cast<VkTestContext*>(masterContext->fTestContext) : nullptr;
bsalomondc0fcd42016-04-11 14:21:33 -0700234 SkASSERT(kVulkan_ContextType == type);
Greg Daniel604b1972017-05-15 13:50:35 -0400235 testCtx.reset(CreatePlatformVkTestContext(vkSharedContext));
bsalomon18a2f9d2016-05-11 10:09:18 -0700236 if (!testCtx) {
bsalomondc0fcd42016-04-11 14:21:33 -0700237 return ContextInfo();
238 }
bsalomon18a2f9d2016-05-11 10:09:18 -0700239
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400240 // We previously had an issue where the VkDevice destruction would occasionally hang
241 // on systems with NVIDIA GPUs and having an existing GL context fixed it. Now (March
242 // 2020) we still need the GL context to keep Vulkan/TSAN bots from running incredibly
243 // slow. Perhaps this prevents repeated driver loading/unloading? Note that keeping
244 // a persistent VkTestContext around instead was tried and did not work.
Brian Salomon7f9c29a2017-01-24 22:22:05 +0000245 if (!fSentinelGLContext) {
246 fSentinelGLContext.reset(CreatePlatformGLTestContext(kGL_GrGLStandard));
247 if (!fSentinelGLContext) {
248 fSentinelGLContext.reset(CreatePlatformGLTestContext(kGLES_GrGLStandard));
249 }
250 }
bsalomondc0fcd42016-04-11 14:21:33 -0700251 break;
Greg Daniel604b1972017-05-15 13:50:35 -0400252 }
jvanvertha50e17a2015-08-12 12:19:36 -0700253#endif
Greg Danielb76a72a2017-07-13 15:07:54 -0400254#ifdef SK_METAL
Greg Danielbdf12ad2018-10-12 09:31:11 -0400255 case GrBackendApi::kMetal: {
Jim Van Vertha3407ab2019-03-15 15:22:39 -0400256 MtlTestContext* mtlSharedContext = masterContext
257 ? static_cast<MtlTestContext*>(masterContext->fTestContext) : nullptr;
258 SkASSERT(kMetal_ContextType == type);
259 testCtx.reset(CreatePlatformMtlTestContext(mtlSharedContext));
Greg Danielb76a72a2017-07-13 15:07:54 -0400260 if (!testCtx) {
261 return ContextInfo();
262 }
263 break;
264 }
265#endif
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500266#ifdef SK_DIRECT3D
267 case GrBackendApi::kDirect3D: {
268 D3DTestContext* d3dSharedContext = masterContext
269 ? static_cast<D3DTestContext*>(masterContext->fTestContext) : nullptr;
270 SkASSERT(kDirect3D_ContextType == type);
271 testCtx.reset(CreatePlatformD3DTestContext(d3dSharedContext));
272 if (!testCtx) {
273 return ContextInfo();
274 }
275 break;
276 }
277#endif
Stephen White985741a2019-07-18 11:43:45 -0400278#ifdef SK_DAWN
279 case GrBackendApi::kDawn: {
280 DawnTestContext* dawnSharedContext = masterContext
281 ? static_cast<DawnTestContext*>(masterContext->fTestContext) : nullptr;
282 testCtx.reset(CreatePlatformDawnTestContext(dawnSharedContext));
283 if (!testCtx) {
284 return ContextInfo();
285 }
286 break;
287 }
288#endif
Greg Danielbdf12ad2018-10-12 09:31:11 -0400289 case GrBackendApi::kMock: {
Brian Salomoncfe910d2017-07-06 16:40:18 -0400290 TestContext* sharedContext = masterContext ? masterContext->fTestContext : nullptr;
291 SkASSERT(kMock_ContextType == type);
Brian Salomoncfe910d2017-07-06 16:40:18 -0400292 testCtx.reset(CreateMockTestContext(sharedContext));
293 if (!testCtx) {
294 return ContextInfo();
295 }
Brian Salomoncfe910d2017-07-06 16:40:18 -0400296 break;
297 }
bsalomondc0fcd42016-04-11 14:21:33 -0700298 default:
299 return ContextInfo();
300 }
Brian Salomon55ad7742017-11-17 09:25:23 -0500301
bsalomon18a2f9d2016-05-11 10:09:18 -0700302 SkASSERT(testCtx && testCtx->backend() == backend);
csmartdaltone0d36292016-07-29 08:14:20 -0700303 GrContextOptions grOptions = fGlobalOptions;
Eric Karl5c779752017-05-08 12:02:07 -0700304 if (ContextOverrides::kAvoidStencilBuffers & overrides) {
305 grOptions.fAvoidStencilBuffers = true;
306 }
Robert Phillips00f78de2020-07-01 16:09:43 -0400307 sk_sp<GrDirectContext> grCtx;
Brian Salomon55ad7742017-11-17 09:25:23 -0500308 {
309 auto restore = testCtx->makeCurrentAndAutoRestore();
Robert Phillips00f78de2020-07-01 16:09:43 -0400310 // CONTEXT TODO: makeGrContext should return an sk_sp<GrDirectContext>
311 auto tmp = testCtx->makeGrContext(grOptions);
Adlai Hollere3ad5272020-07-07 10:27:55 -0400312 grCtx = sk_ref_sp(GrAsDirectContext(tmp.get()));
Brian Salomon55ad7742017-11-17 09:25:23 -0500313 }
djsollene4545212014-11-13 11:12:41 -0800314 if (!grCtx.get()) {
kkinnunen34058002016-01-06 23:49:30 -0800315 return ContextInfo();
djsollene4545212014-11-13 11:12:41 -0800316 }
kkinnunencfe62e32015-07-01 02:58:50 -0700317
Greg Danielf0fe02f2018-01-16 11:20:41 -0500318 // We must always add new contexts by pushing to the back so that when we delete them we delete
319 // them in reverse order in which they were made.
kkinnunen34058002016-01-06 23:49:30 -0800320 Context& context = fContexts.push_back();
bsalomon18a2f9d2016-05-11 10:09:18 -0700321 context.fBackend = backend;
322 context.fTestContext = testCtx.release();
kkinnunen34058002016-01-06 23:49:30 -0800323 context.fGrContext = SkRef(grCtx.get());
324 context.fType = type;
csmartdaltone812d492017-02-21 12:36:05 -0700325 context.fOverrides = overrides;
bsalomondc0fcd42016-04-11 14:21:33 -0700326 context.fAbandoned = false;
Brian Osman60c774d2017-02-21 16:58:08 -0500327 context.fShareContext = shareContext;
328 context.fShareIndex = shareIndex;
Brian Salomon43f8bf02017-10-18 08:33:29 -0400329 context.fOptions = grOptions;
Brian Salomon55ad7742017-11-17 09:25:23 -0500330 context.fTestContext->makeCurrent();
Brian Salomon43f8bf02017-10-18 08:33:29 -0400331 return ContextInfo(context.fType, context.fTestContext, context.fGrContext, context.fOptions);
djsollene4545212014-11-13 11:12:41 -0800332}
Brian Osman60c774d2017-02-21 16:58:08 -0500333
Brian Osman9eac2ea2017-02-24 14:51:44 -0500334ContextInfo GrContextFactory::getContextInfo(ContextType type, ContextOverrides overrides) {
335 return this->getContextInfoInternal(type, overrides, nullptr, 0);
336}
337
Robert Phillips00f78de2020-07-01 16:09:43 -0400338ContextInfo GrContextFactory::getSharedContextInfo(GrDirectContext* shareContext,
339 uint32_t shareIndex) {
Brian Osman9eac2ea2017-02-24 14:51:44 -0500340 SkASSERT(shareContext);
341 for (int i = 0; i < fContexts.count(); ++i) {
342 if (!fContexts[i].fAbandoned && fContexts[i].fGrContext == shareContext) {
343 return this->getContextInfoInternal(fContexts[i].fType, fContexts[i].fOverrides,
344 shareContext, shareIndex);
345 }
346 }
347
348 return ContextInfo();
349}
350
bsalomon3724e572016-03-30 18:56:19 -0700351} // namespace sk_gpu_test