all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: emacs-devel@gnu.org
Subject: Re: redisplay and expose_frame
Date: Wed, 25 Jul 2018 18:33:35 +0900	[thread overview]
Message-ID: <wlbmav1wy8.wl-mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <20180724204220.GA9687@breton.holly.idiocy.org>

On Wed, 25 Jul 2018 05:42:20 +0900,
Alan Third wrote:

> > > The background here is that I’m working on splitting the NS port’s GUI
> > > code into its own thread, and while working on that I noticed that
> > > Apple have deprecated the method we use to draw, so I thought that
> > > since I’m working with the code anyway, I may as well try to
> > > ‘modernise’ it.
> > 
> > A related thread can be found around
> > http://lists.gnu.org/archive/html/emacs-devel/2010-07/msg00821.html .
> 
> That’s interesting, and confirms some of what I’d thought. I take it
> nothing ever came of it, though?

AFAIK, nothing public.  It's been difficult for me to tell how
important the "expose" handler is to developers on other platforms
(e.g., the thread starting from
http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00392.html).

> > Mojave, the next version of macOS, already prohibits drawing outside
> > "drawRect:" by default if the executable was linked on that version.
> > An attempt to draw outside "drawRect:" triggers invalidation of all
> > the contents instead, and it is completely redrawn (even for a single
> > cursor movement) via "drawRect:" at the next cycle of the event loop.
> > This is kinda usable for small frames on recent machines, but not
> > efficient of course, especially for full screen frames.
> 
> This doesn’t sound good, and I wonder if bug#31904 is related,
> although it doesn’t sound like it should be.
> 
> Is the Mac port affected by this, or does it avoid this Cocoa stuff?

There were several problems, but non-performance issues are mostly
solved in the "work" branch of the Mac port repository
(https://bitbucket.org/mituharu/emacs-mac).  It now works as in a
"kinda usable" way with the whole invalidation mentioned above.

> I suppose, to avoid changes in redisplay code, I could make the NS
> drawing functions detect whether they are running in the main thread
> (or perhaps they can just ask whether they’re able to draw or not),
> and if they’re not then invalidate the relevant rectangle, and if they
> are then do the actual drawing task.
> 
> Then call display for each frame to force an expose ‘event’ at the end
> of redisplay.

Back in early 2007, I privately experimented something like that
(without threading) with "modern Carbon" (HIWindow), where drawing
outside the "expose" callback was deprecated like the current
situation for Cocoa.  I could actually find a platform-independent bug
that was otherwise difficult to find/reproduce
(http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg01279.html)
by this experiment, but the overall performance was not quite
satisfactory then.  So, I was surprised to see that (the "work" branch
of) the Mac port with the whole invalidation was "kinda usable" on
recent machines running Mojave.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp




  reply	other threads:[~2018-07-25  9:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-22 12:44 redisplay and expose_frame Alan Third
2018-07-22 14:37 ` Eli Zaretskii
2018-07-23  9:58 ` YAMAMOTO Mitsuharu
2018-07-24 20:42   ` Alan Third
2018-07-25  9:33     ` YAMAMOTO Mitsuharu [this message]
2018-08-04 16:19       ` Alan Third

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=wlbmav1wy8.wl-mituharu@math.s.chiba-u.ac.jp \
    --to=mituharu@math.s.chiba-u.ac.jp \
    --cc=emacs-devel@gnu.org \
    /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.