aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu/GrEffect.h
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2014-09-15 11:41:13 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-15 11:41:14 -0700
commit249af15fb82833d2274850c589812b6e69df0033 (patch)
treeee8ef724d051c484f8b41a5e28a3256a9cfc438c /include/gpu/GrEffect.h
parentc90e0149ec530075cae7bf51072a16628311855e (diff)
BUG=skia:
R=bsalomon@google.com, egdaniel@google.com, jvanverth@google.com, robertphillips@google.com Author: joshualitt@chromium.org Review URL: https://codereview.chromium.org/543623004
Diffstat (limited to 'include/gpu/GrEffect.h')
-rw-r--r--include/gpu/GrEffect.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/include/gpu/GrEffect.h b/include/gpu/GrEffect.h
index b7a6d17af9..102b9d4b96 100644
--- a/include/gpu/GrEffect.h
+++ b/include/gpu/GrEffect.h
@@ -11,14 +11,15 @@
#include "GrColor.h"
#include "GrEffectUnitTest.h"
#include "GrProgramElement.h"
+#include "GrShaderVar.h"
#include "GrTextureAccess.h"
#include "GrTypesPriv.h"
+#include "SkString.h"
class GrBackendEffectFactory;
class GrContext;
class GrCoordTransform;
-
/** Provides custom vertex shader, fragment shader, uniform data for a particular stage of the
Ganesh shading pipeline.
Subclasses must have a function that produces a human-readable name:
@@ -114,14 +115,10 @@ public:
(To set this value the effect must inherit from GrEffect.) */
bool requiresVertexShader() const { return fRequiresVertexShader; }
- int numVertexAttribs() const {
- SkASSERT(0 == fVertexAttribTypes.count() || fRequiresVertexShader);
- return fVertexAttribTypes.count();
- }
-
- GrSLType vertexAttribType(int index) const { return fVertexAttribTypes[index]; }
-
static const int kMaxVertexAttribs = 2;
+ typedef SkSTArray<kMaxVertexAttribs, GrShaderVar, true> VertexAttribArray;
+
+ const VertexAttribArray& getVertexAttribs() const { return fVertexAttribs; }
void* operator new(size_t size);
void operator delete(void* target);
@@ -193,11 +190,11 @@ private:
getFactory()).*/
virtual bool onIsEqual(const GrEffect& other) const = 0;
- friend class GrVertexEffect; // to set fRequiresVertexShader and build fVertexAttribTypes.
+ friend class GrGeometryProcessor; // to set fRequiresVertexShader and build fVertexAttribTypes.
SkSTArray<4, const GrCoordTransform*, true> fCoordTransforms;
SkSTArray<4, const GrTextureAccess*, true> fTextureAccesses;
- SkSTArray<kMaxVertexAttribs, GrSLType, true> fVertexAttribTypes;
+ VertexAttribArray fVertexAttribs;
bool fWillReadDstColor;
bool fWillReadFragmentPosition;
bool fWillUseInputColor;