| 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 | 10 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 glCtx->makeCurrent(); | 77 glCtx->makeCurrent(); |
| 78 GrBackendContext p3dctx = reinterpret_cast<GrBackendContext>(glInterface.get
()); | 78 GrBackendContext p3dctx = reinterpret_cast<GrBackendContext>(glInterface.get
()); |
| 79 grCtx.reset(GrContext::Create(kOpenGL_GrBackend, p3dctx, fGlobalOptions)); | 79 grCtx.reset(GrContext::Create(kOpenGL_GrBackend, p3dctx, fGlobalOptions)); |
| 80 if (!grCtx.get()) { | 80 if (!grCtx.get()) { |
| 81 return NULL; | 81 return NULL; |
| 82 } | 82 } |
| 83 // Warn if path rendering support is not available for the NVPR type. | 83 // Warn if path rendering support is not available for the NVPR type. |
| 84 if (kNVPR_GLContextType == type) { | 84 if (kNVPR_GLContextType == type) { |
| 85 if (!grCtx->caps()->shaderCaps()->pathRenderingSupport()) { | 85 if (!grCtx->caps()->shaderCaps()->pathRenderingSupport()) { |
| 86 GrGLGpu* gpu = static_cast<GrGLGpu*>(grCtx->getGpu()); | 86 GrGpu* gpu = grCtx->getGpu(); |
| 87 const GrGLubyte* verUByte; | 87 const GrGLContext* ctx = gpu->glContextForTesting(); |
| 88 GR_GL_CALL_RET(gpu->glInterface(), verUByte, GetString(GR_GL_VERSION
)); | 88 if (ctx) { |
| 89 const char* ver = reinterpret_cast<const char*>(verUByte); | 89 const GrGLubyte* verUByte; |
| 90 SkDebugf("\nWARNING: nvprmsaa config requested, but driver path rend
ering support not" | 90 GR_GL_CALL_RET(ctx->interface(), verUByte, GetString(GR_GL_VERSI
ON)); |
| 91 " available. Maybe update the driver? Your driver version s
tring: \"%s\"\n", ver); | 91 const char* ver = reinterpret_cast<const char*>(verUByte); |
| 92 SkDebugf("\nWARNING: nvprmsaa config requested, but driver path
rendering " |
| 93 "support not available. Maybe update the driver? Your d
river version " |
| 94 "string: \"%s\"\n", ver); |
| 95 } else { |
| 96 SkDebugf("\nWARNING: nvprmsaa config requested, but driver path
rendering " |
| 97 "support not available.\n"); |
| 98 } |
| 92 } | 99 } |
| 93 } | 100 } |
| 94 | 101 |
| 95 GPUContext& ctx = fContexts.push_back(); | 102 GPUContext& ctx = fContexts.push_back(); |
| 96 ctx.fGLContext = glCtx.get(); | 103 ctx.fGLContext = glCtx.get(); |
| 97 ctx.fGLContext->ref(); | 104 ctx.fGLContext->ref(); |
| 98 ctx.fGrContext = grCtx.get(); | 105 ctx.fGrContext = grCtx.get(); |
| 99 ctx.fGrContext->ref(); | 106 ctx.fGrContext->ref(); |
| 100 ctx.fType = type; | 107 ctx.fType = type; |
| 101 return ctx.fGrContext; | 108 return ctx.fGrContext; |
| 102 } | 109 } |
| OLD | NEW |