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

Unified Diff: src/gpu/GrContextFactory.cpp

Issue 1219663005: Revert of Cleanup legacy NVPR-related definitions (Closed) Base URL: https://skia.googlesource.com/skia.git@chromium-pathrendering-prepare-02
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/gl/GrGLInterface.h ('k') | src/gpu/gl/GrGLAssembleInterface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « include/gpu/gl/GrGLInterface.h ('k') | src/gpu/gl/GrGLAssembleInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698