summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2013-10-28 14:58:01 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2013-10-28 14:58:01 +0400
commit5d3311e5bb8fba7a8151cc79d6651488946ac19d (patch)
treeb235807af76f6a3b7856b5433fef9f45b6c91ef3 /src
parent6f81ab324c6c62c34b737f93ae54fd7e71ddf59f (diff)
downloademacs-5d3311e5bb8fba7a8151cc79d6651488946ac19d.tar.gz
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog11
-rw-r--r--src/dispextern.h20
-rw-r--r--src/xdisp.c2
-rw-r--r--src/xfaces.c13
4 files changed, 27 insertions, 19 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d6f258ed156..43ea7266bef 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
+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
diff --git a/src/dispextern.h b/src/dispextern.h
index 681eba25cb3..c312fab448d 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1581,6 +1581,10 @@ enum face_underline_type
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;
@@ -1595,11 +1599,6 @@ struct face
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
@@ -1624,9 +1623,6 @@ struct face
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
@@ -1640,10 +1636,10 @@ struct face
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. */
@@ -1695,10 +1691,6 @@ struct face
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;
diff --git a/src/xdisp.c b/src/xdisp.c
index 395a74e4122..d62bc6ba96c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -18615,7 +18615,9 @@ extend_face_to_end_of_line (struct it *it)
&& 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;
diff --git a/src/xfaces.c b/src/xfaces.c
index 363d3bb0784..c0f5c45ec54 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -1298,8 +1298,7 @@ load_face_colors (struct frame *f, struct face *face,
&& !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);
@@ -4018,9 +4017,13 @@ lface_same_font_attributes_p (Lisp_Object *lface1, Lisp_Object *lface2)
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;
}
@@ -5716,7 +5719,7 @@ realize_x_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE])
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;