From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: Change to NS drawing routines Date: Mon, 13 Aug 2018 19:46:59 +0100 Message-ID: <20180813184659.GA2258@breton.holly.idiocy.org> References: <20180811140620.GA1519@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1534186495 29668 195.159.176.226 (13 Aug 2018 18:54:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 13 Aug 2018 18:54:55 +0000 (UTC) User-Agent: Mutt/1.10.0 (2018-05-17) Cc: emacs-devel@gnu.org To: "Charles A. Roelli" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 13 20:54:50 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fpHzO-0007dV-Fr for ged-emacs-devel@m.gmane.org; Mon, 13 Aug 2018 20:54:50 +0200 Original-Received: from localhost ([::1]:41002 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpI1V-0003ON-2T for ged-emacs-devel@m.gmane.org; Mon, 13 Aug 2018 14:57:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpHru-0001AP-4y for emacs-devel@gnu.org; Mon, 13 Aug 2018 14:47:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fpHrt-0003pX-5l for emacs-devel@gnu.org; Mon, 13 Aug 2018 14:47:06 -0400 Original-Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:53227) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fpHrs-0003pL-T7 for emacs-devel@gnu.org; Mon, 13 Aug 2018 14:47:05 -0400 Original-Received: by mail-wm0-x232.google.com with SMTP id o11-v6so9839815wmh.2 for ; Mon, 13 Aug 2018 11:47:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=5DFQMAM7PAQLUuiZatpdcBhDU/15iAEUSDyAfLG63uY=; b=JZahb30CrSkL7R14e/R/I86yRkoD09ZTaUoARrxz/NMtconkUBd17TX5gABaLG+z5L rGp3/6IGO+8PLOOPcY5LbDLEHJ/PQWG5kqnR2uYsSOzQvoMj/pVVYYFl/Oa+bFECIzhK FzhuWUZqKJNvoZSUNHLiXqfkjgnJ0HIYdeOtbJr4GjmPQ4e54XaN7LLhlp1su3E9Rc8W BowqC6Hn4yvKgAVlnd0RQavvjeZW7JwO10Kowl6VNIje+3SEuSzhefyS/KX92/OQQLm3 fCZEz1ICilfoPpxRxZBsYQO0qAgef0CwE/En9h0yOEavGugGP2ZV4ZCkr/uXtK/4Py9J 4DpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=5DFQMAM7PAQLUuiZatpdcBhDU/15iAEUSDyAfLG63uY=; b=hL9H99/BjvePu3IqGQzT9gF8JABDVY0F95LnLC6BCo3PV8lgTXEtFmkHVVm2aBkbnI 3H6Xby92lORFLgH7hJblcIkDTsVjalssLjdRGu1B7ea5ymBR2LtY+WJvW0BO1Utzi5XR Zd1wxN+eGA3vNQsjjzltOZdvs4YlkVzr8U8lia6uDf6L5/hiLsHN3cMrpwcfF0qxRP2L C2zPKPj9I8YFxg+prMASUP1lcd3Fhf6rwZg+cVMoUxlBJkWZoz57AcWQ8UiMoY94FaUg 5maDtrT0HqDQa+7jpPzR8juwS2Wdx+ukiNpgwwyoVEhUHIxIL67T9PEGdfVdPlEhhpoC gYDg== X-Gm-Message-State: AOUpUlHtSioaoNKJa+mOx4kgebu5yXp+oh1brwz4/zHJrQqLw3Fo/MR6 tqfFQT9+o/Tc1wu+k/u0XcOZnuzJ X-Google-Smtp-Source: AA+uWPxh84tqPg3Qvk20uWfrk/NJ2ZF10rbYCAdOamDlDufAzU2GE6XuwiSh39L6oRwCkxSybKn8kQ== X-Received: by 2002:a1c:a989:: with SMTP id s131-v6mr9699107wme.136.1534186023459; Mon, 13 Aug 2018 11:47:03 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-c55b-5835-b4f8-8d72.holly.idiocy.org. [2001:8b0:3f8:8129:c55b:5835:b4f8:8d72]) by smtp.gmail.com with ESMTPSA id s1-v6sm12195229wrt.82.2018.08.13.11.47.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 11:47:02 -0700 (PDT) Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::232 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:228498 Archived-At: 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 > > > > 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