Implement sparse css cache plus dynamic banding for AA

This commit is contained in:
jpirnay
2026-05-11 22:27:13 +02:00
parent fb16db2b48
commit c273e250f2
7 changed files with 758 additions and 202 deletions
+11 -5
View File
@@ -454,6 +454,11 @@ void Epub::parseCssFiles() const {
}
// No cache yet - parse CSS files
if (!cssParser->beginCacheCompile()) {
LOG_ERR("EBP", "Failed to start CSS compile pipeline");
return;
}
for (const auto& cssPath : cssFiles) {
LOG_DBG("EBP", "Parsing CSS file: %s", cssPath.c_str());
@@ -496,16 +501,17 @@ void Epub::parseCssFiles() const {
Storage.remove(tmpCssPath.c_str());
continue;
}
cssParser->loadFromStream(tempCssFile);
if (!cssParser->appendCompiledFromStream(tempCssFile)) {
LOG_ERR("EBP", "Failed to compile CSS file: %s", cssPath.c_str());
}
tempCssFile.close();
Storage.remove(tmpCssPath.c_str());
}
// Save to cache for next time
if (!cssParser->saveToCache()) {
LOG_ERR("EBP", "Failed to save CSS rules to cache");
// Finalize compact cache for next time.
if (!cssParser->endCacheCompile()) {
LOG_ERR("EBP", "Failed to finalize CSS rules cache");
}
cssParser->clear();
LOG_DBG("EBP", "Loaded %zu CSS style rules from %zu files", cssParser->ruleCount(), cssFiles.size());
}