Closed wait1210day closed 1 year ago
The memory pressure problem is going to be solved in next commit by implementing a CanvasKitTransferContext and some hacks in Skia. Two deserialization modes will be provided when deserializing an SkPicture.
The memory pressure problem has been solved in this commit. This commit introduces some new interfaces to integrate CanvasKit with native code, and cache typefaces in JavaScript world. Those changes make us modify Skia's code and compile our own specialized canvaskit.wasm, which contains some new exposed functions. However, it seems that the memory usage still increases very slowly (not caused by typeface cache), which is caused by an unknown reason. We're try to solve this problem in the future.
The memory pressure problem has been solved in this commit. This commit introduces some new interfaces to integrate CanvasKit with native code, and cache typefaces in JavaScript world. Those changes make us modify Skia's code and compile our own specialized canvaskit.wasm, which contains some new exposed functions. However, it seems that the memory usage still increases very slowly (not caused by typeface cache), which is caused by an unknown reason. We're try to solve this problem in the future.
After many tests, that problem is completely not a bug. It is caused by a wrong usage of WASM memory. Skia CanvasKit requires us to explicitly delete the objects which are allocated by new
or factory objects (see its official documentation).
For example:
const paint = new canvaskit.Paint();
paint.delete();
CanvasKit has been deprecated.
Track the process of CanvasKit integration.