+2013-10-28 Dmitry Antipov <dmantipov@yandex.ru>
+
+ * dispextern.h (struct face): Use bitfields for 'underline_type'
+ and 'box' members. Remove set-but-unused members 'pixmap_w' and
+ 'pixmap_h'. If not HAVE_WINDOW_SYSTEM, also remove dummy
+ 'stipple' member. Move 'lface' member up to help...
+ * xfaces.c (make_realized_face): ...this function to find and
+ clear just the members that need clearing.
+ (load_face_colors, realize_x_face):
+ * xdisp.c (extend_face_to_end_of_line): Adjust user.
+
2013-10-27 Dmitry Antipov <dmantipov@yandex.ru>
* xftfont.c (struct xftfont_info): Remove set-but-unused
struct face
{
+ /* The Lisp face attributes this face realizes. All attributes
+ in this vector are non-nil. */
+ Lisp_Object lface[LFACE_VECTOR_SIZE];
+
/* The id of this face. The id equals the index of this face in the
vector faces_by_id of its face cache. */
int id;
an id as returned from load_pixmap. */
ptrdiff_t stipple;
-#else /* not HAVE_WINDOW_SYSTEM */
-
- /* Dummy. */
- ptrdiff_t stipple;
-
#endif /* not HAVE_WINDOW_SYSTEM */
/* Pixel value of foreground color for X frames. Color index
from the same ASCII face have the same fontset. */
int fontset;
- /* Pixmap width and height. */
- unsigned int pixmap_w, pixmap_h;
-
/* Non-zero means characters in this face have a box of that
thickness around them. If this value is negative, its absolute
value indicates the thickness, and the horizontal (top and
of width box_line_width is drawn in color box_color. A value of
FACE_RAISED_BOX or FACE_SUNKEN_BOX means a 3D box is drawn with
shadow colors derived from the background color of the face. */
- enum face_box_type box;
+ ENUM_BF (face_box_type) box : 2;
/* Style of underlining. */
- enum face_underline_type underline_type;
+ ENUM_BF (face_underline_type) underline_type : 1;
/* If `box' above specifies a 3D type, 1 means use box_color for
drawing shadows. */
unsigned synth_ital : 1;
#endif
- /* The Lisp face attributes this face realizes. All attributes
- in this vector are non-nil. */
- Lisp_Object lface[LFACE_VECTOR_SIZE];
-
/* The hash value of this face. */
unsigned hash;
&& MATRIX_ROW_DISPLAYS_TEXT_P (it->glyph_row)
&& face->box == FACE_NO_BOX
&& face->background == FRAME_BACKGROUND_PIXEL (f)
+#ifdef HAVE_WINDOW_SYSTEM
&& !face->stipple
+#endif
&& !it->glyph_row->reversed_p)
return;
&& !NILP (Fbitmap_spec_p (Vface_default_stipple)))
{
x_destroy_bitmap (f, face->stipple);
- face->stipple = load_pixmap (f, Vface_default_stipple,
- &face->pixmap_w, &face->pixmap_h);
+ face->stipple = load_pixmap (f, Vface_default_stipple, NULL, NULL);
}
face->background = load_color (f, face, bg, LFACE_BACKGROUND_INDEX);
static struct face *
make_realized_face (Lisp_Object *attr)
{
- struct face *face = xzalloc (sizeof *face);
- face->ascii_face = face;
+ enum { off = offsetof (struct face, id) };
+ struct face *face = xmalloc (sizeof *face);
+
memcpy (face->lface, attr, sizeof face->lface);
+ memset (&face->id, 0, sizeof *face - off);
+ face->ascii_face = face;
+
return face;
}
stipple = attrs[LFACE_STIPPLE_INDEX];
if (!NILP (stipple))
- face->stipple = load_pixmap (f, stipple, &face->pixmap_w, &face->pixmap_h);
+ face->stipple = load_pixmap (f, stipple, NULL, NULL);
#endif /* HAVE_WINDOW_SYSTEM */
return face;