[core] use stale glyphs

Updating glyphs is still unsupported, and there's no good use case for doing so. When we're using a stale glyph PBF, and the fresh answer contains changed to that glyph, we will continue to use the old glyph.
This commit is contained in:
Konstantin Käfer
2016-01-07 18:51:19 +01:00
parent 32a2359e86
commit a88e58ef3a
9 changed files with 104 additions and 36 deletions

View File

@@ -75,15 +75,9 @@ GlyphPBF::GlyphPBF(GlyphStore* store,
});
auto requestCallback = [this, store, fontStack, glyphRange](Response res) {
if (res.stale) {
// Only handle fresh responses.
return;
}
req = nullptr;
if (res.error) {
observer->onGlyphsError(fontStack, glyphRange, std::make_exception_ptr(std::runtime_error(res.error->message)));
} else {
} else if (data != res.data || (*data != *res.data)) {
data = res.data;
parse(store, fontStack, glyphRange);
}