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 {
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;
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.
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));
/** 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.
const GrProgramStageFactory& getFactory() const;
SkBlendImageFilter::Mode mode() const { return fMode; }
- typedef GrGLBlendEffect GLProgramStage;
+ typedef GrGLBlendEffect GLEffect;
static const char* Name() { return "Blend"; }
private:
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) {
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;
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;
float x_inset() const { return fXInset; }
float y_inset() const { return fYInset; }
- typedef GrGLMagnifierEffect GLProgramStage;
+ typedef GrGLMagnifierEffect GLEffect;
private:
GR_DECLARE_EFFECT_TEST;
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;
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;
virtual const GrTextureAccess& textureAccess(int index) const SK_OVERRIDE;
- typedef GLColorTableEffect GLProgramStage;
+ typedef GLColorTableEffect GLEffect;
private:
GR_DECLARE_EFFECT_TEST;
return GrTProgramStageFactory<GrLinearGradient>::getInstance();
}
- typedef GrGLLinearGradient GLProgramStage;
+ typedef GrGLLinearGradient GLEffect;
private:
GR_DECLARE_EFFECT_TEST;
return GrTProgramStageFactory<GrRadialGradient>::getInstance();
}
- typedef GrGLRadialGradient GLProgramStage;
+ typedef GrGLRadialGradient GLEffect;
private:
GR_DECLARE_EFFECT_TEST;
return GrTProgramStageFactory<GrSweepGradient>::getInstance();
}
- typedef GrGLSweepGradient GLProgramStage;
+ typedef GrGLSweepGradient GLEffect;
private:
GR_DECLARE_EFFECT_TEST;
GrScalar diffRadius() const { return fDiffRadius; }
GrScalar radius() const { return fRadius0; }
- typedef GrGLConical2Gradient GLProgramStage;
+ typedef GrGLConical2Gradient GLEffect;
private:
GR_DECLARE_EFFECT_TEST;
GrScalar radius() const { return fRadius0; }
bool isPosRoot() const { return SkToBool(fPosRoot); }
- typedef GrGLRadial2Gradient GLProgramStage;
+ typedef GrGLRadial2Gradient GLEffect;
private:
GR_DECLARE_EFFECT_TEST;
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;
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;
static const char* Name() { return "Single Texture"; }
- typedef GrGLSingleTextureEffect GLProgramStage;
+ typedef GrGLSingleTextureEffect GLEffect;
virtual const GrProgramStageFactory& getFactory() const SK_OVERRIDE;
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;
* found in the LICENSE file.
*/
-#ifndef GrGLProgramStage_DEFINED
-#define GrGLProgramStage_DEFINED
+#ifndef GrGLEffect_DEFINED
+#define GrGLEffect_DEFINED
#include "GrAllocator.h"
#include "GrEffect.h"
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().
*/
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: