From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Cursor drawing (was: Process: Determining the origin of a command loop) Date: Thu, 20 Dec 2018 10:39:53 -0500 Message-ID: References: <838t0kcmpj.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1545320335 14055 195.159.176.226 (20 Dec 2018 15:38:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 20 Dec 2018 15:38:55 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 20 16:38:51 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 1ga0PL-0003M8-G7 for ged-emacs-devel@m.gmane.org; Thu, 20 Dec 2018 16:38:43 +0100 Original-Received: from localhost ([::1]:38407 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ga0RS-0005kR-BJ for ged-emacs-devel@m.gmane.org; Thu, 20 Dec 2018 10:40:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ga0Qq-0005k8-Fg for emacs-devel@gnu.org; Thu, 20 Dec 2018 10:40:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ga0Ql-0004tW-E3 for emacs-devel@gnu.org; Thu, 20 Dec 2018 10:40:16 -0500 Original-Received: from [195.159.176.226] (port=37985 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ga0Qh-0004fp-Jx for emacs-devel@gnu.org; Thu, 20 Dec 2018 10:40:08 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1ga0OV-0002Hm-8Y for emacs-devel@gnu.org; Thu, 20 Dec 2018 16:37:51 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:8WoeFLc+uK46Pgfc8szt9IBp8Z0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:231933 Archived-At: I was wondering whether it would make sense to introduce a clear notion of layers. IIUC the current situation is: - redisplay renders buffers into glyph matrix. - redraw of a clipping region is done by "rendering" the corresponding part of a glyph matrix into pixels. and I'm not completely sure where the cursor and the mouse-face highlight fit into this picture, but IIUC they're handled in a somewhat ad-hoc way. The layering could look like: - redisplay renders buffers into glyph matrix. - cursors and crosshairs are rendered into a separate data-structure (let's call it "overlay"). - redraw of a clipping region is done by "rendering" the corresponding part of a glyph matrix combined with the corresponding part of the overlay layer into pixels. Here we'd have 2 layers (the glyph matrix and the overlay), tho I guess the idea could be generalized to more layers if there's a need for it. The advantage would be mostly that the overlay data structure could be designed completely differently from glyph-matrices, so you don't have to shoehorn crosshairs into the glyph matrix. There's a good chance what I'm suggesting makes no sense or wouldn't help with the actually hard part of the code, because I'm not familiar enough with it. If so, please ignore me, Stefan