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 15:20:27 +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> <83ft6gzuu7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6219"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: ak@akirakyle.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 15 15:22:44 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 1kT3DQ-0001V1-7c for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Oct 2020 15:22:44 +0200 Original-Received: from localhost ([::1]:34710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kT3DP-00072Z-9t for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Oct 2020 09:22:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kT3BS-0005rl-FI for emacs-devel@gnu.org; Thu, 15 Oct 2020 09:20:43 -0400 Original-Received: from mail-am7eur06olkn2088.outbound.protection.outlook.com ([40.92.16.88]:37120 helo=EUR06-AM7-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 1kT3BK-0006FP-LB; Thu, 15 Oct 2020 09:20:41 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cBqe97qHY9PJnq9SugTQrkdX5DOQZ6jcrRXg4Fop9wOYrHzufVwmTOZIzoEb5SGjR/jlBwqPajEkf37OUjJ3Kbr1U6kHruCHVPZ13OyM/Tm3PHf4WI0l3NGY5x1UMQfHSXTYolO0m/XtHVbZfgukFlMXJxrJmq6jRDyDA+9faoNJlgqtN3E3Gep0zrNZTuEZMTUPVXKCBfyp7qxxomVbOukeygkNzdhsHtZj6JM7yBcNKFUbFY4nlOKBEnSujhVdXaRCC4CH+wiQzX4SElS3LA7YiRt2tANVpTBtFi4Ub+qCNk9HYvVap0JVMSPZLBO/4AWkHI0h3X6lWgZxuko9Ag== 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=JYt/pKVJB5sccd7lOIs78wDfYrQhFUKd7czULrWoSlU=; b=N0xLXE9UCvNTD84dhKOGLnbmvjOunpVKtPol6VLufsBGPsa/+Y7QiBk8crtBgmZJ+lZW2zNU+KdzkKzNka2+PNaSw/kJZ71ydGtO3P9HcHU8i6E3Riba9i+ay2s7DI3QnHL8Ru9LJ71sDX79wXwqNtPeko0jUnYgaCyYyIBTZYF+AGZy3CyONbBf5UJFlkNOSOFrWamlfdWmEL1pAqFPnOAIVuRchfslk28mPosZZSW0dJ8XXd5LLWjsQ8uLLiUCTedv2T9Q97iW/Sf38lytTMFz/NZU7tbuCZZkM6NUxl6iFiKZ8dNEg6nxE410SBCqQtrUR5GC/smWU3p2S0qwSQ== 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=JYt/pKVJB5sccd7lOIs78wDfYrQhFUKd7czULrWoSlU=; b=tQozz9ZinJRY9z8u2ZyGXNZPiASElg4eKdHflkBb5IByfuZgsR6HV4+UV5zdGUa5najMErwC5oW4zb020sxvRCrWS0hvinF8YNcxaOrOB0rV6XeJUtISqTwyiF5bjc8pVKjWceebrA2utCGmyq+jnL0JI68Q1r7TzWhfTc4tfYOAYXfiJPQ//nqhK6vjA5TpFHsv87ppQyCa1IgOR5twDMV4UgPxuaJTJxaLvMkFTZjqHzXiHV+FaR19cSnSKmpcvf1YhvWwHAl50dlXv7Gp/mTZB7mP1rJ6zMzK5z0TBkB4CiirNukgtdExlyFI61mokTAvH+yXiiH6AJhPvGBMDg== Original-Received: from AM7EUR06FT064.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::49) by AM7EUR06HT176.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::485) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21; Thu, 15 Oct 2020 13:20:29 +0000 Original-Received: from AM6PR06MB4518.eurprd06.prod.outlook.com (2a01:111:e400:fc36::4b) by AM7EUR06FT064.mail.protection.outlook.com (2a01:111:e400:fc36::452) 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 13:20:29 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:D827E4B5DD4D6604E61C4FA61EF74A42FF699C3CDE4FFAB2FF36BD3115AB5F32; UpperCasedChecksum:56BB8557B4ADEA84807DE2126B45D8161F2388B969383E2B6DEFACA58F0F4BE4; SizeAsReceived:7628; 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 13:20:29 +0000 In-Reply-To: <83ft6gzuu7.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 14 Oct 2020 18:32:48 +0300") X-TMN: [wS8iKaAVpRB39VgpBtr2sgi4IDI8An3G] X-ClientProxiedBy: AM5PR0701CA0022.eurprd07.prod.outlook.com (2603:10a6:203:51::32) To AM6PR06MB4518.eurprd06.prod.outlook.com (2603:10a6:20b:6b::13) X-Microsoft-Original-Message-ID: <87blh3vd5w.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AM5PR0701CA0022.eurprd07.prod.outlook.com (2603:10a6:203:51::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.7 via Frontend Transport; Thu, 15 Oct 2020 13:20:28 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 2202712a-2cc8-4f93-b98c-08d8710d15e0 X-MS-TrafficTypeDiagnostic: AM7EUR06HT176: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jqvtgay7AsDDG5VyLtttNBkEN801A7waiQAX6er2467/McdFDRFMgoelrh06th2448TGyNXBPuWY+Em1V4ZEdPyVuaXnk/Mzg6PtbWPn5CVuqoe+73yGcHUOaTymI4e3wzX9QrluwPb1a55KDv6KYkwDVJYBzARNUK7hUIVWQAd8+z5l3pTYZJuoiRxZZXMtS7zqsTEQhvqgkp3n7gjemg== X-MS-Exchange-AntiSpam-MessageData: cBid7niMVGmrWYrs+cVyxmrd96jWPM6NmTwdE2O0exipwJIjBQdZSpgNKjs0uCmEeekkqTzQf6Nqm7WmOpMOgTiIuoJQzdpu8k3he4qqz0d70qnO1GmOvDrF4SVhhO7Dy7vjTBX1yvufdB4ogsubYQ== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2202712a-2cc8-4f93-b98c-08d8710d15e0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2020 13:20:29.2805 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM7EUR06FT064.eop-eur06.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: AM7EUR06HT176 Received-SPF: pass client-ip=40.92.16.88; envelope-from=arthur.miller@live.com; helo=EUR06-AM7-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/15 09:20:29 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:257723 Archived-At: Eli Zaretskii writes: >> From: Arthur Miller >> Cc: Akira Kyle , emacs-devel@gnu.org >> Date: Wed, 14 Oct 2020 17:04:07 +0200 >> >> 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. > > I believe this should be the job of the GUI library we use (Xlib etc.) Yes, of course. EGL is your library :-) I am thinking more in terms of performance and simplification of implementation. Egl runs on major OS:s + android, and opengl is very platform independent, so one code path (mostly) on all 3 major platforms (hopefully). Also traditional Xlib and GDI does not hardware accelerate everything or specially well. There is some article on msdn about Direct2D and GDI for example, different driver paths etc. They have exposed Direct2D for applications for performance reasons, as they state GDI renders large portions through CPU in kernel mode, while DX2D is in user space etc. I believe Xlib is even worse in that regard. Also future of Xlib seems a tad bit uncertain. OpenGL via EGL could be Emacs's "directx2d". Wayland uses egl and I am correct sdl uses it as well. Maybe Emacs could use sdl to render too, but I think it would be unnecessary expensive in term of complexity. >> But Emacs will maybe run on some slow devices (atmel Emacs anyone?), so >> you probably don't want to ditch away all that disp stuff. > > Different Emacs configurations could employ different redisplay > optimizations, if we know which ones are necessary when. > >> > We try not to use machine-dependent code in Emacs, because that's a >> > maintenance burden, what with today's fast pace of chip development >> > and obsolescence. Vectorization is generally left to optimizing >> > compilers, and relying on special hardware, such as GPU, is not >> > something we should depend on directly. We should instead hope that >> > the GUI toolkits and display systems we use will do that for us. >> Would it be considered too machine-dependent if you rendered into >> off-screen OpenGL surface as your rendering target? Should be avialable >> on Nvidia/AMD/Intels gpus. With offscreen egl you would have relatively >> OS independent code too; but that would require explicit linking to >> proprietary libs. I mean X11/Win32 already does that when proprietary >> drivers are installed, so Emacs (and any other software) "implicitly" >> links to those, but I don't how it is viewed if you would to explicitly >> when present. > > Why should we do that in our own code, as opposed to using some > higher-level library? Didn't you disliked proposal to use libCurl with answer that it would make Emacs dependent on yet another library? :-) Cairo is a nice 2D api, and has opengl backend too. I dont' know how effective the backend is, but sure it could work. I dislike all the dependencies it pulls in, but in a typical GNU/Linux system they are anyway installed. Can you divorce it from Gtk requirement? Or it is already possible to use Cairo in Emacs without rest of Gtk? I proposed egl, as a platform independent surface drawing that enables use of OpenGL. Someone might one day create a scene graph (isnt't it just a list of lists) and maybe do some cool stuff in ELisp that we are not really thinking of now.