CustomStage Renaming Part 1
Search and replace:
GrCustomStage->GrEffect
GrCustomStageTestFactory->GrEffectTestFactory
renamed the cpp/h files from customStage->effect
reordered gypi, #includes, forward decls to maintain alphabetical sort.
manually fixed up some whitespace and linewraps
deleted a commented out #include
R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6758046
git-svn-id: http://skia.googlecode.com/svn/trunk@6076 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index d5ccdac..847b6ef 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -8,7 +8,7 @@
#include "GrGLProgram.h"
#include "GrAllocator.h"
-#include "GrCustomStage.h"
+#include "GrEffect.h"
#include "GrGLProgramStage.h"
#include "gl/GrGLShaderBuilder.h"
#include "GrGLShaderVar.h"
@@ -53,7 +53,7 @@
GrGLProgram* GrGLProgram::Create(const GrGLContextInfo& gl,
const Desc& desc,
- const GrCustomStage** customStages) {
+ const GrEffect** customStages) {
GrGLProgram* program = SkNEW_ARGS(GrGLProgram, (gl, desc, customStages));
if (!program->succeeded()) {
delete program;
@@ -64,7 +64,7 @@
GrGLProgram::GrGLProgram(const GrGLContextInfo& gl,
const Desc& desc,
- const GrCustomStage** customStages)
+ const GrEffect** customStages)
: fContextInfo(gl)
, fUniformManager(gl) {
fDesc = desc;
@@ -500,7 +500,7 @@
return true;
}
-bool GrGLProgram::genProgram(const GrCustomStage** customStages) {
+bool GrGLProgram::genProgram(const GrEffect** customStages) {
GrAssert(0 == fProgramID);
GrGLShaderBuilder builder(fContextInfo, fUniformManager);
@@ -896,7 +896,7 @@
// Stage code generation
// TODO: Move this function to GrGLShaderBuilder
-GrGLProgramStage* GrGLProgram::GenStageCode(const GrCustomStage* stage,
+GrGLProgramStage* GrGLProgram::GenStageCode(const GrEffect* stage,
const StageDesc& desc,
StageUniforms* uniforms,
const char* fsInColor, // NULL means no incoming color
diff --git a/src/gpu/gl/GrGLProgram.h b/src/gpu/gl/GrGLProgram.h
index 2500417..c9afc2b 100644
--- a/src/gpu/gl/GrGLProgram.h
+++ b/src/gpu/gl/GrGLProgram.h
@@ -43,7 +43,7 @@
static GrGLProgram* Create(const GrGLContextInfo& gl,
const Desc& desc,
- const GrCustomStage** customStages);
+ const GrEffect** customStages);
virtual ~GrGLProgram();
@@ -67,8 +67,8 @@
static int TexCoordAttributeIdx(int tcIdx) { return 4 + tcIdx; }
/**
- * This function uploads uniforms and calls each GrCustomStage's setData. It is called before a
- * draw occurs using the program after the program has already been bound.
+ * This function uploads uniforms and calls each GrEffect's setData. It is called before a draw
+ * occurs using the program after the program has already been bound.
*/
void setData(const GrDrawState& drawState);
@@ -164,18 +164,18 @@
GrGLProgram(const GrGLContextInfo& gl,
const Desc& desc,
- const GrCustomStage** customStages);
+ const GrEffect** customStages);
bool succeeded() const { return 0 != fProgramID; }
/**
* This is the heavy initialization routine for building a GLProgram.
*/
- bool genProgram(const GrCustomStage** customStages);
+ bool genProgram(const GrEffect** customStages);
void genInputColor(GrGLShaderBuilder* builder, SkString* inColor);
- static GrGLProgramStage* GenStageCode(const GrCustomStage* stage,
+ static GrGLProgramStage* GenStageCode(const GrEffect* stage,
const StageDesc& desc, // TODO: Eliminate this
StageUniforms* stageUniforms, // TODO: Eliminate this
const char* fsInColor, // NULL means no incoming color
diff --git a/src/gpu/gl/GrGLProgramStage.cpp b/src/gpu/gl/GrGLProgramStage.cpp
index 4702f37..8cbb7c3 100644
--- a/src/gpu/gl/GrGLProgramStage.cpp
+++ b/src/gpu/gl/GrGLProgramStage.cpp
@@ -17,10 +17,10 @@
///////////////////////////////////////////////////////////////////////////////
-void GrGLProgramStage::setData(const GrGLUniformManager&, const GrCustomStage&) {
+void GrGLProgramStage::setData(const GrGLUniformManager&, const GrEffect&) {
}
-GrGLProgramStage::StageKey GrGLProgramStage::GenTextureKey(const GrCustomStage& stage,
+GrGLProgramStage::StageKey GrGLProgramStage::GenTextureKey(const GrEffect& stage,
const GrGLCaps& caps) {
StageKey key = 0;
for (int index = 0; index < stage.numTextures(); ++index) {
diff --git a/src/gpu/gl/GrGLProgramStage.h b/src/gpu/gl/GrGLProgramStage.h
index fce82d2..3f8afe4 100644
--- a/src/gpu/gl/GrGLProgramStage.h
+++ b/src/gpu/gl/GrGLProgramStage.h
@@ -9,7 +9,7 @@
#define GrGLCustomStage_DEFINED
#include "GrAllocator.h"
-#include "GrCustomStage.h"
+#include "GrEffect.h"
#include "GrGLProgram.h"
#include "GrGLShaderBuilder.h"
#include "GrGLShaderVar.h"
@@ -20,20 +20,20 @@
/** @file
This file contains specializations for OpenGL of the shader stages declared in
- include/gpu/GrCustomStage.h. Objects of type GrGLProgramStage are responsible for emitting the
- GLSL code that implements a GrCustomStage and for uploading uniforms at draw time. They also
+ include/gpu/GrEffect.h. Objects of type GrGLProgramStage are responsible for emitting the
+ GLSL code that implements a GrEffect and for uploading uniforms at draw time. They also
must have a function:
- static inline StageKey GenKey(const GrCustomStage&, const GrGLCaps&)
- that is used to implement a program cache. When two GrCustomStages produce the same key this
+ static inline StageKey GenKey(const GrEffect&, const GrGLCaps&)
+ that is used to implement a program cache. When two GrCustomEffects produce the same key this
means that their GrGLProgramStages would emit the same GLSL code.
- These objects are created by the factory object returned by the GrCustomStage::getFactory().
+ These objects are created by the factory object returned by the GrEffect::getFactory().
*/
class GrGLProgramStage {
public:
- typedef GrCustomStage::StageKey StageKey;
+ typedef GrEffect::StageKey StageKey;
enum {
// the number of bits in StageKey available to GenKey
kProgramStageKeyBits = GrProgramStageFactory::kProgramStageKeyBits,
@@ -51,8 +51,7 @@
@param builder Interface used to emit code in the shaders.
@param stage The custom stage that generated this program stage.
- @param key The key that was computed by StageKey() from the generating
- GrCustomStage.
+ @param key The key that was computed by StageKey() from the generating GrEffect.
@param vertexCoords A vec2 of texture coordinates in the VS, which may be altered. This will
be removed soon and stages will be responsible for computing their own
coords.
@@ -64,26 +63,26 @@
color is solid white, trans black, known to be opaque, etc.) that allows
the custom stage to communicate back similar known info about its
output.
- @param samplers One entry for each GrTextureAccess of the GrCustomStage that generated
- the GrGLProgramStage. These can be passed to the builder to emit texture
+ @param samplers One entry for each GrTextureAccess of the GrEffect that generated the
+ GrGLProgramStage. These can be passed to the builder to emit texture
reads in the generated code.
*/
virtual void emitCode(GrGLShaderBuilder* builder,
- const GrCustomStage& stage,
+ const GrEffect& stage,
StageKey key,
const char* vertexCoords,
const char* outputColor,
const char* inputColor,
const TextureSamplerArray& samplers) = 0;
- /** A GrGLProgramStage instance can be reused with any GrCustomStage that produces the same
- stage key; this function reads data from a stage and uploads any uniform variables required
+ /** A GrGLProgramStage instance can be reused with any GrEffect that produces the same stage
+ key; this function reads data from a stage and uploads any uniform variables required
by the shaders created in emitCode(). */
- virtual void setData(const GrGLUniformManager&, const GrCustomStage& stage);
+ virtual void setData(const GrGLUniformManager&, const GrEffect& stage);
const char* name() const { return fFactory.name(); }
- static StageKey GenTextureKey(const GrCustomStage&, const GrGLCaps&);
+ static StageKey GenTextureKey(const GrEffect&, const GrGLCaps&);
protected:
@@ -108,7 +107,7 @@
const TextureSamplerArray&) = 0;
virtual void emitCode(GrGLShaderBuilder* builder,
- const GrCustomStage&,
+ const GrEffect&,
StageKey,
const char* vertexCoords,
const char* outputColor,
diff --git a/src/gpu/gl/GrGLShaderBuilder.cpp b/src/gpu/gl/GrGLShaderBuilder.cpp
index 04fe63e..f11a8d9 100644
--- a/src/gpu/gl/GrGLShaderBuilder.cpp
+++ b/src/gpu/gl/GrGLShaderBuilder.cpp
@@ -153,9 +153,9 @@
GrGLSLModulate4f(out, modulation, lookup.c_str());
}
-GrCustomStage::StageKey GrGLShaderBuilder::KeyForTextureAccess(const GrTextureAccess& access,
+GrEffect::StageKey GrGLShaderBuilder::KeyForTextureAccess(const GrTextureAccess& access,
const GrGLCaps& caps) {
- GrCustomStage::StageKey key = 0;
+ GrEffect::StageKey key = 0;
// Assume that swizzle support implies that we never have to modify a shader to adjust
// for texture format/swizzle settings.
diff --git a/src/gpu/gl/GrGLShaderBuilder.h b/src/gpu/gl/GrGLShaderBuilder.h
index aa88cf2..0b5eb17 100644
--- a/src/gpu/gl/GrGLShaderBuilder.h
+++ b/src/gpu/gl/GrGLShaderBuilder.h
@@ -9,7 +9,7 @@
#define GrGLShaderBuilder_DEFINED
#include "GrAllocator.h"
-#include "GrCustomStage.h"
+#include "GrEffect.h"
#include "gl/GrGLShaderVar.h"
#include "gl/GrGLSL.h"
#include "gl/GrGLUniformManager.h"
@@ -122,7 +122,7 @@
/** Generates a StageKey for the shader code based on the texture access parameters and the
capabilities of the GL context. This is useful for keying the shader programs that may
have multiple representations, based on the type/format of textures used. */
- static GrCustomStage::StageKey KeyForTextureAccess(const GrTextureAccess& access,
+ static GrEffect::StageKey KeyForTextureAccess(const GrTextureAccess& access,
const GrGLCaps& caps);
/** If texture swizzling is available using tex parameters then it is preferred over mangling
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 4df7a98..a810d67 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -2019,7 +2019,7 @@
void GrGpuGL::flushBoundTextureAndParams(int stage) {
GrDrawState* drawState = this->drawState();
// FIXME: Assuming at most one texture per custom stage
- const GrCustomStage* customStage = drawState->sampler(stage)->getCustomStage();
+ const GrEffect* customStage = drawState->sampler(stage)->getCustomStage();
if (customStage->numTextures() > 0) {
GrGLTexture* nextTexture = static_cast<GrGLTexture*>(customStage->texture(0));
if (NULL != nextTexture) {
diff --git a/src/gpu/gl/GrGpuGL.h b/src/gpu/gl/GrGpuGL.h
index 0a0c52b..eab0a77 100644
--- a/src/gpu/gl/GrGpuGL.h
+++ b/src/gpu/gl/GrGpuGL.h
@@ -166,7 +166,7 @@
ProgramCache(const GrGLContextInfo& gl);
void abandon();
- GrGLProgram* getProgram(const GrGLProgram::Desc& desc, const GrCustomStage** stages);
+ GrGLProgram* getProgram(const GrGLProgram::Desc& desc, const GrEffect** stages);
private:
enum {
kKeySize = sizeof(ProgramDesc),
@@ -240,7 +240,7 @@
void buildProgram(bool isPoints,
BlendOptFlags blendOpts,
GrBlendCoeff dstCoeff,
- const GrCustomStage** customStages,
+ const GrEffect** customStages,
ProgramDesc* desc);
// Inits GrDrawTarget::Caps, subclass may enable additional caps.
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp
index 3439230..6608c66 100644
--- a/src/gpu/gl/GrGpuGL_program.cpp
+++ b/src/gpu/gl/GrGpuGL_program.cpp
@@ -7,7 +7,7 @@
#include "GrGpuGL.h"
-#include "GrCustomStage.h"
+#include "GrEffect.h"
#include "GrGLProgramStage.h"
#include "GrGpuVertex.h"
@@ -33,7 +33,7 @@
}
GrGLProgram* GrGpuGL::ProgramCache::getProgram(const ProgramDesc& desc,
- const GrCustomStage** stages) {
+ const GrEffect** stages) {
Entry newEntry;
newEntry.fKey.setKeyData(desc.asKey());
@@ -199,7 +199,7 @@
const GrDrawState& drawState = this->getDrawState();
// FIXME: Still assuming only a single texture per custom stage
- const GrCustomStage* stage = drawState.getSampler(s).getCustomStage();
+ const GrEffect* stage = drawState.getSampler(s).getCustomStage();
if (0 == stage->numTextures()) {
return;
}
@@ -350,7 +350,7 @@
return false;
}
- const GrCustomStage* customStages [GrDrawState::kNumStages];
+ const GrEffect* customStages [GrDrawState::kNumStages];
GrGLProgram::Desc desc;
this->buildProgram(kDrawPoints_DrawType == type, blendOpts, dstCoeff, customStages, &desc);
@@ -568,9 +568,9 @@
void setup_custom_stage(GrGLProgram::Desc::StageDesc* stage,
const GrSamplerState& sampler,
const GrGLCaps& caps,
- const GrCustomStage** customStages,
+ const GrEffect** customStages,
GrGLProgram* program, int index) {
- const GrCustomStage* customStage = sampler.getCustomStage();
+ const GrEffect* customStage = sampler.getCustomStage();
if (customStage) {
const GrProgramStageFactory& factory = customStage->getFactory();
stage->fCustomStageKey = factory.glStageKey(*customStage, caps);
@@ -586,7 +586,7 @@
void GrGpuGL::buildProgram(bool isPoints,
BlendOptFlags blendOpts,
GrBlendCoeff dstCoeff,
- const GrCustomStage** customStages,
+ const GrEffect** customStages,
ProgramDesc* desc) {
const GrDrawState& drawState = this->getDrawState();
@@ -675,7 +675,7 @@
lastEnabledStage = s;
const GrSamplerState& sampler = drawState.getSampler(s);
// FIXME: Still assuming one texture per custom stage
- const GrCustomStage* customStage = drawState.getSampler(s).getCustomStage();
+ const GrEffect* customStage = drawState.getSampler(s).getCustomStage();
if (customStage->numTextures() > 0) {
const GrGLTexture* texture =