From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Cecilio Pardo Newsgroups: gmane.emacs.devel Subject: Re: Drawing UI elements behind text Date: Wed, 27 Nov 2024 21:30:54 +0100 Message-ID: <005e93b1-4b5b-4d59-9fc3-9bf9b9c29bdc@imayhem.com> References: <641230ac-2dbc-42ac-a57e-acda77fe9296@imayhem.com> <8C55E590-E586-440A-89C5-0E5153518790@gmail.com> <78d3a7e7-f5a7-476b-8a9d-27beca44a94a@imayhem.com> <86plmgg2vx.fsf@gnu.org> <86bjy0fqqu.fsf@gnu.org> <943ad61e-9823-4dff-b8c0-d9d1b74ef676@imayhem.com> <861pywfnb2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7723"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 27 21:31:50 2024 Return-path: Envelope-to: ged-emacs-devel@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 1tGOhR-0001rX-9Q for ged-emacs-devel@m.gmane-mx.org; Wed, 27 Nov 2024 21:31:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGOgk-0005GZ-QX; Wed, 27 Nov 2024 15:31:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGOgd-0005GD-W3 for emacs-devel@gnu.org; Wed, 27 Nov 2024 15:31:00 -0500 Original-Received: from mail.imayhem.com ([82.223.54.191] helo=zealous-pike.82-223-54-191.plesk.page) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGOgb-0004m4-75; Wed, 27 Nov 2024 15:30:59 -0500 Original-Received: from [192.168.68.104] (111.red-88-21-7.staticip.rima-tde.net [88.21.7.111]) by zealous-pike.82-223-54-191.plesk.page (Postfix) with ESMTPSA id EA7E080127; Wed, 27 Nov 2024 20:30:54 +0000 (UTC) Authentication-Results: zealous-pike.82-223-54-191.plesk.page; spf=pass (sender IP is 88.21.7.111) smtp.mailfrom=cpardo@imayhem.com smtp.helo=[192.168.68.104] Received-SPF: pass (zealous-pike.82-223-54-191.plesk.page: connection is authenticated) Content-Language: es-ES In-Reply-To: <861pywfnb2.fsf@gnu.org> Received-SPF: pass client-ip=82.223.54.191; envelope-from=cpardo@imayhem.com; helo=zealous-pike.82-223-54-191.plesk.page X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325789 Archived-At: On 27/11/2024 21:12, Eli Zaretskii wrote: >> Date: Wed, 27 Nov 2024 21:01:42 +0100 >> From: Cecilio Pardo >> >> On 27/11/2024 19:58, Eli Zaretskii wrote: >> >>>> They are drawn after switching the back paint buffer, so that the >>>> redisplay result is left alone. >>> >>> So you clear them up when redisplay starts and then redraw them in >>> their entirety when it ends, something like that? Doesn't that slow >>> down redisplay, especially if there are many pixels and a large >>> window? >> >> Yes. We do a full frame copy on each double buffered redisplay, I expect >> we can add this with reasonable impact. >> >> The very naive implementation I have now adds something like 5ms to each >> redisplay on a 1900px frame, and I hope to bring it down a lot from there. > > What takes 5ms, exactly? what kind of redisplay did you trigger, and > how did you trigger it? A minimal redisplay, just moving the cursor around. This takes less than 1ms, including the time to copy the back buffer to the window. When the segment drawing is activated (with tens of thousands of them, though only tens of them visible in some window) the process takes around 5ms. This process includes: - Making a new bitmap, and copy the result of redisplay to it. - Iterate trough lisp objects to prepare the segments, clip them and draw them to this bitmap. There is a lot of room here to make it faster.