1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Remove the API-caching of annotation-data

This was essentially done only to compensate for the viewer calling `PDFPageProxy.getAnnotations` unconditionally on every annotationLayer-rendering invocation. With the previous patch that's no longer happening, and this API-caching should thus no longer be necessary.
This commit is contained in:
Jonas Jenwald 2022-12-10 12:25:50 +01:00
parent 8e56f072e0
commit 9b6d0d994d

View file

@ -1258,7 +1258,6 @@ class PDFPageProxy {
this.cleanupAfterRender = false;
this.pendingCleanup = false;
this._intentStates = new Map();
this._annotationPromises = new Map();
this.destroyed = false;
}
@ -1328,15 +1327,10 @@ class PDFPageProxy {
getAnnotations({ intent = "display" } = {}) {
const intentArgs = this._transport.getRenderingIntent(intent);
let promise = this._annotationPromises.get(intentArgs.cacheKey);
if (!promise) {
promise = this._transport.getAnnotations(
this._pageIndex,
intentArgs.renderingIntent
);
this._annotationPromises.set(intentArgs.cacheKey, promise);
}
return promise;
return this._transport.getAnnotations(
this._pageIndex,
intentArgs.renderingIntent
);
}
/**
@ -1655,7 +1649,6 @@ class PDFPageProxy {
bitmap.close();
}
this._bitmaps.clear();
this._annotationPromises.clear();
this._jsActionsPromise = null;
this.pendingCleanup = false;
return Promise.all(waitOn);
@ -1689,7 +1682,6 @@ class PDFPageProxy {
this._intentStates.clear();
this.objs.clear();
this._annotationPromises.clear();
this._jsActionsPromise = null;
if (resetStats && this._stats) {
this._stats = new StatTimer();