Lines Matching defs:context
61 // We must delete the test contexts in reverse order so that any child context is finished and
62 // deleted before a parent context. This relies on the fact that when we make a new context we
66 Context& context = fContexts[i];
68 if (context.fTestContext) {
69 restore = context.fTestContext->makeCurrentAndAutoRestore();
71 if (!context.fGrContext->unique()) {
72 context.fGrContext->releaseResourcesAndAbandonContext();
73 context.fAbandoned = true;
75 context.fGrContext->unref();
76 delete context.fTestContext;
82 // We must abandon the test contexts in reverse order so that any child context is finished and
83 // abandoned before a parent context. This relies on the fact that when we make a new context we
87 Context& context = fContexts[i];
88 if (!context.fAbandoned) {
89 if (context.fTestContext) {
90 auto restore = context.fTestContext->makeCurrentAndAutoRestore();
91 context.fTestContext->testAbandon();
93 GrBackendApi api = context.fGrContext->backend();
96 context.fGrContext->abandonContext();
98 if (context.fTestContext) {
99 delete(context.fTestContext);
100 context.fTestContext = nullptr;
103 context.fGrContext->abandonContext();
105 context.fAbandoned = true;
111 // We must abandon the test contexts in reverse order so that any child context is finished and
112 // abandoned before a parent context. This relies on the fact that when we make a new context we
116 Context& context = fContexts[i];
118 if (!context.fAbandoned) {
119 if (context.fTestContext) {
120 restore = context.fTestContext->makeCurrentAndAutoRestore();
122 context.fGrContext->releaseResourcesAndAbandonContext();
123 if (context.fTestContext) {
124 delete context.fTestContext;
125 context.fTestContext = nullptr;
127 context.fAbandoned = true;
143 Context& context = fContexts[i];
144 if (context.fType == type &&
145 context.fOverrides == overrides &&
146 context.fShareContext == shareContext &&
147 context.fShareIndex == shareIndex &&
148 !context.fAbandoned) {
149 context.fTestContext->makeCurrent();
150 return ContextInfo(context.fType, context.fTestContext, context.fGrContext,
151 context.fOptions);
155 // If we're trying to create a context in a share group, find the primary context
247 // on systems with NVIDIA GPUs and having an existing GL context fixed it. Now (March
248 // 2020) we still need the GL context to keep Vulkan/TSAN bots from running incredibly
331 Context& context = fContexts.push_back();
332 context.fBackend = backend;
333 context.fTestContext = testCtx.release();
334 context.fGrContext = SkRef(grCtx.get());
335 context.fType = type;
336 context.fOverrides = overrides;
337 context.fAbandoned = false;
338 context.fShareContext = shareContext;
339 context.fShareIndex = shareIndex;
340 context.fOptions = grOptions;
341 context.fTestContext->makeCurrent();
342 return ContextInfo(context.fType, context.fTestContext, context.fGrContext, context.fOptions);