Lines Matching refs:run
210 static const RunRecord* Next(const RunRecord* run) { in Next() argument
211 return SkToBool(run->fFlags & kLast_Flag) ? nullptr : NextUnchecked(run); in Next()
240 static const RunRecord* NextUnchecked(const RunRecord* run) { in NextUnchecked() argument
242 reinterpret_cast<const uint8_t*>(run) in NextUnchecked()
243 + StorageSize(run->glyphCount(), run->textSize(), run->positioning())); in NextUnchecked()
303 const auto* run = RunRecord::First(this); in ~SkTextBlob() local
305 const auto* nextRun = RunRecord::Next(run); in ~SkTextBlob()
306 SkDEBUGCODE(run->validate((uint8_t*)this + fStorageSize);) in ~SkTextBlob()
307 run->~RunRecord(); in ~SkTextBlob()
308 run = nextRun; in ~SkTextBlob()
309 } while (run); in ~SkTextBlob()
413 SkRect SkTextBlobBuilder::TightRunBounds(const SkTextBlob::RunRecord& run) { in TightRunBounds() argument
416 run.font().applyToPaint(&paint); in TightRunBounds()
418 if (SkTextBlob::kDefault_Positioning == run.positioning()) { in TightRunBounds()
419 paint.measureText(run.glyphBuffer(), run.glyphCount() * sizeof(uint16_t), &bounds); in TightRunBounds()
420 return bounds.makeOffset(run.offset().x(), run.offset().y()); in TightRunBounds()
423 SkAutoSTArray<16, SkRect> glyphBounds(run.glyphCount()); in TightRunBounds()
424 paint.getTextWidths(run.glyphBuffer(), in TightRunBounds()
425 run.glyphCount() * sizeof(uint16_t), in TightRunBounds()
429 SkASSERT(SkTextBlob::kFull_Positioning == run.positioning() || in TightRunBounds()
430 SkTextBlob::kHorizontal_Positioning == run.positioning()); in TightRunBounds()
435 const SkScalar* glyphPosX = run.posBuffer(); in TightRunBounds()
436 const SkScalar* glyphPosY = (run.positioning() == SkTextBlob::kFull_Positioning) ? in TightRunBounds()
438 const unsigned posXInc = SkTextBlob::ScalarsPerGlyph(run.positioning()); in TightRunBounds()
439 const unsigned posYInc = (run.positioning() == SkTextBlob::kFull_Positioning) ? in TightRunBounds()
443 for (unsigned i = 0; i < run.glyphCount(); ++i) { in TightRunBounds()
449 SkASSERT((void*)glyphPosX <= SkTextBlob::RunRecord::Next(&run)); in TightRunBounds()
451 return bounds.makeOffset(run.offset().x(), run.offset().y()); in TightRunBounds()
454 SkRect SkTextBlobBuilder::ConservativeRunBounds(const SkTextBlob::RunRecord& run) { in ConservativeRunBounds() argument
455 SkASSERT(run.glyphCount() > 0); in ConservativeRunBounds()
456 SkASSERT(SkTextBlob::kFull_Positioning == run.positioning() || in ConservativeRunBounds()
457 SkTextBlob::kHorizontal_Positioning == run.positioning()); in ConservativeRunBounds()
460 run.font().applyToPaint(&paint); in ConservativeRunBounds()
465 return TightRunBounds(run); in ConservativeRunBounds()
470 switch (run.positioning()) { in ConservativeRunBounds()
472 const SkScalar* glyphPos = run.posBuffer(); in ConservativeRunBounds()
473 SkASSERT((void*)(glyphPos + run.glyphCount()) <= SkTextBlob::RunRecord::Next(&run)); in ConservativeRunBounds()
477 for (unsigned i = 1; i < run.glyphCount(); ++i) { in ConservativeRunBounds()
486 const SkPoint* glyphPosPts = reinterpret_cast<const SkPoint*>(run.posBuffer()); in ConservativeRunBounds()
487 SkASSERT((void*)(glyphPosPts + run.glyphCount()) <= SkTextBlob::RunRecord::Next(&run)); in ConservativeRunBounds()
489 bounds.setBounds(glyphPosPts, run.glyphCount()); in ConservativeRunBounds()
502 return bounds.makeOffset(run.offset().x(), run.offset().y()); in ConservativeRunBounds()
513 SkTextBlob::RunRecord* run = reinterpret_cast<SkTextBlob::RunRecord*>(fStorage.get() + in updateDeferredBounds() local
517 SkRect runBounds = SkTextBlob::kDefault_Positioning == run->positioning() ? in updateDeferredBounds()
518 TightRunBounds(*run) : ConservativeRunBounds(*run); in updateDeferredBounds()
551 SkTextBlob::RunRecord* run = reinterpret_cast<SkTextBlob::RunRecord*>(fStorage.get() + in mergeRun() local
553 SkASSERT(run->glyphCount() > 0); in mergeRun()
555 if (run->textSize() != 0) { in mergeRun()
559 if (run->positioning() != positioning in mergeRun()
560 || run->font() != font in mergeRun()
561 || (run->glyphCount() + count < run->glyphCount())) { in mergeRun()
571 || run->offset().y() != offset.y())) { in mergeRun()
575 … size_t sizeDelta = SkTextBlob::RunRecord::StorageSize(run->glyphCount() + count, 0, positioning) - in mergeRun()
576 SkTextBlob::RunRecord::StorageSize(run->glyphCount(), 0, positioning); in mergeRun()
580 run = reinterpret_cast<SkTextBlob::RunRecord*>(fStorage.get() + fLastRun); in mergeRun()
581 uint32_t preMergeCount = run->glyphCount(); in mergeRun()
582 run->grow(count); in mergeRun()
585 fCurrentRunBuffer.glyphs = run->glyphBuffer() + preMergeCount; in mergeRun()
586 fCurrentRunBuffer.pos = run->posBuffer() in mergeRun()
592 run->validate(fStorage.get() + fStorageUsed); in mergeRun()
612 SkTextBlob::RunRecord* run = new (fStorage.get() + fStorageUsed) in allocInternal() local
614 fCurrentRunBuffer.glyphs = run->glyphBuffer(); in allocInternal()
615 fCurrentRunBuffer.pos = run->posBuffer(); in allocInternal()
616 fCurrentRunBuffer.utf8text = run->textBuffer(); in allocInternal()
617 fCurrentRunBuffer.clusters = run->clusterBuffer(); in allocInternal()
624 run->validate(fStorage.get() + fStorageUsed); in allocInternal()
688 for (const auto* run = SkTextBlob::RunRecord::First(blob); run; in make()
689 run = SkTextBlob::RunRecord::Next(run)) { in make()
691 run->fCount, run->textSize(), run->positioning()); in make()
692 run->validate(reinterpret_cast<const uint8_t*>(blob) + fStorageUsed); in make()