Lines Matching defs:GrEffectRef
27 * GrEffectRef ref count reaches zero the scratch GrResources owned by the effect can be recycled
35 class GrEffectRef : public SkRefCnt {
37 SK_DECLARE_INST_COUNT(GrEffectRef);
38 virtual ~GrEffectRef();
59 explicit GrEffectRef(GrEffect* effect);
72 GrEffect subclass objects should be created by factory functions that return GrEffectRef.
73 There is no public way to wrap a GrEffect in a GrEffectRef. Thus, a factory should be a static
76 Because almost no code should ever handle a GrEffect directly outside of a GrEffectRef, we
127 bool isEqual(const GrEffectRef& other) const {
189 keeps the effect alive outside of GrEffectRef while allowing any resources owned by the
233 static GrEffectRef* CreateEffectRef(GrEffect* effect) {
235 effect->fEffectRef = SkNEW_ARGS(GrEffectRef, (effect));
242 static const GrEffectRef* CreateEffectRef(const GrEffect* effect) {
247 static GrEffectRef* CreateStaticEffectRef(void* refStorage, GrEffect* effect) {
249 effect->fEffectRef = SkNEW_PLACEMENT_ARGS(refStorage, GrEffectRef, (effect));
255 GrEffectRef. E.g.:
259 GrEffectRef* Create(ParamType1 param1, ParamType2 param2, ...) {
273 /** Helper for getting the GrEffect out of a GrEffectRef and down-casting to a GrEffect subclass
324 friend class GrEffectRef; // to call EffectRefDestroyed()
325 friend class GrEffectStage; // to rewrap GrEffect in GrEffectRef when restoring an effect-stage
337 GrEffectRef* fEffectRef;
342 inline GrEffectRef::GrEffectRef(GrEffect* effect) {
350 * at global destruction time. NAME will be the name of the created GrEffectRef.
355 k_##NAME##_StorageSize = k_##NAME##_EffectRefOffset + sizeof(GrEffectRef) \
361 static GrEffectRef* NAME(GrEffect::CreateStaticEffectRef(NAME##_RefLocation, NAME##_Effect)); \
362 static SkAutoTDestroy<GrEffectRef> NAME##_Ref_ad(NAME)