CanvasKit: Performance Issues and MipMap Usage in Canvaskit

159 views
Skip to first unread message

남세현

unread,
Aug 12, 2023, 6:54:33 AM8/12/23
to skia-discuss
Hello. I am trying to draw a lot of images using CanvasKit for purposes such as creating an image editor or a browser. I am encountering a phenomenon where the performance suddenly drops when opening many images and using MipMaps.

The slowdown seems to start when the number of images being drawn on the screen reaches around 20, and the total number of pixels reaches approximately 51,497,487 pixels. Both the FilterMode and MipMap are set to Linear, and all images are loaded as Web ImageBitmap using MakeLazyImageFromTextureSource. The size of the images is around 2000 x 1000.

It was fine when there were 14 full-color JPG images and 5 grayscale PNG images.
However, when the number of PNG images increased, the slowdown issue occurred.
When there were 0 JPG images and 42 grayscale PNG images, there was no slowdown at all.
Disabling MipMaps also resolves the issue.

Considering that grayscale images don't cause slowdowns and that turning off MipMaps also resolves the problem, it seems that the issue might not be solely related to the number of image pixels. Could you please advise what might be the problem?

I understand MipMaps as a feature that creates thumbnails, so I thought enabling MipMaps would reduce the load and help render a large number of images. Am I misunderstanding? Do I need to manually create thumbnails and cache them for use?

Данил Буланов

unread,
Nov 19, 2023, 8:49:51 AM11/19/23
to skia-discuss
Hello, I encountered the same problem recently, did you find any solution for this problem?

суббота, 12 августа 2023 г. в 13:54:33 UTC+3, skatpg...@gmail.com:
Reply all
Reply to author
Forward
0 new messages