Lines Matching refs:fRec

245     if (fRec != &gEmptyRec) {  in validate()
246 SkASSERT(fRec->fLength > 0); in validate()
247 SkASSERT(fRec->fRefCnt > 0); in validate()
248 SkASSERT(0 == fRec->data()[fRec->fLength]); in validate()
255 SkString::SkString() : fRec(const_cast<Rec*>(&gEmptyRec)) { in SkString()
259 fRec = AllocRec(nullptr, len); in SkString()
265 fRec = AllocRec(text, len); in SkString()
269 fRec = AllocRec(text, len); in SkString()
275 fRec = RefRec(src.fRec); in SkString()
281 fRec = src.fRec; in SkString()
282 src.fRec = const_cast<Rec*>(&gEmptyRec); in SkString()
288 if (fRec->fLength) { in ~SkString()
289 SkASSERT(fRec->fRefCnt > 0); in ~SkString()
290 if (sk_atomic_dec(&fRec->fRefCnt) == 1) { in ~SkString()
291 sk_free(fRec); in ~SkString()
297 return fRec == src.fRec || this->equals(src.c_str(), src.size()); in equals()
307 return fRec->fLength == len && !memcmp(fRec->data(), text, len); in equals()
313 if (fRec != src.fRec) { in operator =()
323 if (fRec != src.fRec) { in operator =()
341 if (fRec->fLength) { in reset()
342 SkASSERT(fRec->fRefCnt > 0); in reset()
343 if (sk_atomic_dec(&fRec->fRefCnt) == 1) { in reset()
344 sk_free(fRec); in reset()
348 fRec = const_cast<Rec*>(&gEmptyRec); in reset()
354 if (fRec->fLength) { in writable_str()
355 if (fRec->fRefCnt > 1) { in writable_str()
356 Rec* rec = AllocRec(fRec->data(), fRec->fLength); in writable_str()
357 if (sk_atomic_dec(&fRec->fRefCnt) == 1) { in writable_str()
361 sk_free(fRec); in writable_str()
363 fRec = rec; in writable_str()
366 return fRec->data(); in writable_str()
378 } else if (1 == fRec->fRefCnt && len <= fRec->fLength) { in set()
386 fRec->fLength = SkToU32(len); in set()
387 } else if (1 == fRec->fRefCnt && (fRec->fLength >> 2) == (len >> 2)) { in set()
394 fRec->fLength = SkToU32(len); in set()
415 } else if (count <= fRec->fLength) { in setUTF16()
417 if (count < fRec->fLength) { in setUTF16()
442 size_t length = fRec->fLength; in insert()
463 if (1 == fRec->fRefCnt && (length >> 2) == ((length + len) >> 2)) { in insert()
472 fRec->fLength = SkToU32(length + len); in insert()
477 SkString tmp(fRec->fLength + len); in insert()
481 memcpy(dst, fRec->data(), offset); in insert()
484 if (offset < fRec->fLength) { in insert()
485 memcpy(dst + offset + len, fRec->data() + offset, in insert()
486 fRec->fLength - offset); in insert()
629 SkTSwap<Rec*>(fRec, other.fRec); in swap()