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

Unified Diff: include/gpu/GrEffect.h

Issue 12462008: Add GrEllipseEdgeEffect (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 10 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
Index: include/gpu/GrEffect.h
===================================================================
--- include/gpu/GrEffect.h (revision 7952)
+++ include/gpu/GrEffect.h (working copy)
@@ -136,6 +136,12 @@
/** Shortcut for textureAccess(index).texture(); */
GrTexture* texture(int index) const { return this->textureAccess(index).getTexture(); }
+
+ int numVertexAttribs() const { return fVertexAttribNames.count(); }
+
+ const char* vertexAttribName(int index) const { return fVertexAttribNames[index]; }
+
+
/** Useful for effects that want to insert a texture matrix that is implied by the texture
dimensions */
static inline SkMatrix MakeDivByTextureWHMatrix(const GrTexture* texture) {
@@ -168,12 +174,19 @@
protected:
/**
- * Subclasses call this from their constructor to register GrTextureAcceses. The effect subclass
+ * Subclasses call this from their constructor to register GrTextureAccesses. The effect subclass
* manages the lifetime of the accesses (this function only stores a pointer). This must only be
* called from the constructor because GrEffects are supposed to be immutable.
*/
void addTextureAccess(const GrTextureAccess* textureAccess);
robertphillips 2013/03/05 20:30:13 two over length lines here
jvanverth1 2013/03/07 15:21:54 Done.
+ /**
+ * Subclasses call this from their constructor to register names to be bound as vertex attributes.
+ * The effect subclass manages the lifetime of the name (this function only stores a pointer). This
robertphillips 2013/03/05 20:30:13 remove "supposed to be"?
jvanverth1 2013/03/07 15:21:54 Done.
+ * must only be called from the constructor because GrEffects are supposed to be immutable.
+ */
+ void addVertexAttribName(const char* attrName);
+
GrEffect() : fEffectRef(NULL) {};
/** This should be called by GrEffect subclass factories. See the comment on AutoEffectUnref for
@@ -247,6 +260,7 @@
// to inc/dec deferred ref counts.
SkSTArray<4, const GrTextureAccess*, true> fTextureAccesses;
+ SkSTArray<2, const char*, true> fVertexAttribNames;
GrEffectRef* fEffectRef;
typedef GrRefCnt INHERITED;

Powered by Google App Engine
This is Rietveld 408576698