MCPcopy Create free account
hub / github.com/crosspoint-reader/crosspoint-reader / endScanAndPrewarm

Method endScanAndPrewarm

lib/GfxRenderer/FontCacheManager.cpp:89–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void 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
107FontCacheManager::PrewarmScope::~PrewarmScope() {
108 if (active_) {

Callers 2

renderPageMethod · 0.80
renderContentsMethod · 0.80

Calls 3

emptyMethod · 0.45
prewarmCacheMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected