summaryrefslogtreecommitdiff
path: root/libview
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2026-04-10 11:30:52 -0400
committerVictor Kareh <[email protected]>2026-04-10 11:37:36 -0400
commit269e7f6c1413fd3d4724d60bc5f82324a2dbf2b6 (patch)
tree19fa5d32af59afdadad863a07ce0ab198230292d /libview
parentad7ddc952e60c09515e1ec84d5374775d73e5370 (diff)
downloadatril-master.tar.bz2
atril-master.tar.xz
libview: Account for device scale in page cache size calculationHEADmaster
On HiDPI displays, rendered pages use more memory than the cache budget expects because the size calculation does not account for the device scale factor. This causes the cache to use up to 4x more memory than configured on 2x HiDPI displays.
Diffstat (limited to 'libview')
-rw-r--r--libview/ev-pixbuf-cache.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libview/ev-pixbuf-cache.c b/libview/ev-pixbuf-cache.c
index 163267f6..d0b102f8 100644
--- a/libview/ev-pixbuf-cache.c
+++ b/libview/ev-pixbuf-cache.c
@@ -430,11 +430,14 @@ ev_pixbuf_cache_get_page_size (EvPixbufCache *pixbuf_cache,
gint rotation)
{
gint width, height;
+ gint device_scale;
+ device_scale = get_device_scale (pixbuf_cache);
_get_page_size_for_scale_and_rotation (pixbuf_cache->document,
page_index, scale, rotation,
&width, &height);
- return height * cairo_format_stride_for_width (CAIRO_FORMAT_RGB24, width);
+ return (height * device_scale) *
+ cairo_format_stride_for_width (CAIRO_FORMAT_RGB24, width * device_scale);
}
static gint