Mark when effects and programs have vertex code
Adds a 'hasVertexCode' method to GrEffect and a 'fHasVertexCode' field
to GrGLProgramDesc::KeyHeader. Also adds a GrVertexEffect class that
effects have to inherit from in order to set the 'hasVertexCode' flag
and be able to emit vertex code, and updates the existing effects to
use it as needed.
R=bsalomon@google.com
Author: cdalton@nvidia.com
Review URL: https://codereview.chromium.org/23653059
git-svn-id: http://skia.googlecode.com/svn/trunk@11537 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrAARectRenderer.cpp b/src/gpu/GrAARectRenderer.cpp
index 4856bb5..e4bf853 100644
--- a/src/gpu/GrAARectRenderer.cpp
+++ b/src/gpu/GrAARectRenderer.cpp
@@ -10,6 +10,7 @@
#include "gl/GrGLEffect.h"
#include "GrTBackendEffectFactory.h"
#include "SkColorPriv.h"
+#include "effects/GrVertexEffect.h"
SK_DEFINE_INST_COUNT(GrAARectRenderer)
@@ -17,7 +18,7 @@
class GrGLAlignedRectEffect;
// Axis Aligned special case
-class GrAlignedRectEffect : public GrEffect {
+class GrAlignedRectEffect : public GrVertexEffect {
public:
static GrEffectRef* Create() {
GR_CREATE_STATIC_EFFECT(gAlignedRectEffect, GrAlignedRectEffect, ());
@@ -101,7 +102,7 @@
private:
- GrAlignedRectEffect() : GrEffect() {
+ GrAlignedRectEffect() : GrVertexEffect() {
this->addVertexAttrib(kVec4f_GrSLType);
}
@@ -109,7 +110,7 @@
GR_DECLARE_EFFECT_TEST;
- typedef GrEffect INHERITED;
+ typedef GrVertexEffect INHERITED;
};
@@ -137,7 +138,7 @@
* The munged width and height are stored in a vec2 varying ("WidthHeight")
* with the width in x and the height in y.
*/
-class GrRectEffect : public GrEffect {
+class GrRectEffect : public GrVertexEffect {
public:
static GrEffectRef* Create() {
GR_CREATE_STATIC_EFFECT(gRectEffect, GrRectEffect, ());
@@ -236,7 +237,7 @@
private:
- GrRectEffect() : GrEffect() {
+ GrRectEffect() : GrVertexEffect() {
this->addVertexAttrib(kVec4f_GrSLType);
this->addVertexAttrib(kVec2f_GrSLType);
this->setWillReadFragmentPosition();
@@ -246,7 +247,7 @@
GR_DECLARE_EFFECT_TEST;
- typedef GrEffect INHERITED;
+ typedef GrVertexEffect INHERITED;
};