comparison src/glyphs.c @ 5626:eb41da9b4469

More documentation about glyphs cache coherency problem. -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2011-12-27 Didier Verna <didier@xemacs.org> * glyphs.c (update_image_instance): * glyphs.c (image_instantiate): More comments about the current glyphs cache coherency problem.
author Didier Verna <didier@xemacs.org>
date Tue, 27 Dec 2011 21:59:03 +0100
parents 56144c8593a8
children 3192994c49ca
comparison
equal deleted inserted replaced
5625:6fa0c5fb6154 5626:eb41da9b4469
2148 Lisp_Object type = encode_image_instance_type 2148 Lisp_Object type = encode_image_instance_type
2149 (IMAGE_INSTANCE_TYPE (ii)); 2149 (IMAGE_INSTANCE_TYPE (ii));
2150 struct gcpro gcpro1; 2150 struct gcpro gcpro1;
2151 GCPRO1 (diffs); 2151 GCPRO1 (diffs);
2152 2152
2153 /* #### FIXME: in image_instantiate, somebody commented that updating
2154 process is incomplete. Here is an example: there is no update method
2155 available when updating a pixmap (AFAICS, there is only text_update).
2156 As a consequence, this code does nothing, apart from setting the
2157 dirty flag on an image instance that hasn't changed. We have this
2158 problem in 21.4 as well. See image_instantiate for more information.
2159
2160 -- dvl */
2161
2153 /* try device specific methods first ... */ 2162 /* try device specific methods first ... */
2154 meths = decode_device_ii_format (image_instance_device (image_instance), 2163 meths = decode_device_ii_format (image_instance_device (image_instance),
2155 type, ERROR_ME_NOT); 2164 type, ERROR_ME_NOT);
2156 MAYBE_IIFORMAT_METH (meths, update, (image_instance, diffs)); 2165 MAYBE_IIFORMAT_METH (meths, update, (image_instance, diffs));
2157 /* ... then format specific methods ... */ 2166 /* ... then format specific methods ... */
3439 Qunbound), instance)); 3448 Qunbound), instance));
3440 #endif 3449 #endif
3441 } 3450 }
3442 else if (NILP (instance)) 3451 else if (NILP (instance))
3443 gui_error ("Can't instantiate image (probably cached)", instantiator); 3452 gui_error ("Can't instantiate image (probably cached)", instantiator);
3453
3444 /* We found an instance. However, because we are using the glyph 3454 /* We found an instance. However, because we are using the glyph
3445 as the hash key instead of the instantiator, the current 3455 as the hash key instead of the instantiator, the current
3446 instantiator may not be the same as the original. Thus we 3456 instantiator may not be the same as the original. Thus we
3447 must update the instance based on the new 3457 must update the instance based on the new instantiator. Preserving
3448 instantiator. Preserving instance identity like this is 3458 instance identity like this is important to stop excessive window
3449 important to stop excessive window system widget creation and 3459 system widget creation and deletion - and hence flashing. */
3450 deletion - and hence flashing. */ 3460
3461 /* #### NOTE: except that it doesn't work: currently, we have very
3462 serious cache coherency problems (see the comment in
3463 update_image_instance, and the one just below). For instance, try to
3464 call set-face-background-pixmap[-file] twice and see what happens
3465 (hint: nothing). That's because update_image_instance basically
3466 doesn't work.
3467
3468 Either we fix it, or we hash on the instantiator after all. One of
3469 these days, when I feel bold, I will try that and see if we still get
3470 intolerable flashing.
3471
3472 -- dvl */
3451 else 3473 else
3452 { 3474 {
3453 /* #### This function should be able to cope with *all* 3475 /* #### This function should be able to cope with *all*
3454 changes to the instantiator, but currently only copes 3476 changes to the instantiator, but currently only copes
3455 with the most used properties. This means that it is 3477 with the most used properties. This means that it is