| 87 | } |
| 88 | |
| 89 | void FontCacheManager::PrewarmScope::endScanAndPrewarm() { |
| 90 | manager_->scanMode_ = ScanMode::None; |
| 91 | if (manager_->scanText_.empty()) return; |
| 92 | |
| 93 | // Build style bitmask from all styles that appeared during the scan |
| 94 | uint8_t styleMask = 0; |
| 95 | for (uint8_t i = 0; i < 4; i++) { |
| 96 | if (manager_->scanStyleCounts_[i] > 0) styleMask |= (1 << i); |
| 97 | } |
| 98 | if (styleMask == 0) styleMask = 1; // default to regular |
| 99 | |
| 100 | manager_->prewarmCache(manager_->scanFontId_, manager_->scanText_.c_str(), styleMask); |
| 101 | |
| 102 | // Free scan string memory |
| 103 | manager_->scanText_.clear(); |
| 104 | manager_->scanText_.shrink_to_fit(); |
| 105 | } |
| 106 | |
| 107 | FontCacheManager::PrewarmScope::~PrewarmScope() { |
| 108 | if (active_) { |
no test coverage detected