aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPo Lu2024-06-20 17:03:36 +0800
committerPo Lu2024-06-20 17:03:36 +0800
commitcebca072c33937b84995a62c35c16441d23bb86d (patch)
treee1bf28f6453a63a4d0eafa4757e4f65230e2338f /src/alloc.c
parent374f4235d5e78def23d92b05f3d0257c1f609725 (diff)
downloademacs-cebca072c33937b84995a62c35c16441d23bb86d.tar.gz
emacs-cebca072c33937b84995a62c35c16441d23bb86d.zip
Correctly cache images when frames vary in their font metrics
* src/alloc.c (mark_frame): Mark this frame's image cache, if it exist. (mark_terminals): Cease marking T->image_cache. * src/androidfns.c (unwind_create_frame, Fx_create_frame) (android_create_tip_frame): * src/haikufns.c (unwind_create_frame, haiku_create_frame) (haiku_create_tip_frame): * src/nsfns.m (unwind_create_frame): * src/pgtkfns.c (unwind_create_frame, Fx_create_frame) (x_create_tip_frame): * src/xfns.c (unwind_create_frame, Fx_create_frame) (x_create_tip_frame): * src/w32fns.c (unwind_create_frame, Fx_create_frame) (w32_create_tip_frame): Remove adjustments of the frame image cache's reference count rendered redundant by the assignment of image caches to individual frames rather than terminals. * src/dispextern.h (struct image_cache) <scaling_col_width>: New field. * src/frame.c (gui_set_font): In lieu of clearing F's image cache unconditionally, establish whether the column width as considered by compute_image_size has changed, and if so, adjust or reassign the frame's image cache. (make_frame): Clear F->image_cache. * src/frame.h (struct frame) <image_cache>: New field. (FRAME_IMAGE_CACHE): Return F->image_cache. * src/image.c (make_image_cache): Clear C->scaling_col_width. (cache_image): Adjust to new means of assigning image caches to frames. * src/termhooks.h (struct terminal) <image_cache>: Delete field. * src/xfaces.c (init_frame_faces): Do image cache assignment with all new frames.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 9304e4e42bb..666f77bfce1 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -7055,6 +7055,13 @@ mark_frame (struct Lisp_Vector *ptr)
7055 for (tem = f->conversion.actions; tem; tem = tem->next) 7055 for (tem = f->conversion.actions; tem; tem = tem->next)
7056 mark_object (tem->data); 7056 mark_object (tem->data);
7057#endif 7057#endif
7058
7059#ifdef HAVE_WINDOW_SYSTEM
7060 /* Mark this frame's image cache, though it might be common to several
7061 frames with the same font size. */
7062 if (FRAME_IMAGE_CACHE (f))
7063 mark_image_cache (FRAME_IMAGE_CACHE (f));
7064#endif /* HAVE_WINDOW_SYSTEM */
7058} 7065}
7059 7066
7060static void 7067static void
@@ -7515,12 +7522,6 @@ mark_terminals (void)
7515 for (t = terminal_list; t; t = t->next_terminal) 7522 for (t = terminal_list; t; t = t->next_terminal)
7516 { 7523 {
7517 eassert (t->name != NULL); 7524 eassert (t->name != NULL);
7518#ifdef HAVE_WINDOW_SYSTEM
7519 /* If a terminal object is reachable from a stacpro'ed object,
7520 it might have been marked already. Make sure the image cache
7521 gets marked. */
7522 mark_image_cache (t->image_cache);
7523#endif /* HAVE_WINDOW_SYSTEM */
7524 if (!vectorlike_marked_p (&t->header)) 7525 if (!vectorlike_marked_p (&t->header))
7525 mark_vectorlike (&t->header); 7526 mark_vectorlike (&t->header);
7526 } 7527 }