From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Unifying code for drawing on a cairo context Date: Fri, 29 Apr 2022 16:33:21 +0800 Message-ID: <87v8usxp9q.fsf@yahoo.com> References: <837d7gp38q.fsf@gnu.org> <87fsm4810z.fsf@yahoo.com> <1e28345b-7293-aa6f-9457-71435fec4eae@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19469"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: Eli Zaretskii , emacs-devel@gnu.org To: "Pfrommer, Julius" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 29 10:35:22 2022 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 1nkM5y-0004qU-5j for ged-emacs-devel@m.gmane-mx.org; Fri, 29 Apr 2022 10:35:22 +0200 Original-Received: from localhost ([::1]:42424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkM5w-0001Pb-I5 for ged-emacs-devel@m.gmane-mx.org; Fri, 29 Apr 2022 04:35:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkM4G-0000Cc-R8 for emacs-devel@gnu.org; Fri, 29 Apr 2022 04:33:36 -0400 Original-Received: from sonic307-56.consmr.mail.ne1.yahoo.com ([66.163.190.31]:43800) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nkM4F-00058O-7H for emacs-devel@gnu.org; Fri, 29 Apr 2022 04:33:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1651221213; bh=fRLJj5ig19d5pah/lwIpOGaOK5o+Zi29gfheQjlsH54=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=WOJMu8nIge9hQttP1h9FrVB0AkI1A4S/S7zWLVsr27wilBCi/1BKfU7UqKVbpMa7w4exNukJ14g4JjmYO5I7ifdXCBguMlZEdOnrXN8k2gQSqcJoCutEGEVnX142LnHX8Up/r6MoikgUv5Ej/8EpHpvug2+DE7WE7PS6tQTxf17qRcCwnCpZWsal5qBc0iOEj3D8C7aR+88QKLUQ8t5YjsuRoB3loCh13xKrbICaFGtgC+/YPiYR0RP/+xfST/214lklmmjKYrXqi2SxFb+XaVkz1vSeUR4+kA8cbbvtXSRstcstM08N/dJWbgk4LRFODkkjqzFEEF+4xgqDxqYtIA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1651221213; bh=kUJrp4JqIzHnP9h552nqcw+9qQbpee4iOPSs/iviZ1T=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=CzDoozHNbr5ROvZ/qx0H2C+mrLX60ZrYxinI4QLcia1Zq8ghV2P44lucF2+vBzbth8gU7DgheHs32HwoLuX011M7qxBcpfb/cGZpACaca1slRoCnfPiH2WVvT5JPu1Mx6xBJJbxcIT4xJJ65p23pkikC2EFiVMegevoP5Vdh43lsrOoAbtLOOPoWXcmcnIUGKBv9OeQzmqYKnKYIFfutn8r9pjruKLnTZGYw/oQZldhWrboNTGd/kyTyl4U3CkTrkoR0xrj29C6ulP4y57yWhKofWjdMAtr5KiGiNJov/vG7WypeDCghlqsmfqGAGPIT9McjISnjmaH87l8l8rsqUg== X-YMail-OSG: mWGNnhEVM1nmj8g0HBBqzZFUKNrthEYy3RspkBltU8zwg1jAPgZAoOAl.r9dJk. 96qvpv56Fto8XWHm7NSvFAyi5OVLEICLyaiPdEh3DuIWtRM_TYNirdPBDMgPevMqAm06GYjPDbhH lDKsMMtEauiAGHpvEdbJ.Oi4KvwFBxJ.otEiryaTCT5od70bdMj.GMhPuQx7J1N4.LpMm6bcpE2o grXNAYGDrhzpY9oGJIqkWTrPdOFD5qt_eaUp9LAHwlGYOfm6Nejy7Zxo5kb0MUfg0PLmScA.3gvL WCD8oFVJVcVR3HAHo1FQIRpqnd0Z8JJuaj2QzfAuWuObFVW8E75tv6dCXJeNMdD7lUgVEPlKdfl5 DXRRypp4jCGDiOsX9Ms9SKTKxPV0bLmVOhu56znFWe5DXF9B408SkP32.YkBZD.n7yPrWku3TChs 3ZJ3GrUGmcczIwOghoFNL38wel_b5s0dtRCzLbzZn7Ck6uoMOfehuc.52BVzYYY9ljOWRfVG9wWH ULk7dXOzMiLSyi3cT2Th3T7usqMxPlIgESDAI8u6ZClZY2FKrTJ4wBfTNdx_sJiLWxlzorU01Zs_ .jX_EAEqSiUzEVBrUxtKdZmejNxI3cbpUkFiuEeOIdK6gQ2INw2a8.GsgOJMKjrPWeE8x98QYFUl modf62CqNan0oHdOSdmfigCj1rWhipLpOYMrvDrJcrG6pRqGo.EGRcMiKtu3LOGW1RUyuLm.wl_5 X3P.qyuCYeVKh60YExGUAbNkw2HBoLoahgXoprhFDfthr.yFKq6ab4lgQ2SbRVVfKTxmkbq0tGLy wLUeVN8oE5cXLnd0QaZEnGwPQ5YXuVEzllZpw5fPtm X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Fri, 29 Apr 2022 08:33:33 +0000 Original-Received: by hermes--canary-production-sg3-795d7b4d54-rhs8w (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 5790eb6da166166cad063539efd8bde5; Fri, 29 Apr 2022 08:33:26 +0000 (UTC) In-Reply-To: <1e28345b-7293-aa6f-9457-71435fec4eae@web.de> (Julius Pfrommer's message of "Fri, 29 Apr 2022 10:01:01 +0200") X-Mailer: WebService/1.1.20118 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.190.31; envelope-from=luangruo@yahoo.com; helo=sonic307-56.consmr.mail.ne1.yahoo.com 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.emacs.devel:288966 Archived-At: "Pfrommer, Julius" writes: > Not all Cairo drawing, but those parts where it makes sense. > But having some level of code-sharing will decrease the "entropy" > pulling the toolkits and platforms apart over time. There will be no benefit to this at all. We only recently introduced a second platform where Cairo drawing is used, and aside from GTK (and X Windows, where using Cairo for stuff other than fonts was apparently implemented so that we could use it for printing in the future, but nobody has shown any interest in doing that work), there are no other platfoms where Cairo drawing is required or would be beneficial. So IMNSHO this refactoring is premature, and will also likely cause problems down the road when we want to change the behavior of the Cairo code on a platform-specific basis, such as when the device scaling feature is implemented on X. > I would argue to the contrary. Developers typically only have access to > a subset of the platforms. Developers will improve and bugfix only those > platforms where they can test their changes. Having a common core for > Cairo-drawing (with no #ifdef mess and assuming that Cairo behaves > similarly across platforms) would reduce the duplication of the effort > to fix bugs. I work on both platforms where Cairo drawing is used for something other than fonts and see no "ifdef mess" you allude to in the Cairo code, and so far there hasn't been a single instance of the two instances of subtly different Cairo code causing fixing a bug to require a duplication of effort. Most of the preprocessor conditionals in the X Windows drawing code stem from the presence of both a Cairo and non-Cairo configuration, neither of which are going away. Cairo is not used at all on NS and MS Windows, so bug fixes will have to be made separately there in any case. The Haiku port will also never use Cairo for drawing anything other than text with complex shaping requirements. On the other hand, why not dedicate your time to some work on the PGTK port that will lead to an immediate improvement, such as refactoring the selection code in `pgtkselect.c' to use the low-level GDK selection API, so that drag-and-drop will work, and most of the Lisp-level selection code can be shared with X? Thanks in advance.