* Need to check face_id < BASIC_FACE_ID_SENTINEL in get_*_face_and_encoding?
@ 2006-02-06 11:54 YAMAMOTO Mitsuharu
0 siblings, 0 replies; only message in thread
From: YAMAMOTO Mitsuharu @ 2006-02-06 11:54 UTC (permalink / raw)
When I was profiling display code, I noticed that rif->encode_char is
often called from get_char_face_and_encoding if many faces are used.
else if (c < 128 && face_id < BASIC_FACE_ID_SENTINEL)
{
/* Case of ASCII in a face known to fit ASCII. */
STORE_XCHAR2B (char2b, 0, c);
}
else
{
int c1, c2, charset;
/* Split characters into bytes. If c2 is -1 afterwards, C is
really a one-byte character so that byte1 is zero. */
SPLIT_CHAR (c, charset, c1, c2);
if (c2 > 0)
STORE_XCHAR2B (char2b, c1, c2);
else
STORE_XCHAR2B (char2b, 0, c1);
/* Maybe encode the character in *CHAR2B. */
if (face->font != NULL)
{
struct font_info *font_info
= FONT_INFO_FROM_ID (f, face->font_info_id);
if (font_info)
rif->encode_char (c, char2b, font_info, 0);
}
}
First I thought that `if (face->font != NULL)' above could be changed
to `if (charset != CHARSET_ASCII && face->font != NULL)' because the
added condition had been there until the change
http://cvs.savannah.gnu.org/viewcvs/emacs/src/xterm.c?root=emacs&r1=1.494&r2=1.495,
But if `&& face_id < BASIC_FACE_ID_SENTINEL' in the outer `if' can be
removed, then that would be much simpler and similar change might also
be applied to get_glyph_face_and_encoding. Do we need to check
whether face_id is less than BASIC_FACE_ID_SENTINEL here?
YAMAMOTO Mitsuharu
mituharu@math.s.chiba-u.ac.jp
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-02-06 11:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-06 11:54 Need to check face_id < BASIC_FACE_ID_SENTINEL in get_*_face_and_encoding? YAMAMOTO Mitsuharu
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).