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: NS Port drawing, again Date: Fri, 12 Oct 2018 10:28:07 +0100 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000031eb2a057804b55c" X-Trace: blaine.gmane.org 1539336386 5906 195.159.176.226 (12 Oct 2018 09:26:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 12 Oct 2018 09:26:26 +0000 (UTC) Cc: Emacs-Devel devel To: Keith David Bershatsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 12 11:26:21 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 1gAti9-0001Rn-7t for ged-emacs-devel@m.gmane.org; Fri, 12 Oct 2018 11:26:21 +0200 Original-Received: from localhost ([::1]:39190 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAtkF-0005hz-SN for ged-emacs-devel@m.gmane.org; Fri, 12 Oct 2018 05:28:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAtk8-0005h2-Ik for emacs-devel@gnu.org; Fri, 12 Oct 2018 05:28:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gAtk5-0001zF-5Q for emacs-devel@gnu.org; Fri, 12 Oct 2018 05:28:22 -0400 Original-Received: from mail-it1-x12b.google.com ([2607:f8b0:4864:20::12b]:54235) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gAtk4-0001yg-Sj for emacs-devel@gnu.org; Fri, 12 Oct 2018 05:28:21 -0400 Original-Received: by mail-it1-x12b.google.com with SMTP id q70-v6so17776708itb.3 for ; Fri, 12 Oct 2018 02:28:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=et0b3ouc/GZCrGfr008tYohgMdQoAyIkxIZTe6vKeLU=; b=QOcFFZMZF6cWU7zsKTqiVxkAR/MQOE4fn/YtLSD+wfMogUxZd4KQ42wldFXHFKAMM3 Fkd7bV+YYtr2AD4bl3AO1yV1wrvzdc1PQ8wRQK+mvEz3fHBAuwoM88kmpxZ7QSRodaUl gZdqu2R2ovTExktkJiSmCt6fHcgjoFcdmmw3FN+eTYxcnLc3rFeyQxOBzWiVeEUU6Z9w 3BUO+WHtF1NmhcB326/+EOs4HKvkwcsfgq5sxhknXSagfz+Uamap8WWA13s6kiiWcMgr pzIbWAzLuP6F0vbjlXLINjEwFqP4g7M52/OHgP3kKI7Ps5Ti9qv19jKIDdQ+H1IdxHF0 jNXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=et0b3ouc/GZCrGfr008tYohgMdQoAyIkxIZTe6vKeLU=; b=qpy4XpvgoXysEvsGkkLSMznrBwuNc6TEZJMHCiUXg4P8+VhpxPmGrS9jq+M0oqGZZi jWSHoKdIxsjH5xRi0JIX7VF8jLAGmtk3iK5v24RdlMpyaRDPzH1Z8DY7jmG5LncfmDim 4+Esoq1mTbDXZknHDn50Y7X43UhOfy0xbxYLpjiD4FHp0Dvih/1UYc4zE7KpJ8gFTt11 pnRK8miBZwwB2x+675G3DxO8lX5e1nHyBSOSqusc0UkvS9EIaRcDFD6eYvFDBRJKFkXv 8oMDsgP+nyUTGTI+BLCUA/ng1eqCSDIsWxatmbg8pb4tQlKCwSWhT2ch16OQ6ZRx7Ojd vbeg== X-Gm-Message-State: ABuFfohbKT4GuVGhFAIKCJfDkaIzMJKBkBBlv20LuH+A24Zhadwuysg1 +2l59XrSPMncWszoueAzeJ1FB3YeRMOAMz3H5ns= X-Google-Smtp-Source: ACcGV623Gqsi9j/+rveDq9uRaZekuepwQfQS5nJc+tolF69PPKiBo198ZgeqQd6C9Ga0nsDX6Xsn/mf8nhw+vW3s+Tw= X-Received: by 2002:a24:9790:: with SMTP id k138-v6mr4079251ite.69.1539336498700; Fri, 12 Oct 2018 02:28:18 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::12b 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:230346 Archived-At: --00000000000031eb2a057804b55c Content-Type: text/plain; charset="UTF-8" On Fri, 12 Oct 2018, 09:54 Alan Third, wrote: > > The idea is that when running redisplay cocoa does not let you draw to the > screen, so ns_clip_to_rect, etc., marks the area as needing to be redrawn > later, and returns NO so you know not to try drawing to the frame. > > Later drawRect is called with a list of the areas that have been marked as > needing redrawn and it calls expose on those areas and so Emacs runs the > drawing functions again, but this time ns_clip_to_rect returns YES so you > know you can go ahead and draw. > BTW, with all the unexpected little niggles this approach has introduced that are proving hard to work round, I'm considering abandoning it and following the Mac port's lead where we would draw to an off-screen surface and then blit it back to the screen. I think this would solve issues with the cursor being left behind on scrolling, the flicker on resizing from lisp and probably the random blanking of frames users report. It would also avoid some concerns I have with making the NS port fully threading compatible as drawing would be thread agnostic, and blitting to the screen would always be handled by the main NS thread. They would be completely separated. I'm not sure what would be involved at this stage, though. --00000000000031eb2a057804b55c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, 12 Oct 2018, 09:54 Alan Third, <athird@googlemail.com> wrote:

The idea is that when running redisplay cocoa does not let you draw to= the screen, so ns_clip_to_rect, etc., marks the area as needing to be redr= awn later, and returns NO so you know not to try drawing to the frame.

Later drawRect is called wit= h a list of the areas that have been marked as needing redrawn and it calls= expose on those areas and so Emacs runs the drawing functions again, but t= his time ns_clip_to_rect returns YES so you know you can go ahead and draw.=

BTW, with all the unexpected little niggles this approach has introduced = that are proving hard to work round, I'm considering abandoning it and = following the Mac port's lead where we would draw to an off-screen surf= ace and then blit it back to the screen.

<= div dir=3D"auto">I think this would solve issues with the cursor being left= behind on scrolling, the flicker on resizing from lisp and probably the ra= ndom blanking of frames users report.

It would also avoid some concerns I have with making the NS p= ort fully threading compatible as drawing would be thread agnostic, and bli= tting to the screen would always be handled by the main NS thread. They wou= ld be completely separated.

I'm not sure what would be involved at this stage, though.

--00000000000031eb2a057804b55c--