Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(633)

Side by Side Diff: src/gpu/GrContextFactory.cpp

Issue 1818093002: Minor fixes to avoid NVPR in Vulkan and provide good GrVkGpu teardown. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/gpu/vk/GrVkGpu.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 10
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 if (!(kEnableNVPR_GLContextOptions & options)) { 122 if (!(kEnableNVPR_GLContextOptions & options)) {
123 glInterface.reset(GrGLInterfaceRemoveNVPR(glInterface)); 123 glInterface.reset(GrGLInterfaceRemoveNVPR(glInterface));
124 if (!glInterface) { 124 if (!glInterface) {
125 return ContextInfo(); 125 return ContextInfo();
126 } 126 }
127 } 127 }
128 128
129 glCtx->makeCurrent(); 129 glCtx->makeCurrent();
130 GrBackendContext p3dctx = reinterpret_cast<GrBackendContext>(glInterface.get ()); 130 GrBackendContext p3dctx = reinterpret_cast<GrBackendContext>(glInterface.get ());
131 #ifdef SK_VULKAN 131 #ifdef SK_VULKAN
132 grCtx.reset(GrContext::Create(kVulkan_GrBackend, p3dctx, fGlobalOptions)); 132 if (kEnableNVPR_GLContextOptions & options) {
133 return ContextInfo();
134 } else {
135 grCtx.reset(GrContext::Create(kVulkan_GrBackend, p3dctx, fGlobalOptions) );
136 }
133 #else 137 #else
134 grCtx.reset(GrContext::Create(kOpenGL_GrBackend, p3dctx, fGlobalOptions)); 138 grCtx.reset(GrContext::Create(kOpenGL_GrBackend, p3dctx, fGlobalOptions));
135 #endif 139 #endif
136 if (!grCtx.get()) { 140 if (!grCtx.get()) {
137 return ContextInfo(); 141 return ContextInfo();
138 } 142 }
139 if (kEnableNVPR_GLContextOptions & options) { 143 if (kEnableNVPR_GLContextOptions & options) {
140 if (!grCtx->caps()->shaderCaps()->pathRenderingSupport()) { 144 if (!grCtx->caps()->shaderCaps()->pathRenderingSupport()) {
141 return ContextInfo(); 145 return ContextInfo();
142 } 146 }
143 } 147 }
144 148
145 Context& context = fContexts.push_back(); 149 Context& context = fContexts.push_back();
146 context.fGLContext = glCtx.release(); 150 context.fGLContext = glCtx.release();
147 context.fGrContext = SkRef(grCtx.get()); 151 context.fGrContext = SkRef(grCtx.get());
148 context.fType = type; 152 context.fType = type;
149 context.fOptions = options; 153 context.fOptions = options;
150 return ContextInfo(context.fGrContext, context.fGLContext); 154 return ContextInfo(context.fGrContext, context.fGLContext);
151 } 155 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/vk/GrVkGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698