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

Unified Diff: include/gpu/GrEffect.h

Issue 12462008: Add GrEllipseEdgeEffect (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: rebase again Created 7 years, 9 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/GrBackendEffectFactory.h ('k') | include/gpu/GrEffectStage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrEffect.h
===================================================================
--- include/gpu/GrEffect.h (revision 8091)
+++ include/gpu/GrEffect.h (working copy)
@@ -14,6 +14,7 @@
#include "GrRefCnt.h"
#include "GrTexture.h"
#include "GrTextureAccess.h"
+#include "GrTypesPriv.h"
class GrBackendEffectFactory;
class GrContext;
@@ -136,6 +137,14 @@
/** Shortcut for textureAccess(index).texture(); */
GrTexture* texture(int index) const { return this->textureAccess(index).getTexture(); }
+
+ int numVertexAttribs() const { return fVertexAttribTypes.count(); }
+
+ GrSLType vertexAttribType(int index) const { return fVertexAttribTypes[index]; }
+
+ static const int kMaxVertexAttribs = 2;
+
+
/** 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 +177,19 @@
protected:
/**
- * Subclasses call this from their constructor to register GrTextureAcceses. 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.
+ * 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 immutable.
*/
void addTextureAccess(const GrTextureAccess* textureAccess);
+ /**
+ * Subclasses call this from their constructor to register vertex attributes (at most
+ * kMaxVertexAttribs). This must only be called from the constructor because GrEffects are
+ * immutable.
+ */
+ void addVertexAttrib(GrSLType type);
+
GrEffect() : fEffectRef(NULL) {};
/** This should be called by GrEffect subclass factories. See the comment on AutoEffectUnref for
@@ -246,8 +262,9 @@
// from deferred state, to call isEqual on naked GrEffects, and
// to inc/dec deferred ref counts.
- SkSTArray<4, const GrTextureAccess*, true> fTextureAccesses;
- GrEffectRef* fEffectRef;
+ SkSTArray<4, const GrTextureAccess*, true> fTextureAccesses;
+ SkSTArray<kMaxVertexAttribs, GrSLType, true> fVertexAttribTypes;
+ GrEffectRef* fEffectRef;
typedef GrRefCnt INHERITED;
};
« no previous file with comments | « include/gpu/GrBackendEffectFactory.h ('k') | include/gpu/GrEffectStage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698