Lines Matching defs:block

36     sortOutGlyphs([&](GlyphRange block){
37 if (block.width() == 0) {
40 addUnresolvedWithRun(block);
45 // No unresolved blocks added - we resolved the block with one run entirely
108 // Clean up repetitive blocks that appear inside the same grapheme block
125 // Extend the unresolved block with an empty resolved
154 void OneLineShaper::finish(const Block& block, SkScalar height, SkScalar& advanceX) {
158 auto blockText = block.fRange;
223 block.fStyle.getHalfLeading(),
224 block.fStyle.getBaselineShift(),
302 // Few pieces of the same unresolved text block can ignore the second one
317 GlyphRange block = EMPTY_RANGE;
343 if (block.start == EMPTY_INDEX) {
344 // Start new unresolved block
345 block.start = i;
346 block.end = EMPTY_INDEX;
348 // Keep skipping unresolved block
351 if (block.start == EMPTY_INDEX) {
354 // This is the end of unresolved block
355 block.end = i;
356 sortOutUnresolvedBLock(block);
357 block = EMPTY_RANGE;
362 // One last block could have been left
363 if (block.start != EMPTY_INDEX) {
364 block.end = fCurrentRun->size();
365 sortOutUnresolvedBLock(block);
369 BlockRange OneLineShaper::generateBlockRange(const Block& block, const TextRange& textRange)
371 size_t start = std::max(block.fRange.start, textRange.start);
372 size_t end = std::min(block.fRange.end, textRange.end);
387 auto addFeatures = [&features](const Block& block) {
388 for (auto& ff : block.fStyle.getFontFeatures()) {
396 block.fRange.start,
397 block.fRange.end
402 if (block.fStyle.getLetterSpacing() > 0) {
404 SkSetFourByteTag('l', 'i', 'g', 'a'), 0, block.fRange.start, block.fRange.end
409 for (auto& block : styleSpan) {
410 BlockRange blockRange = generateBlockRange(block, textRange);
414 SkASSERT(combinedBlock.fRange.width() == 0 || combinedBlock.fRange.end == block.fRange.start);
417 if (block.fStyle.matchOneAttribute(StyleType::kFont, combinedBlock.fStyle)) {
419 addFeatures(block);
422 // Resolve all characters in the block for this style
427 combinedBlock.fStyle = block.fStyle;
429 addFeatures(block);
466 // but we still need to keep track of all SkUnichars used in this unresolved block
472 // Not a single codepoint could be resolved but we finished the block
558 for (auto& block : hopelessBlocks) {
559 fUnresolvedBlocks.emplace_front(block);
669 (Block block, SkTArray<SkShaper::Feature> features) {
670 auto blockSpan = SkSpan<Block>(&block, 1);
672 // Start from the beginning (hoping that it's a simple case one block - one run)
673 fHeight = block.fStyle.getHeightOverride() ? block.fStyle.getHeight() : 0;
674 fUseHalfLeading = block.fStyle.getHalfLeading();
675 fBaselineShift = block.fStyle.getBaselineShift();
677 fCurrentText = block.fRange;
678 fUnresolvedBlocks.emplace_back(RunBlock(block.fRange));
681 this->matchResolvedFonts(block.fStyle, [&](sk_sp<SkTypeface> typeface) {
683 this->matchResolvedFonts(block.fStyle, [&](std::shared_ptr<RSTypeface> typeface) {
690 SkFont font(std::move(typeface), block.fStyle.getFontSize());
696 RSFont font(std::move(typeface), block.fStyle.getFontSize(), 1, 0);
709 int wantedWeight = block.fStyle.getFontStyle().weight();
714 block.fStyle.getFontStyle().slant() == SkFontStyle::kItalic_Slant &&
719 int wantedWeight = block.fStyle.getFontStyle().GetWeight();
724 block.fStyle.getFontStyle().GetSlant() == RSFontStyle::ITALIC_SLANT &&
751 // Map the block's features to subranges within the unresolved range.
767 // Take off the queue the block we tried to resolved -
783 this->finish(block, fHeight, advanceX);