aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar kkinnunen <kkinnunen@nvidia.com>2014-08-25 22:21:16 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-25 22:21:16 -0700
commitec56e4545477e30d4f165ca55ed99f90525c6c38 (patch)
tree78564548fe8d235934e217d95e6eb021644ba673 /include
parentbc818f513be494fb3ab0c211892c7dc4cfb6a3d7 (diff)
Implement NV_path_rendering on OpenGL ES
Implement support for NV_path_rendering on OpenGL ES. Use glProgramPathFragmentInputGenNV function call instead of glPathTexGenNV to communicate transforms to fragment shader. The intention is that the NVPR paths will be drawn with the same shader program as non-NVPR geometry. For NVPR calls, the GPU will skip the vertex shader and just run the fragment shader. After program is linked, query the locations of the fragment shader inputs with glGetResourceLocation. The location will be used to set the transforms with glProgramPathFragmentInputGenNV. The functions and their workings are documented in: glProgramPathFragmentInputGenNV https://www.opengl.org/registry/specs/NV/path_rendering.txt (note: addition as of API version 1.3) glGetResourceLocation https://www.opengl.org/registry/specs/ARB/program_interface_query.txt http://www.opengl.org/registry/doc/glspec44.core.pdf (function is in core Open GL 4.4) Note: glProgramPathFragmentInputGenNV could be used also for OpenGL. However, using seems to trigger a bug in the driver. Disable this feature on OpenGL at least until the driver is fixed and released. The bug manifests in shadertext test, where the lower-left text pair is missing. Valgrind catches a bad read for the test and causes the context to OOM reproducibly. R=bsalomon@google.com, cdalton@nvidia.com, joshualitt@google.com, joshualitt@chromium.org Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/367643004
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrEffect.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/gpu/GrEffect.h b/include/gpu/GrEffect.h
index 4734c7c377..09d716f80a 100644
--- a/include/gpu/GrEffect.h
+++ b/include/gpu/GrEffect.h
@@ -114,10 +114,10 @@ public:
/** Will this effect emit custom vertex shader code?
(To set this value the effect must inherit from GrEffect.) */
- bool hasVertexCode() const { return fHasVertexCode; }
+ bool requiresVertexShader() const { return fRequiresVertexShader; }
int numVertexAttribs() const {
- SkASSERT(0 == fVertexAttribTypes.count() || fHasVertexCode);
+ SkASSERT(0 == fVertexAttribTypes.count() || fRequiresVertexShader);
return fVertexAttribTypes.count();
}
@@ -166,7 +166,7 @@ protected:
: fWillReadDstColor(false)
, fWillReadFragmentPosition(false)
, fWillUseInputColor(true)
- , fHasVertexCode(false) {}
+ , fRequiresVertexShader(false) {}
/**
* Helper for down-casting to a GrEffect subclass
@@ -204,7 +204,7 @@ private:
getFactory()).*/
virtual bool onIsEqual(const GrEffect& other) const = 0;
- friend class GrVertexEffect; // to set fHasVertexCode and build fVertexAttribTypes.
+ friend class GrVertexEffect; // to set fRequiresVertexShader and build fVertexAttribTypes.
SkSTArray<4, const GrCoordTransform*, true> fCoordTransforms;
SkSTArray<4, const GrTextureAccess*, true> fTextureAccesses;
@@ -212,7 +212,7 @@ private:
bool fWillReadDstColor;
bool fWillReadFragmentPosition;
bool fWillUseInputColor;
- bool fHasVertexCode;
+ bool fRequiresVertexShader;
typedef SkRefCnt INHERITED;
};