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 20:36:04 +0100 Message-ID: <20180813193604.GB2258@breton.holly.idiocy.org> References: <20180811140620.GA1519@breton.holly.idiocy.org> <20180813184659.GA2258@breton.holly.idiocy.org> <83in4ejd5a.fsf@gnu.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 1534188887 14503 195.159.176.226 (13 Aug 2018 19:34:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 13 Aug 2018 19:34:47 +0000 (UTC) User-Agent: Mutt/1.10.0 (2018-05-17) Cc: charles@aurox.ch, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 13 21:34:43 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 1fpIby-0003ek-HD for ged-emacs-devel@m.gmane.org; Mon, 13 Aug 2018 21:34:42 +0200 Original-Received: from localhost ([::1]:41232 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpIe4-0006mk-M8 for ged-emacs-devel@m.gmane.org; Mon, 13 Aug 2018 15:36:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fpIdQ-0006me-2q for emacs-devel@gnu.org; Mon, 13 Aug 2018 15:36:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fpIdP-0006Xl-3H for emacs-devel@gnu.org; Mon, 13 Aug 2018 15:36:12 -0400 Original-Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:42590) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fpIdN-0006XQ-9U; Mon, 13 Aug 2018 15:36:09 -0400 Original-Received: by mail-wr1-x431.google.com with SMTP id e7-v6so15218935wrs.9; Mon, 13 Aug 2018 12:36:09 -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=7eP9iGtjJK+e5B6StgMUcyQRvMACfNHEkYvHHNdzUIk=; b=afliXuu8QPvhJxbpxXqOtQIyZ4iiZRTjWDQ59BDxW/f1DAscXG8VZqAq8sDooeavCd xCFpV/w9Dr5CsrHLMpgl20gi12a1thqIJS1ik8pZrV/jRCAIUkDrDAFmISs65d0xSxjq NNQzhKrLwgE1HLSuDqK7B4JXJXzuUbvCXen4bclrje2mpGa1yYLaZJZ/Z9iRhFCwkzES DBXtFgEIklo2mkWFFNbpQE0Bkac9zUVVWxCBTpOjyT87YyjPq6h6dfqW8N5XPih3fo5O SJDThBaTdPANWDmTyqkEJuoZCjskjtlCZKTgpdvK3HhRNVLDDZyaFBvNMSYy4ZAAaHKw rhfw== 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=7eP9iGtjJK+e5B6StgMUcyQRvMACfNHEkYvHHNdzUIk=; b=rIatScRmpYy3FdeNVp+8AeKZCAhlK1/cCrDjIV0/DnjBFMVy2qvv+kFqSREjOH9Rc4 OK+tK8iXjeWKbgI7+9bK8R+XOpzSVhZWjIyp44wSVJ1DcLDmOyn/9DFhMTKkWVNPxiGT w+Dpqk79JgY5nRwzSwUvm3IKuw5NyDQM+CBJZwHT4/3PrSMh7tBV8B3Sy0/0QTUU4gqT DhUCvp3oKQoyuGSqLjvabHHij16YCamjvV3tfC/kaDrU6o16QXuoNvipOjoH/AApRjYa EwBUmsPLN0jBEEyotDSFbaeprxwfBWXOwvKOQuDa96OKIQHpEBQ2yQ2Y2+BXdXgUFZFq kYBg== X-Gm-Message-State: AOUpUlHfBoyfJE62cv0UCS/ZgmRzcv3LCBHX/ikWXo/cRpc6c/mTK2wl w1cACh3HLxTsm2+jT2k4WIvCwPdw X-Google-Smtp-Source: AA+uWPxL0s3gvBbAO7opj901Rx63S0jXXHr0DIFCP1BGVJAb0u2T+iBa4OvangYPn0nHgpFpLCcK4Q== X-Received: by 2002:a5d:51cf:: with SMTP id n15-v6mr11952905wrv.107.1534188967778; Mon, 13 Aug 2018 12:36:07 -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 i14-v6sm28137192wmd.13.2018.08.13.12.36.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 12:36:06 -0700 (PDT) Content-Disposition: inline In-Reply-To: <83in4ejd5a.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::431 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:228500 Archived-At: On Mon, Aug 13, 2018 at 10:10:41PM +0300, Eli Zaretskii wrote: > > Date: Mon, 13 Aug 2018 19:46:59 +0100 > > From: Alan Third > > Cc: emacs-devel@gnu.org > > > > 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. > > We could discuss this again, perhaps the details have changed, or we > might be able o find some compromise everybody can live with. > > For starters, what changes, if any, would you need to make in the > glyph matrices, and why? For this none, I can do it all in the NS specific code. I’ve changed all the NS drawing functions to check whether they are allowed to draw. If not then I mark the area as dirty. I’ve added an ns_flush_display function that I believe is called at the end of redisplay (flush_frame). I wasn’t sure about this but it looks as though it works, (i.e. everything draws OK) so I assume it’s safe. Anyway, ns_flush_display asks Cocoa/GNUstep to redraw the frame, which results in drawRect being called which calls expose_frame on the rectangles that have been marked as dirty. -- Alan Third