diff options
Diffstat (limited to 'src/gpu/GrContextFactory.cpp')
-rwxr-xr-x | src/gpu/GrContextFactory.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/gpu/GrContextFactory.cpp b/src/gpu/GrContextFactory.cpp index f62c6fe1d6..7df19177eb 100755 --- a/src/gpu/GrContextFactory.cpp +++ b/src/gpu/GrContextFactory.cpp @@ -17,7 +17,7 @@ #endif #include "gl/SkGLContext.h" #include "gl/SkNullGLContext.h" -#include "GrCaps.h" + GrContext* GrContextFactory::get(GLContextType type, GrGLStandard forcedGpuAPI) { for (int i = 0; i < fContexts.count(); ++i) { @@ -60,9 +60,13 @@ GrContext* GrContextFactory::get(GLContextType type, GrGLStandard forcedGpuAPI) SkASSERT(glCtx->isValid()); - // Block NVPR from non-NVPR types. + // Ensure NVPR is available for the NVPR type and block it from other types. SkAutoTUnref<const GrGLInterface> glInterface(SkRef(glCtx->gl())); - if (kNVPR_GLContextType != type) { + if (kNVPR_GLContextType == type) { + if (!glInterface->hasExtension("GL_NV_path_rendering")) { + return NULL; + } + } else { glInterface.reset(GrGLInterfaceRemoveNVPR(glInterface)); if (!glInterface) { return NULL; @@ -75,13 +79,6 @@ GrContext* GrContextFactory::get(GLContextType type, GrGLStandard forcedGpuAPI) if (!grCtx.get()) { return NULL; } - // Ensure path rendering support is available for the NVPR type - if (kNVPR_GLContextType == type) { - if (!grCtx->caps()->shaderCaps()->pathRenderingSupport()) { - return NULL; - } - } - GPUContext& ctx = fContexts.push_back(); ctx.fGLContext = glCtx.get(); ctx.fGLContext->ref(); |