GrGLProgramStage Renaming Part 3

s/GLProgramStage/GLEffect
minor whitespace/spelling fixup

R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6767054

git-svn-id: http://skia.googlecode.com/svn/trunk@6095 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bsalomon@google.com 2012-10-25 14:11:03 +00:00
Родитель 2ad1d6189f
Коммит 422e81aeb1
20 изменённых файлов: 34 добавлений и 35 удалений

Просмотреть файл

@ -42,12 +42,11 @@ public:
effect guaranteed to produce an opaque output? */
virtual bool isOpaque(bool inputTextureIsOpaque) const;
/** This object, besides creating back-end-specific helper
objects, is used for run-time-type-identification. The factory should be
an instance of templated class, GrTProgramStageFactory. It is templated
on the subclass of GrEffect. The subclass must have a nested type
(or typedef) named GLProgramStage which will be the subclass of
GrGLEffect created by the factory.
/** This object, besides creating back-end-specific helper objects, is used for run-time-type-
identification. The factory should be an instance of templated class,
GrTProgramStageFactory. It is templated on the subclass of GrEffect. The subclass must have
a nested type (or typedef) named GLEffect which will be the subclass of GrGLEffect created
by the factory.
Example:
class MyCustomEffect : public GrEffect {
@ -73,7 +72,7 @@ public:
The default implementation of this function returns true iff
the two stages have the same return value for numTextures() and
for texture() over all valid indicse.
for texture() over all valid indices.
*/
virtual bool isEqual(const GrEffect&) const;

Просмотреть файл

@ -69,7 +69,7 @@ template <typename EffectClass>
class GrTProgramStageFactory : public GrProgramStageFactory {
public:
typedef typename EffectClass::GLProgramStage GLProgramStage;
typedef typename EffectClass::GLEffect GLEffect;
/** Returns a human-readable name that is accessible via GrEffect or
GrGLEffect and is consistent between the two of them.
@ -83,8 +83,8 @@ public:
GLSL code generation. */
virtual StageKey glStageKey(const GrEffect& effect, const GrGLCaps& caps) const SK_OVERRIDE {
GrAssert(kIllegalEffectClassID != fEffectClassID);
StageKey stageID = GLProgramStage::GenKey(effect, caps);
StageKey textureKey = GLProgramStage::GenTextureKey(effect, caps);
StageKey stageID = GLEffect::GenKey(effect, caps);
StageKey textureKey = GLEffect::GenTextureKey(effect, caps);
#if GR_DEBUG
static const StageKey kIllegalIDMask = (uint16_t) (~((1U << kProgramStageKeyBits) - 1));
GrAssert(!(kIllegalIDMask & stageID));
@ -99,8 +99,8 @@ public:
/** Returns a new instance of the appropriate *GL* implementation class
for the given GrEffect; caller is responsible for deleting
the object. */
virtual GLProgramStage* createGLInstance(const GrEffect& effect) const SK_OVERRIDE {
return SkNEW_ARGS(GLProgramStage, (*this, effect));
virtual GLEffect* createGLInstance(const GrEffect& effect) const SK_OVERRIDE {
return SkNEW_ARGS(GLEffect, (*this, effect));
}
/** This class is a singleton. This function returns the single instance.

Просмотреть файл

@ -142,7 +142,7 @@ public:
const GrProgramStageFactory& getFactory() const;
SkBlendImageFilter::Mode mode() const { return fMode; }
typedef GrGLBlendEffect GLProgramStage;
typedef GrGLBlendEffect GLEffect;
static const char* Name() { return "Blend"; }
private:

Просмотреть файл

@ -339,13 +339,13 @@ public:
GR_DECLARE_EFFECT_TEST;
class GLProgramStage : public GrGLLegacyEffect {
class GLEffect : public GrGLLegacyEffect {
public:
// this class always generates the same code.
static StageKey GenKey(const GrEffect& s, const GrGLCaps&) { return 0; }
GLProgramStage(const GrProgramStageFactory& factory,
const GrEffect& effect)
GLEffect(const GrProgramStageFactory& factory,
const GrEffect& effect)
: INHERITED(factory)
, fMatrixHandle(GrGLUniformManager::kInvalidUniformHandle)
, fVectorHandle(GrGLUniformManager::kInvalidUniformHandle) {

Просмотреть файл

@ -326,7 +326,7 @@ public:
static const char* Name() { return "DiffuseLighting"; }
typedef GrGLDiffuseLightingEffect GLProgramStage;
typedef GrGLDiffuseLightingEffect GLEffect;
virtual const GrProgramStageFactory& getFactory() const SK_OVERRIDE;
virtual bool isEqual(const GrEffect&) const SK_OVERRIDE;
@ -347,7 +347,7 @@ public:
static const char* Name() { return "SpecularLighting"; }
typedef GrGLSpecularLightingEffect GLProgramStage;
typedef GrGLSpecularLightingEffect GLEffect;
virtual const GrProgramStageFactory& getFactory() const SK_OVERRIDE;
virtual bool isEqual(const GrEffect&) const SK_OVERRIDE;

Просмотреть файл

@ -54,7 +54,7 @@ public:
float x_inset() const { return fXInset; }
float y_inset() const { return fYInset; }
typedef GrGLMagnifierEffect GLProgramStage;
typedef GrGLMagnifierEffect GLEffect;
private:
GR_DECLARE_EFFECT_TEST;

Просмотреть файл

@ -260,7 +260,7 @@ public:
TileMode tileMode() const { return fTileMode; }
bool convolveAlpha() const { return fConvolveAlpha; }
typedef GrGLMatrixConvolutionEffect GLProgramStage;
typedef GrGLMatrixConvolutionEffect GLEffect;
virtual const GrProgramStageFactory& getFactory() const SK_OVERRIDE;
virtual bool isEqual(const GrEffect&) const SK_OVERRIDE;

Просмотреть файл

@ -249,7 +249,7 @@ public:
static const char* Name() { return "Morphology"; }
typedef GrGLMorphologyEffect GLProgramStage;
typedef GrGLMorphologyEffect GLEffect;
virtual const GrProgramStageFactory& getFactory() const SK_OVERRIDE;
virtual bool isEqual(const GrEffect&) const SK_OVERRIDE;

Просмотреть файл

@ -234,7 +234,7 @@ public:
virtual const GrTextureAccess& textureAccess(int index) const SK_OVERRIDE;
typedef GLColorTableEffect GLProgramStage;
typedef GLColorTableEffect GLEffect;
private:
GR_DECLARE_EFFECT_TEST;

Просмотреть файл

@ -512,7 +512,7 @@ public:
return GrTProgramStageFactory<GrLinearGradient>::getInstance();
}
typedef GrGLLinearGradient GLProgramStage;
typedef GrGLLinearGradient GLEffect;
private:
GR_DECLARE_EFFECT_TEST;

Просмотреть файл

@ -511,7 +511,7 @@ public:
return GrTProgramStageFactory<GrRadialGradient>::getInstance();
}
typedef GrGLRadialGradient GLProgramStage;
typedef GrGLRadialGradient GLEffect;
private:
GR_DECLARE_EFFECT_TEST;

Просмотреть файл

@ -419,7 +419,7 @@ public:
return GrTProgramStageFactory<GrSweepGradient>::getInstance();
}
typedef GrGLSweepGradient GLProgramStage;
typedef GrGLSweepGradient GLEffect;
private:
GR_DECLARE_EFFECT_TEST;

Просмотреть файл

@ -395,7 +395,7 @@ public:
GrScalar diffRadius() const { return fDiffRadius; }
GrScalar radius() const { return fRadius0; }
typedef GrGLConical2Gradient GLProgramStage;
typedef GrGLConical2Gradient GLEffect;
private:
GR_DECLARE_EFFECT_TEST;

Просмотреть файл

@ -427,7 +427,7 @@ public:
GrScalar radius() const { return fRadius0; }
bool isPosRoot() const { return SkToBool(fPosRoot); }
typedef GrGLRadial2Gradient GLProgramStage;
typedef GrGLRadial2Gradient GLEffect;
private:
GR_DECLARE_EFFECT_TEST;

Просмотреть файл

@ -39,7 +39,7 @@ public:
PMConversion pmConversion = kNone_PMConversion);
static const char* Name() { return "Config Conversion"; }
typedef GrGLConfigConversionEffect GLProgramStage;
typedef GrGLConfigConversionEffect GLEffect;
virtual const GrProgramStageFactory& getFactory() const SK_OVERRIDE;
virtual bool isEqual(const GrEffect&) const SK_OVERRIDE;

Просмотреть файл

@ -34,7 +34,7 @@ public:
static const char* Name() { return "Convolution"; }
typedef GrGLConvolutionEffect GLProgramStage;
typedef GrGLConvolutionEffect GLEffect;
virtual const GrProgramStageFactory& getFactory() const SK_OVERRIDE;
virtual bool isEqual(const GrEffect&) const SK_OVERRIDE;

Просмотреть файл

@ -32,7 +32,7 @@ public:
static const char* Name() { return "Single Texture"; }
typedef GrGLSingleTextureEffect GLProgramStage;
typedef GrGLSingleTextureEffect GLEffect;
virtual const GrProgramStageFactory& getFactory() const SK_OVERRIDE;

Просмотреть файл

@ -28,7 +28,7 @@ public:
static const char* Name() { return "TextureDomain"; }
typedef GrGLTextureDomainEffect GLProgramStage;
typedef GrGLTextureDomainEffect GLEffect;
virtual const GrProgramStageFactory& getFactory() const SK_OVERRIDE;
virtual bool isEqual(const GrEffect&) const SK_OVERRIDE;

Просмотреть файл

@ -5,8 +5,8 @@
* found in the LICENSE file.
*/
#ifndef GrGLProgramStage_DEFINED
#define GrGLProgramStage_DEFINED
#ifndef GrGLEffect_DEFINED
#define GrGLEffect_DEFINED
#include "GrAllocator.h"
#include "GrEffect.h"
@ -25,7 +25,7 @@ class GrGLTexture;
must have a function:
static inline StageKey GenKey(const GrEffect&, const GrGLCaps&)
that is used to implement a program cache. When two GrEffects produce the same key this means
that their GrGLProgramStages would emit the same GLSL code.
that their GrGLEffects would emit the same GLSL code.
These objects are created by the factory object returned by the GrEffect::getFactory().
*/

Просмотреть файл

@ -23,7 +23,7 @@ class GrGLContextInfo;
class GrGLShaderBuilder {
public:
/**
* Used by GrGLProgramStages to add texture reads to their shader code.
* Used by GrGLEffects to add texture reads to their shader code.
*/
class TextureSampler {
public: