diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-10-24 18:28:34 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-10-24 18:28:34 +0000 |
commit | a469c28c3c16214733a25201a286970f57b3d944 (patch) | |
tree | 2493bd735990ff40770ed8cfa601db0a2babe549 /include/gpu | |
parent | 96182216f187fd103392ccaa34f505fe54fcff7e (diff) |
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
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/GrContext.h | 6 | ||||
-rw-r--r-- | include/gpu/GrCustomStageUnitTest.h | 28 | ||||
-rw-r--r-- | include/gpu/GrEffect.h (renamed from include/gpu/GrCustomStage.h) | 16 | ||||
-rw-r--r-- | include/gpu/GrPaint.h | 4 | ||||
-rw-r--r-- | include/gpu/GrProgramStageFactory.h | 20 | ||||
-rw-r--r-- | include/gpu/GrSamplerState.h | 16 | ||||
-rw-r--r-- | include/gpu/GrTextureAccess.h | 6 |
7 files changed, 48 insertions, 48 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h index 4fd60266d2..9aad700eeb 100644 --- a/include/gpu/GrContext.h +++ b/include/gpu/GrContext.h @@ -23,9 +23,9 @@ class GrAutoScratchTexture; class GrCacheKey; -class GrCustomStage; class GrDrawState; class GrDrawTarget; +class GrEffect; class GrFontCache; class GrGpu; class GrIndexBuffer; @@ -920,8 +920,8 @@ private: // for use with textures released from an GrAutoScratchTexture. void addExistingTextureToCache(GrTexture* texture); - GrCustomStage* createPMToUPMEffect(GrTexture* texture, bool swapRAndB); - GrCustomStage* createUPMToPMEffect(GrTexture* texture, bool swapRAndB); + GrEffect* createPMToUPMEffect(GrTexture* texture, bool swapRAndB); + GrEffect* createUPMToPMEffect(GrTexture* texture, bool swapRAndB); typedef GrRefCnt INHERITED; }; diff --git a/include/gpu/GrCustomStageUnitTest.h b/include/gpu/GrCustomStageUnitTest.h index 0e12f2d229..427c1e6b63 100644 --- a/include/gpu/GrCustomStageUnitTest.h +++ b/include/gpu/GrCustomStageUnitTest.h @@ -22,56 +22,56 @@ enum { #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS -class GrCustomStage; class GrContext; +class GrEffect; class GrTexture; -class GrCustomStageTestFactory : GrNoncopyable { +class GrEffectTestFactory : GrNoncopyable { public: - typedef GrCustomStage* (*CreateProc)(SkRandom*, GrContext*, GrTexture* dummyTextures[]); + typedef GrEffect* (*CreateProc)(SkRandom*, GrContext*, GrTexture* dummyTextures[]); - GrCustomStageTestFactory(CreateProc createProc) { + GrEffectTestFactory(CreateProc createProc) { fCreateProc = createProc; GetFactories()->push_back(this); } - static GrCustomStage* CreateStage(SkRandom* random, + static GrEffect* CreateStage(SkRandom* random, GrContext* context, GrTexture* dummyTextures[]) { uint32_t idx = random->nextRangeU(0, GetFactories()->count() - 1); - GrCustomStageTestFactory* factory = (*GetFactories())[idx]; + GrEffectTestFactory* factory = (*GetFactories())[idx]; return factory->fCreateProc(random, context, dummyTextures); } private: CreateProc fCreateProc; - static SkTArray<GrCustomStageTestFactory*, true>* GetFactories(); + static SkTArray<GrEffectTestFactory*, true>* GetFactories(); }; -/** GrCustomStage subclasses should insert this macro in their declaration to be included in the +/** GrEffect subclasses should insert this macro in their declaration to be included in the * program generation unit test. */ #define GR_DECLARE_CUSTOM_STAGE_TEST \ - static GrCustomStageTestFactory gTestFactory; \ - static GrCustomStage* TestCreate(SkRandom*, GrContext*, GrTexture* dummyTextures[2]) + static GrEffectTestFactory gTestFactory; \ + static GrEffect* TestCreate(SkRandom*, GrContext*, GrTexture* dummyTextures[2]) -/** GrCustomStage subclasses should insert this macro in their implemenation file. They must then +/** GrEffect subclasses should insert this macro in their implemenation file. They must then * also implement this static function: - * GrCustomStage* TestCreate(SkRandom*, GrContext*, GrTexture* dummyTextures[2]); + * GrEffect* TestCreate(SkRandom*, GrContext*, GrTexture* dummyTextures[2]); * dummyTextures[] are valied textures that they can optionally use for their texture accesses. The * first texture has config kSkia8888_PM_GrPixelConfig and the second has kAlpha_8_GrPixelConfig. * TestCreate functions are also free to create additional textures using the GrContext. */ #define GR_DEFINE_CUSTOM_STAGE_TEST(CustomStage) \ - GrCustomStageTestFactory CustomStage :: gTestFactory(CustomStage :: TestCreate) + GrEffectTestFactory CustomStage :: gTestFactory(CustomStage :: TestCreate) #else // !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS // The unit test relies on static initializers. Just declare the TestCreate function so that // its definitions will compile. #define GR_DECLARE_CUSTOM_STAGE_TEST \ - static GrCustomStage* TestCreate(SkRandom*, GrContext*, GrTexture* dummyTextures[2]) + static GrEffect* TestCreate(SkRandom*, GrContext*, GrTexture* dummyTextures[2]) #define GR_DEFINE_CUSTOM_STAGE_TEST(X) #endif // !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS diff --git a/include/gpu/GrCustomStage.h b/include/gpu/GrEffect.h index d75675c6c1..7ea5cd5b6d 100644 --- a/include/gpu/GrCustomStage.h +++ b/include/gpu/GrEffect.h @@ -22,21 +22,21 @@ class SkString; particular stage of the Ganesh shading pipeline. Subclasses must have a function that produces a human-readable name: static const char* Name(); - GrCustomStage objects *must* be immutable: after being constructed, + GrEffect objects *must* be immutable: after being constructed, their fields may not change. (Immutability isn't actually required until they've been used in a draw call, but supporting that would require setters and getters that could fail, copy-on-write, or deep copying of these objects when they're stored by a GrGLProgramStage.) */ -class GrCustomStage : public GrRefCnt { +class GrEffect : public GrRefCnt { public: - SK_DECLARE_INST_COUNT(GrCustomStage) + SK_DECLARE_INST_COUNT(GrEffect) typedef GrProgramStageFactory::StageKey StageKey; - explicit GrCustomStage(int numTextures); - virtual ~GrCustomStage(); + explicit GrEffect(int numTextures); + virtual ~GrEffect(); /** If given an input texture that is/is not opaque, is this stage guaranteed to produce an opaque output? */ @@ -45,12 +45,12 @@ public: /** 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 GrCustomStage. The subclass must have a nested type + on the subclass of GrEffect. The subclass must have a nested type (or typedef) named GLProgramStage which will be the subclass of GrGLProgramStage created by the factory. Example: - class MyCustomStage : public GrCustomStage { + class MyCustomStage : public GrEffect { ... virtual const GrProgramStageFactory& getFactory() const SK_OVERRIDE { @@ -75,7 +75,7 @@ public: the two stages have the same return value for numTextures() and for texture() over all valid indicse. */ - virtual bool isEqual(const GrCustomStage&) const; + virtual bool isEqual(const GrEffect&) const; /** Human-meaningful string to identify this effect; may be embedded in generated shader code. */ diff --git a/include/gpu/GrPaint.h b/include/gpu/GrPaint.h index 06c16af578..b48195593c 100644 --- a/include/gpu/GrPaint.h +++ b/include/gpu/GrPaint.h @@ -20,7 +20,7 @@ * functions and the how color is blended with the destination pixel. * * The paint allows installation of custom color and coverage stages. New types of stages are - * created by subclassing GrCustomStage. + * created by subclassing GrEffect. * * The primitive color computation starts with the color specified by setColor(). This color is the * input to the first color stage. Each color stage feeds its output to the next color stage. The @@ -39,7 +39,7 @@ * Note that the coverage is applied after the blend. This is why they are computed as distinct * values. * - * TODO: Encapsulate setXfermodeColorFilter in a GrCustomStage and remove from GrPaint. + * TODO: Encapsulate setXfermodeColorFilter in a GrEffect and remove from GrPaint. */ class GrPaint { public: diff --git a/include/gpu/GrProgramStageFactory.h b/include/gpu/GrProgramStageFactory.h index 90f6b32851..385ebfe43a 100644 --- a/include/gpu/GrProgramStageFactory.h +++ b/include/gpu/GrProgramStageFactory.h @@ -12,12 +12,12 @@ #include "SkTemplates.h" #include "GrNoncopyable.h" -/** Given a GrCustomStage of a particular type, creates the corresponding +/** Given a GrEffect of a particular type, creates the corresponding graphics-backend-specific GrProgramStage. Also tracks equivalence of shaders generated via a key. */ -class GrCustomStage; +class GrEffect; class GrGLProgramStage; class GrGLCaps; @@ -29,10 +29,10 @@ public: kTexturingStageKeyBits = 6 }; - virtual StageKey glStageKey(const GrCustomStage& stage, + virtual StageKey glStageKey(const GrEffect& stage, const GrGLCaps& caps ) const = 0; virtual GrGLProgramStage* createGLInstance( - const GrCustomStage& stage) const = 0; + const GrEffect& stage) const = 0; bool operator ==(const GrProgramStageFactory& b) const { return fStageClassID == b.fStageClassID; @@ -73,17 +73,17 @@ class GrTProgramStageFactory : public GrProgramStageFactory { public: typedef typename StageClass::GLProgramStage GLProgramStage; - /** Returns a human-readable name that is accessible via GrCustomStage or + /** Returns a human-readable name that is accessible via GrEffect or GrGLProgramStage and is consistent between the two of them. */ virtual const char* name() const SK_OVERRIDE { return StageClass::Name(); } /** Returns a value that idenitifes the GLSL shader code generated by - a GrCustomStage. This enables caching of generated shaders. Part of the + a GrEffect. This enables caching of generated shaders. Part of the id identifies the GrCustomShader subclass. The remainder is based - on the aspects of the GrCustomStage object's configuration that affect + on the aspects of the GrEffect object's configuration that affect GLSL code generation. */ - virtual StageKey glStageKey(const GrCustomStage& stage, + virtual StageKey glStageKey(const GrEffect& stage, const GrGLCaps& caps) const SK_OVERRIDE { GrAssert(kIllegalStageClassID != fStageClassID); StageKey stageID = GLProgramStage::GenKey(stage, caps); @@ -101,10 +101,10 @@ public: } /** Returns a new instance of the appropriate *GL* implementation class - for the given GrCustomStage; caller is responsible for deleting + for the given GrEffect; caller is responsible for deleting the object. */ virtual GLProgramStage* createGLInstance( - const GrCustomStage& stage) const SK_OVERRIDE { + const GrEffect& stage) const SK_OVERRIDE { return SkNEW_ARGS(GLProgramStage, (*this, stage)); } diff --git a/include/gpu/GrSamplerState.h b/include/gpu/GrSamplerState.h index bb71e92560..98ca51de45 100644 --- a/include/gpu/GrSamplerState.h +++ b/include/gpu/GrSamplerState.h @@ -11,7 +11,7 @@ #ifndef GrSamplerState_DEFINED #define GrSamplerState_DEFINED -#include "GrCustomStage.h" +#include "GrEffect.h" #include "GrMatrix.h" #include "GrTypes.h" @@ -70,7 +70,7 @@ public: class SavedCoordChange { private: GrMatrix fCoordChangeMatrix; - GR_DEBUGCODE(mutable SkAutoTUnref<GrCustomStage> fCustomStage;) + GR_DEBUGCODE(mutable SkAutoTUnref<GrEffect> fCustomStage;) friend class GrSamplerState; }; @@ -100,7 +100,7 @@ public: } /** - * Gets the texture matrix. This is will be removed soon and be managed by GrCustomStage. + * Gets the texture matrix. This is will be removed soon and be managed by GrEffect. */ const GrMatrix& getMatrix() const { return fMatrix; } @@ -117,7 +117,7 @@ public: GrSafeSetNull(fCustomStage); } - GrCustomStage* setCustomStage(GrCustomStage* stage) { + GrEffect* setCustomStage(GrEffect* stage) { GrAssert(0 == fSavedCoordChangeCnt); GrSafeAssign(fCustomStage, stage); fMatrix.reset(); @@ -125,7 +125,7 @@ public: return stage; } - GrCustomStage* setCustomStage(GrCustomStage* stage, const GrMatrix& matrix) { + GrEffect* setCustomStage(GrEffect* stage, const GrMatrix& matrix) { GrAssert(0 == fSavedCoordChangeCnt); GrSafeAssign(fCustomStage, stage); fMatrix = matrix; @@ -133,12 +133,12 @@ public: return stage; } - const GrCustomStage* getCustomStage() const { return fCustomStage; } + const GrEffect* getCustomStage() const { return fCustomStage; } private: GrMatrix fCoordChangeMatrix; - GrMatrix fMatrix; // TODO: remove this, store in GrCustomStage - GrCustomStage* fCustomStage; + GrMatrix fMatrix; // TODO: remove this, store in GrEffect + GrEffect* fCustomStage; GR_DEBUGCODE(mutable int fSavedCoordChangeCnt;) }; diff --git a/include/gpu/GrTextureAccess.h b/include/gpu/GrTextureAccess.h index 0d0860f2fe..b03e6e6dc9 100644 --- a/include/gpu/GrTextureAccess.h +++ b/include/gpu/GrTextureAccess.h @@ -103,14 +103,14 @@ private: /** A class representing the swizzle access pattern for a texture. Note that if the texture is * an alpha-only texture then the alpha channel is substituted for other components. Any mangling * to handle the r,g,b->a conversions for alpha textures is automatically included in the stage - * key. However, if a GrCustomStage uses different swizzles based on its input then it must + * key. However, if a GrEffect uses different swizzles based on its input then it must * consider that variation in its key-generation. */ class GrTextureAccess : GrNoncopyable { public: /** - * A default GrTextureAccess must have reset() called on it in a GrCustomStage subclass's - * constructor if it will be accessible via GrCustomStage::textureAccess(). + * A default GrTextureAccess must have reset() called on it in a GrEffect subclass's + * constructor if it will be accessible via GrEffect::textureAccess(). */ GrTextureAccess(); |