all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: "Charles A. Roelli" <charles@aurox.ch>
Cc: emacs-devel@gnu.org
Subject: Re: Change to NS drawing routines
Date: Mon, 13 Aug 2018 19:46:59 +0100	[thread overview]
Message-ID: <20180813184659.GA2258@breton.holly.idiocy.org> (raw)
In-Reply-To: <m2lg9b50ay.fsf@aurox.ch>

On Sun, Aug 12, 2018 at 12:47:17PM +0200, Charles A. Roelli wrote:
> > Date: Sat, 11 Aug 2018 15:06:20 +0100
> > From: Alan Third <alan@idiocy.org>
> > 
> > The next version of macOS deprecates the method we use in the NS port
> > to draw to the screen, specifically marking an NSView as ‘focused’ and
> > then drawing to it. The ‘modern’ way is to only draw from within the
> > ‘drawRect:’ method where ‘focusing’ is already done for you. There is
> > some previous discussion here:
> > 
> > https://lists.gnu.org/archive/html/emacs-devel/2018-07/msg00799.html
> > 
> > I’ve created a new branch called scratch/ns-drawing which only draws
> > from within drawRect by marking areas that are to be drawn as ‘dirty’
> > and then, at the end of redisplay, forcing an update, which uses
> > drawRect and expose_frame to redraw the relevant bits of the frame.
> > 
> > I believe this is a somewhat controversial approach.
> 
> Why's that?

Going through the previous email discussions, linked in the thread
above, Eli made it clear that he sees using the expose functions to
draw, when it’s not an expose event, as being incorrect.

i.e. this:

> > Again, invalidating an area to let the "expose" handler draw
> > afterwards is a very standard, primary, canonical, and sometimes
> > only way of drawing nowadays. (If you call it is an abuse or
> > trick, you'll be laughed.)
> 
> You can laugh, if you want, but I still think it's abuse, and won't
> be convinced by being laughed at.

from http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00435.html

I can understand the argument to an extent, but I don’t have another
solution.

> > My experience so far is that performance is not noticeably slower than
> > master, however if someone with a slower Mac could try it that would
> > be helpful.
> 
> I don't notice a speed difference compared to master on my slow box
> running macOS 10.6.  Do we have any benchmarks that we could use to
> check?

Unfortunately I’m not aware of any. I’m tempted to say that if there
is no clear performance penalty, then it’s not a problem.

Thanks everyone for testing this.
-- 
Alan Third



  reply	other threads:[~2018-08-13 18:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-11 14:06 Change to NS drawing routines Alan Third
2018-08-12 10:47 ` Charles A. Roelli
2018-08-13 18:46   ` Alan Third [this message]
2018-08-13 19:10     ` Eli Zaretskii
2018-08-13 19:36       ` Alan Third
2018-08-14 14:50         ` Eli Zaretskii
2018-08-15 20:43           ` Alan Third
2018-08-15 19:20     ` Charles A. Roelli
2018-08-15 20:42       ` Alan Third
2018-08-13  8:24 ` Nick Helm
2018-08-13  9:15 ` Van L

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=20180813184659.GA2258@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=charles@aurox.ch \
    --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.