Lines Matching refs:safe
40 SkSafeMath* safe) { in StorageSize() argument
43 auto glyphSize = safe->mul(glyphCount, sizeof(uint16_t)), in StorageSize()
44 posSize = safe->mul(PosCount(glyphCount, positioning, safe), sizeof(SkScalar)); in StorageSize()
48 size = safe->add(size, safe->alignUp(glyphSize, 4)); in StorageSize()
49 size = safe->add(size, posSize); in StorageSize()
52 size = safe->add(size, sizeof(uint32_t)); in StorageSize()
53 size = safe->add(size, safe->mul(glyphCount, sizeof(uint32_t))); in StorageSize()
54 size = safe->add(size, textSize); in StorageSize()
57 return safe->alignUp(size, sizeof(void*)); in StorageSize()
98 SkSafeMath safe; in NextUnchecked() local
101 + StorageSize(run->glyphCount(), run->textSize(), run->positioning(), &safe)); in NextUnchecked()
102 SkASSERT(safe); in NextUnchecked()
108 SkSafeMath* safe) { in PosCount() argument
109 return safe->mul(glyphCount, ScalarsPerGlyph(positioning)); in PosCount()
115 SkSafeMath safe; in textSizePtr() local
116 auto res = (uint32_t*)(&this->posBuffer()[PosCount(fCount, positioning(), &safe)]); in textSizePtr()
117 SkASSERT(safe); in textSizePtr()
380 SkSafeMath safe; in reserve() local
383 if (safe.add(fStorageUsed, size) <= fStorageSize && safe) { in reserve()
397 fStorageSize = safe.add(fStorageUsed, size); in reserve()
401 fStorage.realloc(safe ? fStorageSize : std::numeric_limits<size_t>::max()); in reserve()
436 SkSafeMath safe; in mergeRun() local
438 SkTextBlob::RunRecord::StorageSize(run->glyphCount() + count, 0, positioning, &safe) - in mergeRun()
439 SkTextBlob::RunRecord::StorageSize(run->glyphCount() , 0, positioning, &safe); in mergeRun()
440 if (!safe) { in mergeRun()
476 SkSafeMath safe; in allocInternal() local
477 size_t runSize = SkTextBlob::RunRecord::StorageSize(count, textSize, positioning, &safe); in allocInternal()
478 if (!safe) { in allocInternal()
598 SkSafeMath safe; in make()
603 run->fCount, run->textSize(), run->positioning(), &safe); in make()
609 SkASSERT(safe); in make()
738 SkSafeMath safe; in MakeFromBuffer() local
769 const size_t glyphSize = safe.mul(glyphCount, sizeof(uint16_t)), in MakeFromBuffer()
771 safe.mul(glyphCount, safe.mul(sizeof(SkScalar), in MakeFromBuffer()
773 clusterSize = pe.extended ? safe.mul(glyphCount, sizeof(uint32_t)) : 0; in MakeFromBuffer()
775 safe.add(safe.add(glyphSize, posSize), safe.add(clusterSize, textSize)); in MakeFromBuffer()
777 if (!reader.isValid() || !safe || totalSize > reader.available()) { in MakeFromBuffer()