Lines Matching refs:effect

27  * GrEffectRef ref count reaches zero the scratch GrResources owned by the effect can be recycled
59 explicit GrEffectRef(GrEffect* effect);
80 memory pool. The ref count of an effect must reach 0 before the thread terminates and the pool
81 is destroyed. To create a static effect use the macro GR_CREATE_STATIC_EFFECT declared below.
91 * indicate whether the input components to this effect in the FS will have known values.
98 /** Will this effect read the source color value? */
118 /** Returns true if this and other effect conservatively draw identically. It can only return
131 /** Human-meaningful string to identify this effect; may be embedded
150 /** Will this effect read the destination pixel value? */
153 /** Will this effect read the fragment position? */
156 /** Will this effect emit custom vertex shader code?
157 (To set this value the effect must inherit from GrVertexEffect.) */
189 keeps the effect alive outside of GrEffectRef while allowing any resources owned by the
190 effect to be returned to the cache for reuse. The dec call must balance the inc call. */
209 * effect subclass manages the lifetime of the transformations (this function only stores a
217 * Subclasses call this from their constructor to register GrTextureAccesses. The effect
233 static GrEffectRef* CreateEffectRef(GrEffect* effect) {
234 if (NULL == effect->fEffectRef) {
235 effect->fEffectRef = SkNEW_ARGS(GrEffectRef, (effect));
237 effect->fEffectRef->ref();
239 return effect->fEffectRef;
242 static const GrEffectRef* CreateEffectRef(const GrEffect* effect) {
243 return CreateEffectRef(const_cast<GrEffect*>(effect));
247 static GrEffectRef* CreateStaticEffectRef(void* refStorage, GrEffect* effect) {
248 SkASSERT(NULL == effect->fEffectRef);
249 effect->fEffectRef = SkNEW_PLACEMENT_ARGS(refStorage, GrEffectRef, (effect));
250 return effect->fEffectRef;
254 /** Helper used in subclass factory functions to unref the effect after it has been wrapped in a
260 AutoEffectUnref effect(SkNEW_ARGS(EffectSubclass, (param1, param2, ...)));
261 return CreateEffectRef(effect);
266 AutoEffectUnref(GrEffect* effect) : fEffect(effect) { }
281 * If the effect subclass will read the destination pixel value then it must call this function
282 * from its constructor. Otherwise, when its generated backend-specific effect class attempts
288 * If the effect will generate a backend-specific effect that will read the fragment position
295 * If the effect will generate a result that does not depend on the input color value then it must
325 friend class GrEffectStage; // to rewrap GrEffect in GrEffectRef when restoring an effect-stage
342 inline GrEffectRef::GrEffectRef(GrEffect* effect) {
343 SkASSERT(NULL != effect);
344 effect->ref();
345 fEffect = effect;
349 * This creates an effect outside of the effect memory pool. The effect's destructor will be called