Index: src/gpu/GrContextFactory.cpp |
diff --git a/src/gpu/GrContextFactory.cpp b/src/gpu/GrContextFactory.cpp |
index f62c6fe1d6e0daff7a80018879106d440a71685a..7df19177eba177ad5899b759e15217e07fca5c70 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 @@ |
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 @@ |
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(); |