* processor's key. This allows keys generated by getGLProcessorKey() to only be unique within a
* GrProcessor subclass and not necessarily across subclasses.
*/
- uint32_t effectClassID() const { return fEffectClassID; }
+ uint32_t classID() const { return fProcessorClassID; }
protected:
- GrBackendProcessorFactory() : fEffectClassID(GenID()) {}
+ GrBackendProcessorFactory() : fProcessorClassID(GenClassID()) {}
virtual ~GrBackendProcessorFactory() {}
private:
enum {
- kIllegalEffectClassID = 0,
+ kIllegalProcessorClassID = 0,
};
- static uint32_t GenID() {
- // fCurrEffectClassID has been initialized to kIllegalEffectClassID. The
+ static uint32_t GenClassID() {
+ // fCurrProcessorClassID has been initialized to kIllegalProcessorClassID. The
// atomic inc returns the old value not the incremented value. So we add
// 1 to the returned value.
- uint32_t id = static_cast<uint32_t>(sk_atomic_inc(&fCurrEffectClassID)) + 1;
+ uint32_t id = static_cast<uint32_t>(sk_atomic_inc(&fCurrProcessorClassID)) + 1;
if (!id) {
SkFAIL("This should never wrap as it should only be called once for each GrProcessor "
"subclass.");
return id;
}
- const uint32_t fEffectClassID;
- static int32_t fCurrEffectClassID;
+ const uint32_t fProcessorClassID;
+ static int32_t fCurrProcessorClassID;
};
class GrFragmentProcessor;
*/
class GrCoordTransform : SkNoncopyable {
public:
- GrCoordTransform() { SkDEBUGCODE(fInEffect = false); }
+ GrCoordTransform() { SkDEBUGCODE(fInProcessor = false); }
/**
* Create a transformation that maps [0, 1] to a texture's boundaries.
*/
GrCoordTransform(GrCoordSet sourceCoords, const GrTexture* texture) {
- SkDEBUGCODE(fInEffect = false);
+ SkDEBUGCODE(fInProcessor = false);
this->reset(sourceCoords, texture);
}
* coord convention.
*/
GrCoordTransform(GrCoordSet sourceCoords, const SkMatrix& m, const GrTexture* texture = NULL) {
- SkDEBUGCODE(fInEffect = false);
+ SkDEBUGCODE(fInProcessor = false);
this->reset(sourceCoords, m, texture);
}
void reset(GrCoordSet sourceCoords, const GrTexture* texture) {
- SkASSERT(!fInEffect);
+ SkASSERT(!fInProcessor);
SkASSERT(texture);
this->reset(sourceCoords, MakeDivByTextureWHMatrix(texture), texture);
}
void reset(GrCoordSet sourceCoords, const SkMatrix& m, const GrTexture* texture = NULL) {
- SkASSERT(!fInEffect);
+ SkASSERT(!fInProcessor);
fSourceCoords = sourceCoords;
fMatrix = m;
fReverseY = texture && kBottomLeft_GrSurfaceOrigin == texture->origin();
}
GrCoordTransform& operator= (const GrCoordTransform& other) {
- SkASSERT(!fInEffect);
+ SkASSERT(!fInProcessor);
fSourceCoords = other.fSourceCoords;
fMatrix = other.fMatrix;
fReverseY = other.fReverseY;
* effect, since effects are immutable.
*/
SkMatrix* accessMatrix() {
- SkASSERT(!fInEffect);
+ SkASSERT(!fInProcessor);
return &fMatrix;
}
#ifdef SK_DEBUG
public:
- void setInEffect() const { fInEffect = true; }
+ void setInProcessor() const { fInProcessor = true; }
private:
- mutable bool fInEffect;
+ mutable bool fInProcessor;
#endif
};
}
};
-int32_t GrBackendProcessorFactory::fCurrEffectClassID =
- GrBackendProcessorFactory::kIllegalEffectClassID;
+int32_t GrBackendProcessorFactory::fCurrProcessorClassID =
+ GrBackendProcessorFactory::kIllegalProcessorClassID;
///////////////////////////////////////////////////////////////////////////////
void GrFragmentProcessor::addCoordTransform(const GrCoordTransform* transform) {
fCoordTransforms.push_back(transform);
- SkDEBUGCODE(transform->setInEffect();)
+ SkDEBUGCODE(transform->setInProcessor();)
}
}
*processorKeySize = SkToU16(size);
uint32_t textureKey = gen_texture_key(proc, caps);
- uint32_t classID = proc.getFactory().effectClassID();
+ uint32_t classID = proc.getFactory().classID();
// Currently we allow 16 bits for each of the above portions of the meta-key. Fail if they
// don't fit.