https://bugs.documentfoundation.org/show_bug.cgi?id=166994
Patrick (volunteer) <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #7 from Patrick (volunteer) <[email protected]> --- So I think I have found the cause of this bug: the Skia image cache is too small. In the following debug patch, I increased the Skia image cache from 64 MB to 512 MB and the bug disappears. With macOS Retina displays, we need the cache to be at least 4 times larger to handle "each screen pixel is really backed by a 2x2 square of subpixels" to hold the same set of images as Windows and Linux. Still, 4 times larger wasn't enough and I had to double the cache since to 8 times larger. The reason we need such a larger increase in the image cache size is that drawing images with a separate alpha channel is very slow with Skia/Raster. Specifically, the blending of the bitmap and a separate alpha channel in SkiaSalGraphicsImpl::mergeCacheBitmaps() is slow so such images are cached. Problem is that the image that is being moved is large and once the cache is full, each image has to be reblended and drawn after every single key press. However, I am not sure if making the Skia image cache size so large good idea or not. I wonder if there is something else that can be done to cache the blended bitmap and alpha channels but maybe that would end up using a lot more memory than just increasing the cache size: diff --git a/vcl/skia/SkiaHelper.cxx b/vcl/skia/SkiaHelper.cxx index 7dcd5c41bc5a..4d18dbe1dff8 100644 --- a/vcl/skia/SkiaHelper.cxx +++ b/vcl/skia/SkiaHelper.cxx @@ -730,7 +730,7 @@ void removeCachedImage(sk_sp<SkImage> image) tools::Long maxImageCacheSize() { // Defaults to 4x 2000px 32bpp images, 64MiB. - return officecfg::Office::Common::Cache::Skia::ImageCacheSize::get(); + return officecfg::Office::Common::Cache::Skia::ImageCacheSize::get() * 8; } static o3tl::lru_map<uint32_t, uint32_t> checksumCache(256); -- You are receiving this mail because: You are the assignee for the bug.
