From: Alan Third <alan@idiocy.org>
To: Po Lu <luangruo@yahoo.com>
Cc: 51411@debbugs.gnu.org
Subject: bug#51411: NS port cleanups
Date: Wed, 27 Oct 2021 18:20:34 +0100 [thread overview]
Message-ID: <YXmKYrb35F3N4rag@idiocy.org> (raw)
In-Reply-To: <87h7d4t0er.fsf@yahoo.com>
On Tue, Oct 26, 2021 at 08:50:52PM +0800, Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote:
> Alan Third <alan@idiocy.org> writes:
>
> > Is this the code in ns_draw_glyph_string?
>
> Yes, it is.
That function is a real mess of calls to ns_focus and ns_unfocus. I
think there's no good reason for them to be called as often as they
are, and some related functions (ns_dumpglyphs_stretch) don't need to
call them themselves either.
I think we need to have a rethink of how clipping is handled here. We
don't need to use ns_focus to clip and we repeatedly call ns_focus on
the same rectangle. For a lot of those calls we could replace them
with a single clipping rectangle and adjust it as required for
overhangs or whatever.
I also think you misunderstood what I was saying about the performance
problems with calling saveGraphicsState. Calling it when not required
is frowned upon by Apple as they say it causes performance problems.
Your code is now calling it in ns_focus whether it's required or not.
Ideally we only call it when modifying the clipping rectangle, because
there are times ns_focus is called where we don't modify the clipping
rectangle and therefore we don't need to save the graphics context.
I understand what you did, but I think the better solution is for us
is to try to untangle ns_draw_glyph_string, even if that means saving
the context there directly on occasion.
If you want me to have a look at it let me know, I think I know what
needs to be done, but I probably won't get round to it as soon as you
could.
--
Alan Third
next prev parent reply other threads:[~2021-10-27 17:20 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87mtmwt3mc.fsf.ref@yahoo.com>
2021-10-26 11:41 ` bug#51411: NS port cleanups Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-26 12:39 ` Alan Third
2021-10-26 12:50 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-27 17:20 ` Alan Third [this message]
2021-10-28 1:09 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-28 10:17 ` Alan Third
2021-10-28 11:25 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-31 10:22 ` Alan Third
2021-10-31 10:34 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-31 10:54 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-31 10:59 ` Alan Third
2021-10-31 11:20 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-31 11:26 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-31 12:55 ` Alan Third
2021-10-31 13:12 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-05 7:44 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-06 0:20 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-06 13:02 ` Alan Third
[not found] <CADwFkmnHko5UrsuNBKjTtt1LjgXet37zP+U9DTMv++njRHePmQ@mail.gmail.com>
2021-10-31 2:38 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-31 2:56 ` Stefan Kangas
2021-10-31 3:13 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-31 3:59 ` Stefan Kangas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YXmKYrb35F3N4rag@idiocy.org \
--to=alan@idiocy.org \
--cc=51411@debbugs.gnu.org \
--cc=luangruo@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.