Home | History | Annotate | Download | only in core

Lines Matching refs:fRefCnt

29     SkRefCntBase() : fRefCnt(1) {}
35 SkASSERTF(fRefCnt == 1, "fRefCnt was %d", fRefCnt);
36 fRefCnt = 0; // illegal value, to catch us if we reuse after delete
42 int32_t getRefCnt() const { return fRefCnt; }
49 if (1 == sk_atomic_load(&fRefCnt, sk_memory_order_acquire)) {
62 // Android employs some special subclasses that enable the fRefCnt to
66 SkASSERT(fRefCnt >= 0);
68 SkASSERT(fRefCnt > 0);
70 (void)sk_atomic_fetch_add(&fRefCnt, +1, sk_memory_order_relaxed); // No barrier required.
78 SkASSERT(fRefCnt > 0);
80 if (1 == sk_atomic_fetch_add(&fRefCnt, -1, sk_memory_order_acq_rel)) {
89 SkASSERT(fRefCnt > 0);
96 * so they can reset fRefCnt before the destructor is called. Should only
102 SkASSERT(0 == fRefCnt);
103 fRefCnt = 1;
120 mutable int32_t fRefCnt;
232 SkNVRefCnt() : fRefCnt(1) {}
233 ~SkNVRefCnt() { SkASSERTF(1 == fRefCnt, "NVRefCnt was %d", fRefCnt); }
240 bool unique() const { return 1 == sk_atomic_load(&fRefCnt, sk_memory_order_acquire); }
241 void ref() const { (void)sk_atomic_fetch_add(&fRefCnt, +1, sk_memory_order_relaxed); }
243 if (1 == sk_atomic_fetch_add(&fRefCnt, -1, sk_memory_order_acq_rel)) {
244 SkDEBUGCODE(fRefCnt = 1;) // restore the 1 for our destructor's assert
251 mutable int32_t fRefCnt;