From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Rethinking the design of xwidgets Date: Thu, 15 Oct 2020 14:48:12 +0200 Message-ID: References: <864kmzupp0.fsf@akirakyle.com> <835z7e2ouj.fsf@gnu.org> <86v9fet5sg.fsf@akirakyle.com> <83imbe1040.fsf@gnu.org> <86pn5luak4.fsf@akirakyle.com> <83362g27y6.fsf@gnu.org> <86mu0obpr7.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14651"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , Stefan Monnier , emacs-devel@gnu.org To: Aiko Kyle Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 15 14:48:54 2020 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 1kT2gg-0003jn-Fq for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Oct 2020 14:48:54 +0200 Original-Received: from localhost ([::1]:47558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kT2gf-0003mz-IP for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Oct 2020 08:48:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT2g7-0003Lg-Eo for emacs-devel@gnu.org; Thu, 15 Oct 2020 08:48:19 -0400 Original-Received: from mail-oln040092074084.outbound.protection.outlook.com ([40.92.74.84]:3975 helo=EUR04-DB3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT2g4-00023R-Cs; Thu, 15 Oct 2020 08:48:18 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jr26fw3LIEIczLIEC/5KjaVCSiZE/H+qO/9RuiztS3norVR2s+NFIdRYn6jkTXFx8u74/J7WEavwS+0AFBDD7gRcmN/XFpGv+kNVfogI+FifgWnpyqpoRo//isNPhqNS6xjyCFlTLh8/zltjWnQmX42Vw27egleNNV1kHs9lJAJYhyB8JjWQkydA0Cz8Jd0Zt8OIwlovpAp7juYh1vFrvySk8gmbVgbE8pUa7p19c6Sb9Zh190pwjnsQmYSfA7gQmjItkqrFR30w6injlgJXJnhLfsWX93dJpny96T/0W/YbN/mCeDM6FCCxUcj1z//m5UNr5yXqeFXZAAVaV8wAcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sJrQuYix8VlFh0x2OXdKE66AkV+TpkYGtShy67LCESg=; b=mfG684RGZEWSdC2TKopB7v9sXvHCivHpVB+nyJdIEND3j3VB76wp3mfCliRTShKZQ74zEkx6EPNyYhduCHdqmKRl1hNjHNl5Y/wpHcyftfXdl41c2bL0B+R1RZbMCcXYlHHGxfz6pPjd0rjGzH793AYL+Aiff4cR5C9j0Y5Fs3orleiQsS39quRGm2wssRveazAZJ1OO5ntSLIcxO0AEM/ES+MM1FdekiBCq5ZN/s14qso0pZN+O74wvfpYEUo7lHUQwJ6TlbuTh6rqCh46V5pbOP9e6K8Re4i9Fclp2cqbcjm8jTJmCDyJbYbUMoGXPzBIUTKO27iFHeqe+i+5fpQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sJrQuYix8VlFh0x2OXdKE66AkV+TpkYGtShy67LCESg=; b=W0VHrTc/nCLDfMBRTvrKg5oh1RfTNECyT0UjCez3XdJBa7DpMloG0AoCSw4ajsawlYP9xEeG5tPJ88qCMcRR3uXLxXZVWRUELN5PH9Qz7cTXs4Boe4nWGejh57kMSGVbsQjsmG1okoeqhXnK+hoQv2YHyRXbu+ieLzG+M4GAwxEfNEElKhzNZM5gHVxFyyk4rJenGf7bvP2Y55YK7okhBft117QL0KWPRA17DInti5tDFkH+SKFCr3m1/3Ea060COZCzUq6TYZIR7tAxCG3sOJyCqfpMpQqXZo2b9vn7W5A9dvW7NeW5NncpjDh7fqgTDZlwaQxPkD9XTXqzHSXBgA== Original-Received: from VI1EUR04FT026.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::47) by VI1EUR04HT082.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0e::222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.23; Thu, 15 Oct 2020 12:48:13 +0000 Original-Received: from AM6PR06MB4518.eurprd06.prod.outlook.com (2a01:111:e400:7e0e::44) by VI1EUR04FT026.mail.protection.outlook.com (2a01:111:e400:7e0e::127) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.23 via Frontend Transport; Thu, 15 Oct 2020 12:48:13 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:F6888B94C0E10F094F692092CB7C729D1CABD64F0BD6DCFD721D49ED3238BC48; UpperCasedChecksum:7961164A66F1003A04EEC036C32C56C9B3EC7DBBD03F94D4DB36865A7B08440C; SizeAsReceived:7739; Count:46 Original-Received: from AM6PR06MB4518.eurprd06.prod.outlook.com ([fe80::bcb9:3133:8a66:dc8e]) by AM6PR06MB4518.eurprd06.prod.outlook.com ([fe80::bcb9:3133:8a66:dc8e%6]) with mapi id 15.20.3477.021; Thu, 15 Oct 2020 12:48:13 +0000 In-Reply-To: <86mu0obpr7.fsf@gmail.com> (Aiko Kyle's message of "Wed, 14 Oct 2020 12:56:28 -0600") X-TMN: [rzVOOYWvqgB1FKx7n85dh6y/f05JQ9X/] X-ClientProxiedBy: AM5PR0601CA0031.eurprd06.prod.outlook.com (2603:10a6:203:68::17) To AM6PR06MB4518.eurprd06.prod.outlook.com (2603:10a6:20b:6b::13) X-Microsoft-Original-Message-ID: <87ft6fvenn.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AM5PR0601CA0031.eurprd06.prod.outlook.com (2603:10a6:203:68::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Thu, 15 Oct 2020 12:48:12 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 4befff90-8099-4a12-0820-08d8710893e3 X-MS-TrafficTypeDiagnostic: VI1EUR04HT082: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HAqFlo8Bm5GlmOIZsuKyWWGVsZ3X8NFsR/AOmvMPHki3GRM18mCsoqjw1FNDUzQJ5onAwrTR5qNZho03VcKTJlNhJTbklpXSsjAwtfp08G3VTRHQy1IjLgMvMeVVEiRCnWMw2x+n/hzAB34CS85Lmmw9AZ1cciow196/MNX6P6K4vniwnqT3NYvGecicTIHm1zCTUNfi9b/zaOGIRxQQ5A== X-MS-Exchange-AntiSpam-MessageData: 2+5WdMoSWgHS+M3u7hj1M+iQLvSqW6KUkUjA5OdTPcU+6GzOaxZDQivFSim+Jfx/e/uhUVJ1UCKlgPCYVY8eHvsDc9z79pArdodPW5rYBdBDuNns32nDQtT0aIVaUyYGOJr3rR8HoUpQDxkbqwFAkQ== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4befff90-8099-4a12-0820-08d8710893e3 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2020 12:48:13.1359 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VI1EUR04FT026.eop-eur04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1EUR04HT082 Received-SPF: pass client-ip=40.92.74.84; envelope-from=arthur.miller@live.com; helo=EUR04-DB3-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/15 08:48:13 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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.23 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" Xref: news.gmane.io gmane.emacs.devel:257722 Archived-At: Aiko Kyle writes: > Replying to both Stefan's and Eli's reply to Arthur > > On Wed, Oct 14, 2020 at 09:04 AM, Arthur Miller wrote: > >>> In case where there is a discret gfx card (i.e. Nvidia/AMD) it is >>> probably faster to send everything to GPU and ask it to render a giant >>> texture and then use it as XWindow pixmap, or something similar >>> then to figure out on CPU all the stuff that should not be displayed. > > On Wed, Oct 14, 2020 at 10:53 AM, Stefan Monnier > wrote: > >> I think it's much harder than it sounds: most of the work needs access >> to data structures that aren't friendly to GPUs, so the work of >> providing data to a GPU in an appropriate form would probably not be >> much more less in most cases than the drawing itself. >> >> (talking-about-things-one-does-not-understand-mode 1) >> >> But indeed, maybe we could split the "drawing" from the glyph matrices >> to the glass into a first step that draws into a "pixmap matrix" and >> a second step that draws from it onto the glass. This should make it >> unnecessary to try and "scroll" (parts of) the display since it should >> be "just as fast" to copy from the pixmap matrix as it is to copy from >> the current glass's content. >> >> (talking-about-things-one-does-not-understand-mode -1) >> >> I think the performance of the redisplay is by and large poorly >> understood. While there are known cases where people experience "slow >> redisplay" it's usually very unclear what that means concretely. >> In many cases this can be completely unrelated to the actual redisplay >> code (e.g. the time is spent running some expensive code off of >> `post-command-hook` or font-lock or younameit). >> > > On Wed, Oct 14, 2020 at 09:32 AM, Eli Zaretskii wrote: > >> I believe this should be the job of the GUI library we use (Xlib etc.) > > > As someone who has done a little bit of GPU programming, I think Emacs should > stay as far away from needing to care about the architecture and optimization > for GPUs as possible. It is hard and very non-portable. AFAIK OpenGL runs on more systems then Emacs, and is considered as probably THE easiest graphics API out there (Turtle graphics probably being easier :-)). It is superseeded by Vulkan, but Vulkan is probably too much for an application like Emacs in terms of complexity vs benefit. > I should have clarified > in my prior email that I really meant that Emacs could take advantage of newer > hardware like GPUs and other SIMD vectorization units not directly because it is > a huge PITA to work with, but through appropriate high level libraries. I don't > think Emacs should be in the business of trying to actually draw primitives like > lines and rectangles onto the glass directly whether through the frambuffer or > low level gpu primitives like opengl. It requires specific expertise to get > right and do efficiently that I think is beyond the scope of Emacs development. > > Since Emacs already has its own internal abstraction for actually doing the > drawing through the redisplay_interface, my point was more that Emacs should > gain hardware acceleration by ensuring the GUI toolkits it uses take advantage > of such features. I think gtk 4 will have even more integration with hardware > acceleration, In my world, Emacs would be better shying away from big GUI toolkits and ginormous dependencies. Emacs window is (logically) one giant glorified tty in principle; tucked into an OS window and Emacs does it's own redisplay of the major os window area, so GUI toolkits are really just placeholders for Emacs to render. Buttons, menus, toolbars can all be implemented by Emacs buffers rendered as Frames, or Windows. Does not blend very well into Gnome or KDE world, but with some styling might be pretty too look at anyway. As I udnerstand Emacs now does it's own font and text rendering via Freetype , so question is if needs Gtk at all more then being pretty on Gnome desktops? Maybe Cairo alone is not bad, since it can be used as graphics API to render to and there are also hardware accelerated versions via opengl bindings (look in Mesa source).