diff options
| author | Dmitry Antipov | 2013-10-28 14:58:01 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-10-28 14:58:01 +0400 |
| commit | 5d3311e5bb8fba7a8151cc79d6651488946ac19d (patch) | |
| tree | b235807af76f6a3b7856b5433fef9f45b6c91ef3 /src | |
| parent | 6f81ab324c6c62c34b737f93ae54fd7e71ddf59f (diff) | |
| download | emacs-5d3311e5bb8fba7a8151cc79d6651488946ac19d.tar.gz emacs-5d3311e5bb8fba7a8151cc79d6651488946ac19d.zip | |
* 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/ChangeLog | 11 | ||||
| -rw-r--r-- | src/dispextern.h | 20 | ||||
| -rw-r--r-- | src/xdisp.c | 2 | ||||
| -rw-r--r-- | src/xfaces.c | 13 |
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 @@ | |||
| 1 | 2013-10-28 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * dispextern.h (struct face): Use bitfields for 'underline_type' | ||
| 4 | and 'box' members. Remove set-but-unused members 'pixmap_w' and | ||
| 5 | 'pixmap_h'. If not HAVE_WINDOW_SYSTEM, also remove dummy | ||
| 6 | 'stipple' member. Move 'lface' member up to help... | ||
| 7 | * xfaces.c (make_realized_face): ...this function to find and | ||
| 8 | clear just the members that need clearing. | ||
| 9 | (load_face_colors, realize_x_face): | ||
| 10 | * xdisp.c (extend_face_to_end_of_line): Adjust user. | ||
| 11 | |||
| 1 | 2013-10-27 Dmitry Antipov <dmantipov@yandex.ru> | 12 | 2013-10-27 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 13 | ||
| 3 | * xftfont.c (struct xftfont_info): Remove set-but-unused | 14 | * 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 | |||
| 1581 | 1581 | ||
| 1582 | struct face | 1582 | struct face |
| 1583 | { | 1583 | { |
| 1584 | /* The Lisp face attributes this face realizes. All attributes | ||
| 1585 | in this vector are non-nil. */ | ||
| 1586 | Lisp_Object lface[LFACE_VECTOR_SIZE]; | ||
| 1587 | |||
| 1584 | /* The id of this face. The id equals the index of this face in the | 1588 | /* The id of this face. The id equals the index of this face in the |
| 1585 | vector faces_by_id of its face cache. */ | 1589 | vector faces_by_id of its face cache. */ |
| 1586 | int id; | 1590 | int id; |
| @@ -1595,11 +1599,6 @@ struct face | |||
| 1595 | an id as returned from load_pixmap. */ | 1599 | an id as returned from load_pixmap. */ |
| 1596 | ptrdiff_t stipple; | 1600 | ptrdiff_t stipple; |
| 1597 | 1601 | ||
| 1598 | #else /* not HAVE_WINDOW_SYSTEM */ | ||
| 1599 | |||
| 1600 | /* Dummy. */ | ||
| 1601 | ptrdiff_t stipple; | ||
| 1602 | |||
| 1603 | #endif /* not HAVE_WINDOW_SYSTEM */ | 1602 | #endif /* not HAVE_WINDOW_SYSTEM */ |
| 1604 | 1603 | ||
| 1605 | /* Pixel value of foreground color for X frames. Color index | 1604 | /* Pixel value of foreground color for X frames. Color index |
| @@ -1624,9 +1623,6 @@ struct face | |||
| 1624 | from the same ASCII face have the same fontset. */ | 1623 | from the same ASCII face have the same fontset. */ |
| 1625 | int fontset; | 1624 | int fontset; |
| 1626 | 1625 | ||
| 1627 | /* Pixmap width and height. */ | ||
| 1628 | unsigned int pixmap_w, pixmap_h; | ||
| 1629 | |||
| 1630 | /* Non-zero means characters in this face have a box of that | 1626 | /* Non-zero means characters in this face have a box of that |
| 1631 | thickness around them. If this value is negative, its absolute | 1627 | thickness around them. If this value is negative, its absolute |
| 1632 | value indicates the thickness, and the horizontal (top and | 1628 | value indicates the thickness, and the horizontal (top and |
| @@ -1640,10 +1636,10 @@ struct face | |||
| 1640 | of width box_line_width is drawn in color box_color. A value of | 1636 | of width box_line_width is drawn in color box_color. A value of |
| 1641 | FACE_RAISED_BOX or FACE_SUNKEN_BOX means a 3D box is drawn with | 1637 | FACE_RAISED_BOX or FACE_SUNKEN_BOX means a 3D box is drawn with |
| 1642 | shadow colors derived from the background color of the face. */ | 1638 | shadow colors derived from the background color of the face. */ |
| 1643 | enum face_box_type box; | 1639 | ENUM_BF (face_box_type) box : 2; |
| 1644 | 1640 | ||
| 1645 | /* Style of underlining. */ | 1641 | /* Style of underlining. */ |
| 1646 | enum face_underline_type underline_type; | 1642 | ENUM_BF (face_underline_type) underline_type : 1; |
| 1647 | 1643 | ||
| 1648 | /* If `box' above specifies a 3D type, 1 means use box_color for | 1644 | /* If `box' above specifies a 3D type, 1 means use box_color for |
| 1649 | drawing shadows. */ | 1645 | drawing shadows. */ |
| @@ -1695,10 +1691,6 @@ struct face | |||
| 1695 | unsigned synth_ital : 1; | 1691 | unsigned synth_ital : 1; |
| 1696 | #endif | 1692 | #endif |
| 1697 | 1693 | ||
| 1698 | /* The Lisp face attributes this face realizes. All attributes | ||
| 1699 | in this vector are non-nil. */ | ||
| 1700 | Lisp_Object lface[LFACE_VECTOR_SIZE]; | ||
| 1701 | |||
| 1702 | /* The hash value of this face. */ | 1694 | /* The hash value of this face. */ |
| 1703 | unsigned hash; | 1695 | unsigned hash; |
| 1704 | 1696 | ||
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) | |||
| 18615 | && MATRIX_ROW_DISPLAYS_TEXT_P (it->glyph_row) | 18615 | && MATRIX_ROW_DISPLAYS_TEXT_P (it->glyph_row) |
| 18616 | && face->box == FACE_NO_BOX | 18616 | && face->box == FACE_NO_BOX |
| 18617 | && face->background == FRAME_BACKGROUND_PIXEL (f) | 18617 | && face->background == FRAME_BACKGROUND_PIXEL (f) |
| 18618 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 18618 | && !face->stipple | 18619 | && !face->stipple |
| 18620 | #endif | ||
| 18619 | && !it->glyph_row->reversed_p) | 18621 | && !it->glyph_row->reversed_p) |
| 18620 | return; | 18622 | return; |
| 18621 | 18623 | ||
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, | |||
| 1298 | && !NILP (Fbitmap_spec_p (Vface_default_stipple))) | 1298 | && !NILP (Fbitmap_spec_p (Vface_default_stipple))) |
| 1299 | { | 1299 | { |
| 1300 | x_destroy_bitmap (f, face->stipple); | 1300 | x_destroy_bitmap (f, face->stipple); |
| 1301 | face->stipple = load_pixmap (f, Vface_default_stipple, | 1301 | face->stipple = load_pixmap (f, Vface_default_stipple, NULL, NULL); |
| 1302 | &face->pixmap_w, &face->pixmap_h); | ||
| 1303 | } | 1302 | } |
| 1304 | 1303 | ||
| 1305 | face->background = load_color (f, face, bg, LFACE_BACKGROUND_INDEX); | 1304 | 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) | |||
| 4018 | static struct face * | 4017 | static struct face * |
| 4019 | make_realized_face (Lisp_Object *attr) | 4018 | make_realized_face (Lisp_Object *attr) |
| 4020 | { | 4019 | { |
| 4021 | struct face *face = xzalloc (sizeof *face); | 4020 | enum { off = offsetof (struct face, id) }; |
| 4022 | face->ascii_face = face; | 4021 | struct face *face = xmalloc (sizeof *face); |
| 4022 | |||
| 4023 | memcpy (face->lface, attr, sizeof face->lface); | 4023 | memcpy (face->lface, attr, sizeof face->lface); |
| 4024 | memset (&face->id, 0, sizeof *face - off); | ||
| 4025 | face->ascii_face = face; | ||
| 4026 | |||
| 4024 | return face; | 4027 | return face; |
| 4025 | } | 4028 | } |
| 4026 | 4029 | ||
| @@ -5716,7 +5719,7 @@ realize_x_face (struct face_cache *cache, Lisp_Object attrs[LFACE_VECTOR_SIZE]) | |||
| 5716 | 5719 | ||
| 5717 | stipple = attrs[LFACE_STIPPLE_INDEX]; | 5720 | stipple = attrs[LFACE_STIPPLE_INDEX]; |
| 5718 | if (!NILP (stipple)) | 5721 | if (!NILP (stipple)) |
| 5719 | face->stipple = load_pixmap (f, stipple, &face->pixmap_w, &face->pixmap_h); | 5722 | face->stipple = load_pixmap (f, stipple, NULL, NULL); |
| 5720 | #endif /* HAVE_WINDOW_SYSTEM */ | 5723 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 5721 | 5724 | ||
| 5722 | return face; | 5725 | return face; |