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

Unified Diff: include/gpu/GrEffect.h

Issue 543623004: Removing vertex attrib indices (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: warning fixed Created 6 years, 3 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/GrDrawEffect.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
diff --git a/include/gpu/GrEffect.h b/include/gpu/GrEffect.h
index b7a6d17af9527ed0a11c3d5d58376a6cfdc62702..102b9d4b961ba89743c8b002426182633ad7b83f 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;
« no previous file with comments | « include/gpu/GrDrawEffect.h ('k') | include/gpu/GrEffectStage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698