aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar halcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-24 16:04:09 +0000
committerGravatar halcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-24 16:04:09 +0000
commit68c74884d0da1aa794bb660a37f31f2f9108bc36 (patch)
tree15e0fd795d0fd88b28763ae145923c883dae9571 /include
parent0ded88d431a1872e21986984f009db2e84f52738 (diff)
Revert "Turn NVPR on by default (but off in tools)."
This reverts commit 83d81c96de34950bdd84dc575997a250b685a3d6. Broke Windows build. Autorevert didn't work. TBR=bsalomon@google.com,robertphillips@google.com NOTREECHECKS=true NOTRY=true NOPRESUBMIT=true BUG=skia:2042 Review URL: https://codereview.chromium.org/146863003 git-svn-id: http://skia.googlecode.com/svn/trunk@13169 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrContextFactory.h31
-rw-r--r--include/gpu/gl/GrGLConfig.h8
-rw-r--r--include/gpu/gl/GrGLExtensions.h14
-rw-r--r--include/gpu/gl/GrGLInterface.h9
4 files changed, 15 insertions, 47 deletions
diff --git a/include/gpu/GrContextFactory.h b/include/gpu/GrContextFactory.h
index 333afd29f6..389c398c7c 100644
--- a/include/gpu/GrContextFactory.h
+++ b/include/gpu/GrContextFactory.h
@@ -26,15 +26,12 @@
* GrContexts backed by different types of GL contexts. It manages creating the
* GL context and a GrContext that uses it. The GL/Gr contexts persist until the
* factory is destroyed (though the caller can always grab a ref on the returned
- * Gr and GL contexts to make them outlive the factory).
+ * GrContext to make it outlive the factory).
*/
class GrContextFactory : public SkNoncopyable {
public:
/**
- * Types of GL contexts supported. For historical and testing reasons the native GrContext will
- * not use "GL_NV_path_rendering" even when the driver supports it. There is a separate context
- * type that does not remove NVPR support and which will fail when the driver does not support
- * the extension.
+ * Types of GL contexts supported.
*/
enum GLContextType {
kNative_GLContextType,
@@ -44,9 +41,6 @@ public:
#if SK_MESA
kMESA_GLContextType,
#endif
- /** Similar to kNative but does not filter NVPR. It will fail if the GL driver does not
- support NVPR */
- kNVPR_GLContextType,
kNull_GLContextType,
kDebug_GLContextType,
@@ -79,8 +73,6 @@ public:
case kMESA_GLContextType:
return "mesa";
#endif
- case kNVPR_GLContextType:
- return "nvpr";
case kDebug_GLContextType:
return "debug";
default:
@@ -95,7 +87,6 @@ public:
void destroyContexts() {
for (int i = 0; i < fContexts.count(); ++i) {
- fContexts[i].fGLContext->makeCurrent();
fContexts[i].fGrContext->unref();
fContexts[i].fGLContext->unref();
}
@@ -116,7 +107,6 @@ public:
SkAutoTUnref<SkGLContextHelper> glCtx;
SkAutoTUnref<GrContext> grCtx;
switch (type) {
- case kNVPR_GLContextType: // fallthru
case kNative_GLContextType:
glCtx.reset(SkNEW(SkNativeGLContext));
break;
@@ -144,22 +134,7 @@ public:
if (!glCtx.get()->init(kBogusSize, kBogusSize)) {
return NULL;
}
-
- // Ensure NVPR is available for the NVPR type and block it from other types.
- SkAutoTUnref<const GrGLInterface> glInterface(SkRef(glCtx.get()->gl()));
- if (kNVPR_GLContextType == type) {
- if (!glInterface->hasExtension("GL_NV_path_rendering")) {
- return NULL;
- }
- } else {
- glInterface.reset(GrGLInterfaceRemoveNVPR(glInterface));
- if (!glInterface) {
- return NULL;
- }
- }
-
- glCtx->makeCurrent();
- GrBackendContext p3dctx = reinterpret_cast<GrBackendContext>(glInterface.get());
+ GrBackendContext p3dctx = reinterpret_cast<GrBackendContext>(glCtx.get()->gl());
grCtx.reset(GrContext::Create(kOpenGL_GrBackend, p3dctx));
if (!grCtx.get()) {
return NULL;
diff --git a/include/gpu/gl/GrGLConfig.h b/include/gpu/gl/GrGLConfig.h
index 444be00f15..842c303f38 100644
--- a/include/gpu/gl/GrGLConfig.h
+++ b/include/gpu/gl/GrGLConfig.h
@@ -93,6 +93,10 @@
* stencil formats as attachments. If the FBO is complete we will assume
* subsequent attachments with the same formats are complete as well.
*
+ * GR_GL_USE_NV_PATH_RENDERING: Enable experimental support for
+ * GL_NV_path_rendering. There are known issues with clipping, non-AA paths, and
+ * perspective.
+ *
* GR_GL_MUST_USE_VBO: Indicates that all vertices and indices must be rendered
* from VBOs. Chromium's command buffer doesn't allow glVertexAttribArray with
* ARARY_BUFFER 0 bound or glDrawElements with ELEMENT_ARRAY_BUFFER 0 bound.
@@ -154,6 +158,10 @@
#define GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT 0
#endif
+#if !defined(GR_GL_USE_NV_PATH_RENDERING)
+ #define GR_GL_USE_NV_PATH_RENDERING 0
+#endif
+
#if !defined(GR_GL_MUST_USE_VBO)
#define GR_GL_MUST_USE_VBO 0
#endif
diff --git a/include/gpu/gl/GrGLExtensions.h b/include/gpu/gl/GrGLExtensions.h
index 76516cf11f..c9f59a2702 100644
--- a/include/gpu/gl/GrGLExtensions.h
+++ b/include/gpu/gl/GrGLExtensions.h
@@ -19,17 +19,12 @@ struct GrGLInterface;
* queried. It supports both glGetString- and glGetStringi-style extension string APIs and will
* use the latter if it is available.
*/
-class GrGLExtensions {
+class GrGLExtensions : public SkNoncopyable {
public:
GrGLExtensions() : fInitialized(false), fStrings(SkNEW(SkTArray<SkString>)) {}
- GrGLExtensions(const GrGLExtensions&);
-
- GrGLExtensions& operator=(const GrGLExtensions&);
-
void swap(GrGLExtensions* that) {
fStrings.swap(&that->fStrings);
- SkTSwap(fInitialized, that->fInitialized);
}
/**
@@ -47,12 +42,7 @@ public:
/**
* Queries whether an extension is present. This will fail if init() has not been called.
*/
- bool has(const char[]) const;
-
- /**
- * Removes an extension if present. Returns true if the extension was present before the call.
- */
- bool remove(const char[]);
+ bool has(const char*) const;
void reset() { fStrings->reset(); }
diff --git a/include/gpu/gl/GrGLInterface.h b/include/gpu/gl/GrGLInterface.h
index 317dd93c80..cd7c6bdf60 100644
--- a/include/gpu/gl/GrGLInterface.h
+++ b/include/gpu/gl/GrGLInterface.h
@@ -72,11 +72,7 @@ typedef void (*GrGLInterfaceCallbackProc)(const GrGLInterface*);
typedef intptr_t GrGLInterfaceCallbackData;
#endif
-/** Function that returns a new interface identical to "interface" but without support for
- GL_NV_path_rendering. */
-const GrGLInterface* GrGLInterfaceRemoveNVPR(const GrGLInterface* interface);
-
-/**
+/*
* GrContext uses the following interface to make all calls into OpenGL. When a
* GrContext is created it is given a GrGLInterface. The interface's function
* pointers must be valid for the OpenGL context associated with the GrContext.
@@ -116,8 +112,6 @@ public:
GrGLInterface();
- static GrGLInterface* NewClone(const GrGLInterface*);
-
// Validates that the GrGLInterface supports its advertised standard. This means the necessary
// function pointers have been initialized for both the GL version and any advertised
// extensions.
@@ -364,6 +358,7 @@ public:
GLPtr<GrGLPointAlongPathProc> fPointAlongPath;
} fFunctions;
+
// Temporary workaround aliases to keep Chromium GrGLInterface factories compiling until they
// assign the members of fFunctions.
GLPtrAlias<GrGLActiveTextureProc> fActiveTexture;