From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#51411: NS port cleanups Date: Wed, 27 Oct 2021 18:20:34 +0100 Message-ID: References: <87mtmwt3mc.fsf.ref@yahoo.com> <87mtmwt3mc.fsf@yahoo.com> <87h7d4t0er.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37767"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51411@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 27 19:35:43 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mfmpz-0009bd-2t for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Oct 2021 19:35:43 +0200 Original-Received: from localhost ([::1]:43480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfmpv-0003Fs-Cz for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Oct 2021 13:35:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfmbm-0000vJ-Aw for bug-gnu-emacs@gnu.org; Wed, 27 Oct 2021 13:21:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38895) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfmbm-0004Pg-2W for bug-gnu-emacs@gnu.org; Wed, 27 Oct 2021 13:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mfmbl-0006VZ-TA for bug-gnu-emacs@gnu.org; Wed, 27 Oct 2021 13:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Oct 2021 17:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51411 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51411-submit@debbugs.gnu.org id=B51411.163535524424981 (code B ref 51411); Wed, 27 Oct 2021 17:21:01 +0000 Original-Received: (at 51411) by debbugs.gnu.org; 27 Oct 2021 17:20:44 +0000 Original-Received: from localhost ([127.0.0.1]:50441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfmbU-0006Ur-6N for submit@debbugs.gnu.org; Wed, 27 Oct 2021 13:20:44 -0400 Original-Received: from outbound.soverin.net ([116.202.126.228]:37731) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mfmbP-0006Uc-8C for 51411@debbugs.gnu.org; Wed, 27 Oct 2021 13:20:43 -0400 Original-Received: from smtp.soverin.net (unknown [10.10.3.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id B2EC695; Wed, 27 Oct 2021 17:20:37 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [159.69.232.138]) by soverin.net DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idiocy.org; s=soverin; t=1635355237; bh=jzDQFZtKiZvdzlpJCpU1p11OA9+NuPVQoCYVTihzcxo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=H4jkbcbAngQZlE845n6+MxRBoxtBqLDi80kqS+UErXA2Il7ZTsEuVYmGT0s0E5aed bAwTXxrE62KpTbGqWQK/Sp5dx9JYlDSLBeuy+cBnQn2vzVIn9tX7jDGbC/r9xEAVYN E3txVQVBjAw+4EJ3D4OBwQE/5pDKwrfj086AhSySk06vtg1WlhquWEIdkyD/69xdVF OLyKUf708DgV/2b9G79nzHq+hyKUo0+oPSUXVSPgCkrOC711/cBF99ET3liLWuTcai wKeG/9niSUAhmexpy62OSvJbY9+z3U35rIgzHpuVGfvz2Le2Ll0Ul5cblDBc5R8f6a F4grHl1waM7/g== Original-Received: from alan by faroe.holly.idiocy.org with local (Exim 4.95-RC2) (envelope-from ) id 1mfmbK-000k5t-B1; Wed, 27 Oct 2021 18:20:34 +0100 Mail-Followup-To: Alan Third , Po Lu , 51411@debbugs.gnu.org Content-Disposition: inline In-Reply-To: <87h7d4t0er.fsf@yahoo.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:218462 Archived-At: 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 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