Improve performance of reused patterns.

Bug 1721218 has a shading pattern that was used thousands of times.
To improve performance of this PDF:
 - add a cache for patterns in the evaluator and only send the IR form once
   to the main thread (this also makes caching in canvas easier)
 - cache the created canvas radial/axial patterns
 - for shading fill radial/axial use the pattern directly instead of creating temporary
   canvas
This commit is contained in:
Brendan Dahl 2021-07-21 12:27:39 -07:00
parent 2cf90cd9ad
commit da1af02ac8
7 changed files with 121 additions and 59 deletions

View file

@ -2707,6 +2707,9 @@ class WorkerTransport {
pageProxy.cleanupAfterRender = true;
}
break;
case "Pattern":
pageProxy.objs.resolve(id, imageData);
break;
default:
throw new Error(`Got unknown object type ${type}`);
}