[api-minor] Use a SVG filter when rendering pages in HCM

The idea is to apply an overall filter on each page: the main advantage
is to have some filtered images which could help to make them visible for
some users.
This commit is contained in:
Calixte Denizet 2023-03-06 19:09:56 +01:00
parent 85166c60fd
commit da080cc26e
5 changed files with 181 additions and 85 deletions

View file

@ -3082,7 +3082,7 @@ class WorkerTransport {
this.fontLoader.clear();
}
this.#methodPromises.clear();
this.filterFactory.destroy();
this.filterFactory.destroy(/* keepHCM = */ true);
}
get loadingParams() {
@ -3337,7 +3337,7 @@ class InternalRenderTask {
cancel(error = null, extraDelay = 0) {
this.running = false;
this.cancelled = true;
this.gfx?.endDrawing();
this.gfx?.endDrawing(this.pageColors);
if (this._canvas) {
InternalRenderTask.#canvasInUse.delete(this._canvas);
@ -3402,7 +3402,7 @@ class InternalRenderTask {
if (this.operatorListIdx === this.operatorList.argsArray.length) {
this.running = false;
if (this.operatorList.lastChunk) {
this.gfx.endDrawing();
this.gfx.endDrawing(this.pageColors);
if (this._canvas) {
InternalRenderTask.#canvasInUse.delete(this._canvas);
}