| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #include "GrContextFactory.h" | 8 #include "GrContextFactory.h" |
| 9 | 9 |
| 10 #if SK_ANGLE | 10 #if SK_ANGLE |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 grCtx.reset(GrContext::Create(kOpenGL_GrBackend, p3dctx, fGlobalOptions)); | 141 grCtx.reset(GrContext::Create(kOpenGL_GrBackend, p3dctx, fGlobalOptions)); |
| 142 #endif | 142 #endif |
| 143 if (!grCtx.get()) { | 143 if (!grCtx.get()) { |
| 144 return ContextInfo(); | 144 return ContextInfo(); |
| 145 } | 145 } |
| 146 if (kEnableNVPR_GLContextOptions & options) { | 146 if (kEnableNVPR_GLContextOptions & options) { |
| 147 if (!grCtx->caps()->shaderCaps()->pathRenderingSupport()) { | 147 if (!grCtx->caps()->shaderCaps()->pathRenderingSupport()) { |
| 148 return ContextInfo(); | 148 return ContextInfo(); |
| 149 } | 149 } |
| 150 } | 150 } |
| 151 if (kRequireSRGBSupport_GLContextOptions & options) { |
| 152 if (!grCtx->caps()->srgbSupport()) { |
| 153 return ContextInfo(); |
| 154 } |
| 155 } |
| 151 | 156 |
| 152 Context& context = fContexts.push_back(); | 157 Context& context = fContexts.push_back(); |
| 153 context.fGLContext = glCtx.release(); | 158 context.fGLContext = glCtx.release(); |
| 154 context.fGrContext = SkRef(grCtx.get()); | 159 context.fGrContext = SkRef(grCtx.get()); |
| 155 context.fType = type; | 160 context.fType = type; |
| 156 context.fOptions = options; | 161 context.fOptions = options; |
| 157 return ContextInfo(context.fGrContext, context.fGLContext); | 162 return ContextInfo(context.fGrContext, context.fGLContext); |
| 158 } | 163 } |
| OLD | NEW |