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