comparison src/redisplay-output.c @ 406:b8cc9ab3f761 r21-2-33

Import from CVS: tag r21-2-33
author cvs
date Mon, 13 Aug 2007 11:17:09 +0200
parents 2f8bb876ab1d
children 501cfd01ee6d
comparison
equal deleted inserted replaced
405:0e08f63c74d2 406:b8cc9ab3f761
231 !EQ (crb->object.dglyph.extent, drb->object.dglyph.extent) || 231 !EQ (crb->object.dglyph.extent, drb->object.dglyph.extent) ||
232 crb->object.dglyph.xoffset != drb->object.dglyph.xoffset)) 232 crb->object.dglyph.xoffset != drb->object.dglyph.xoffset))
233 return 0; 233 return 0;
234 /* Only check dirtiness if we know something has changed. */ 234 /* Only check dirtiness if we know something has changed. */
235 else if (crb->type == RUNE_DGLYPH && 235 else if (crb->type == RUNE_DGLYPH &&
236 ((XFRAME (w->frame)->glyphs_changed && 236 (XGLYPH_DIRTYP (crb->object.dglyph.glyph) ||
237 XGLYPH_DIRTYP (crb->object.dglyph.glyph)) ||
238 crb->findex != drb->findex)) 237 crb->findex != drb->findex))
239 { 238 {
240 /* We need some way of telling redisplay_output_layout () that the 239 /* We need some way of telling redisplay_output_layout () that the
241 only reason we are outputting it is because something has 240 only reason we are outputting it is because something has
242 changed internally. That way we can optimize whether we need 241 changed internally. That way we can optimize whether we need
260 259
261 /* It is quite common of the two glyphs to be EQ since in many 260 /* It is quite common of the two glyphs to be EQ since in many
262 cases they will actually be the same object. This does not 261 cases they will actually be the same object. This does not
263 mean, however, that nothing has changed. We therefore need to 262 mean, however, that nothing has changed. We therefore need to
264 check the current hash of the glyph against the last recorded 263 check the current hash of the glyph against the last recorded
265 display hash. See update_subwindow (). */ 264 display hash and the pending display items. See
266 if (IMAGE_INSTANCE_DISPLAY_HASH (ii) == 0 || 265 update_subwindow (). */
267 IMAGE_INSTANCE_DISPLAY_HASH (ii) != 266 if (image_instance_changed (image) ||
268 internal_hash (image, IMAGE_INSTANCE_HASH_DEPTH) ||
269 crb->findex != drb->findex || 267 crb->findex != drb->findex ||
270 WINDOW_FACE_CACHEL_DIRTY (w, drb->findex)) 268 WINDOW_FACE_CACHEL_DIRTY (w, drb->findex))
271 { 269 {
272 /* We now now we are going to re-output the glyph, but since 270 /* We now now we are going to re-output the glyph, but since
273 this is for some internal reason not related to geometry 271 this is for some internal reason not related to geometry
281 of this are.*/ 279 of this are.*/
282 IMAGE_INSTANCE_OPTIMIZE_OUTPUT (ii) = 1; 280 IMAGE_INSTANCE_OPTIMIZE_OUTPUT (ii) = 1;
283 return 0; 281 return 0;
284 } 282 }
285 else 283 else
286 return 1; 284 {
285 #ifdef DEBUG_WIDGET_OUTPUT
286 if (XIMAGE_INSTANCE_TYPE (image) == IMAGE_LAYOUT)
287 printf ("glyph layout %p considered unchanged\n", ii);
288 #endif
289 return 1;
290 }
287 } 291 }
288 /* We now do this last so that glyph checks can do their own thing 292 /* We now do this last so that glyph checks can do their own thing
289 for face changes. Face changes quite often happen when we are 293 for face changes. Face changes quite often happen when we are
290 trying to output something in the gutter, this would normally 294 trying to output something in the gutter, this would normally
291 lead to a lot of flashing. The indices can quite often be 295 lead to a lot of flashing. The indices can quite often be
896 return 1; 900 return 1;
897 } 901 }
898 else 902 else
899 { 903 {
900 DEVMETH (d, output_begin, (d)); 904 DEVMETH (d, output_begin, (d));
901 905 rb->cursor_type = CURSOR_OFF;
902 /* #### This is a gross kludge. Cursor handling is such a royal
903 pain in the ass. */
904 if (rb->type == RUNE_DGLYPH &&
905 (EQ (rb->object.dglyph.glyph, Vtruncation_glyph) ||
906 EQ (rb->object.dglyph.glyph, Vcontinuation_glyph)))
907 rb->cursor_type = NO_CURSOR;
908 else
909 rb->cursor_type = CURSOR_OFF;
910 dl->cursor_elt = -1; 906 dl->cursor_elt = -1;
911 output_display_line (w, 0, cla, y, rb->xpos, rb->xpos + rb->width); 907 output_display_line (w, 0, cla, y, rb->xpos, rb->xpos + rb->width);
912 } 908 }
913 909
914 w->last_point_x[CURRENT_DISP] = -1; 910 w->last_point_x[CURRENT_DISP] = -1;
1299 layout_height = glyph_height (image_instance, window); 1295 layout_height = glyph_height (image_instance, window);
1300 layout_width = glyph_width (image_instance, window); 1296 layout_width = glyph_width (image_instance, window);
1301 1297
1302 dga->height = layout_height; 1298 dga->height = layout_height;
1303 dga->width = layout_width; 1299 dga->width = layout_width;
1304 1300 #ifdef DEBUG_WIDGET_OUTPUT
1301 printf ("outputing layout glyph %p\n", p);
1302 #endif
1305 /* This makes the glyph area fit into the display area. */ 1303 /* This makes the glyph area fit into the display area. */
1306 if (!redisplay_normalize_glyph_area (db, dga)) 1304 if (!redisplay_normalize_glyph_area (db, dga))
1307 return; 1305 return;
1308 1306
1309 /* Highly dodgy optimization. We want to only output the whole 1307 /* Highly dodgy optimization. We want to only output the whole
1404 || cdb.xpos + cdb.width > db->xpos + db->width 1402 || cdb.xpos + cdb.width > db->xpos + db->width
1405 || cdb.ypos + cdb.height > db->ypos + db->height) 1403 || cdb.ypos + cdb.height > db->ypos + db->height)
1406 continue; 1404 continue;
1407 /* We have to invert the offset here as normalization 1405 /* We have to invert the offset here as normalization
1408 will have made them positive which the output 1406 will have made them positive which the output
1409 routines will treat as a truely +ve offset. */ 1407 routines will treat as a truly +ve offset. */
1410 cdga.xoffset = -cdga.xoffset; 1408 cdga.xoffset = -cdga.xoffset;
1411 cdga.yoffset = -cdga.yoffset; 1409 cdga.yoffset = -cdga.yoffset;
1412 1410
1413 switch (IMAGE_INSTANCE_TYPE (childii)) 1411 switch (IMAGE_INSTANCE_TYPE (childii))
1414 { 1412 {
1422 IMAGE_INSTANCE_DIRTYP (childii))) 1420 IMAGE_INSTANCE_DIRTYP (childii)))
1423 { 1421 {
1424 struct display_line dl; /* this is fake */ 1422 struct display_line dl; /* this is fake */
1425 Lisp_Object string = 1423 Lisp_Object string =
1426 IMAGE_INSTANCE_TEXT_STRING (childii); 1424 IMAGE_INSTANCE_TEXT_STRING (childii);
1425 unsigned char charsets[NUM_LEADING_BYTES];
1426 struct face_cachel *cachel = WINDOW_FACE_CACHEL (w, findex);
1427
1428 find_charsets_in_bufbyte_string (charsets,
1429 XSTRING_DATA (string),
1430 XSTRING_LENGTH (string));
1431 ensure_face_cachel_complete (cachel, window, charsets);
1432
1427 convert_bufbyte_string_into_emchar_dynarr 1433 convert_bufbyte_string_into_emchar_dynarr
1428 (XSTRING_DATA (string), XSTRING_LENGTH (string), buf); 1434 (XSTRING_DATA (string), XSTRING_LENGTH (string), buf);
1429 1435
1430 redisplay_normalize_display_box (&cdb, &cdga); 1436 redisplay_normalize_display_box (&cdb, &cdga);
1431 /* Offsets are now +ve again so be careful 1437 /* Offsets are now +ve again so be careful