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:
parent
8e56f072e0
commit
9b6d0d994d
1 changed files with 4 additions and 12 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue