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: Sat, 23 Apr 2022 19:58:04 +0800 Message-ID: <87fsm4810z.fsf@yahoo.com> References: <837d7gp38q.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="28880"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: "Pfrommer, Julius" , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 23 13:59: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 1niEQ5-0007LH-U1 for ged-emacs-devel@m.gmane-mx.org; Sat, 23 Apr 2022 13:59:21 +0200 Original-Received: from localhost ([::1]:55528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niEQ4-0006IP-S8 for ged-emacs-devel@m.gmane-mx.org; Sat, 23 Apr 2022 07:59:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niEPJ-0005Q9-S3 for emacs-devel@gnu.org; Sat, 23 Apr 2022 07:58:34 -0400 Original-Received: from sonic314-20.consmr.mail.ne1.yahoo.com ([66.163.189.146]:38084) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1niEPI-0004Gz-1m for emacs-devel@gnu.org; Sat, 23 Apr 2022 07:58:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1650715110; bh=kvySGuUa4lY9WqOSUjYpRWn0O5C3QzKeDqCdWYwcH8I=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=rkyzYJk+MMuabO4YVP4gsh9nszuhTKbamupEZdWZEeLuA6oe3RNKby+s7nxsedlsZ3qJvpbCYl6c15CUeTJLPZcdfFVyD+xOfpZX1IKdNAprl+i1y4cWlqiiE62f4Q/Ml9NNZlZQWqwmzEd7nC/7fQz9D0CdvP2caO0Shs6y9IZfIMq7uD3/W+FCGpzSqeqPylq9XvrkYaNzhMQKhFmKGb5p9+G7B9B5IyZdZ523aXnu+DOVZTL9LzFst1g/ISaRfEYl9f5Aa7FolAAVw4U/cIgYiC+IsdElu1GQF6oHJxDWoawFAXG0DVSGr7IRSqirwnvTqtL65vxhIlFhpgF9NQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1650715110; bh=85aW2uobUDOcsAkvg7c6XHTyDJ/gft7XXS6VphDY1An=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=AoT3UWvYgiF1lShgCA7fBDRcVbMheIZGELyVXJuhio+fE08ASS3wWFqBPzeI+V4OUNYg4AdOdx8rHz4I0uTT+cTycuCo00q5A0A3FTVVJUDkQFqtE2Sv0nDvfN0iCW+fBNq4EabPvo3n/XfdirdFae63eRNPzUvfygvexnUm2vZygVFlBqwR9PvHZG56R6CAp9+XPxU4YZGaWWg06762fCPMxrsWvze/pK2s5Ft1GY+bMWVyp/JW6LKpj+v7niOzogUNWUtk32bB8MU5GhIQeDarIqjEB2BY+kSPkCsLIaPLk2++pyFpcbmd7GPV3odRY4lWytBGqfvpgqyIqBXg1g== X-YMail-OSG: A3lCgdoVM1kRRrkPL1olyXi3b1stt5Dme0bxYHcv6B9_M7vqDnB2uVVNAlFBfdV 3kXdp59sO8GeMtJwo2iooij0oA1aURpuu9D.5QEqEUbxPGYwNR6.PtpkkfTacPDVr3xUq1rhdfSg uYdCEGhZ0wDNvu9TKjkY1mnoLe1jQWLWSuBYVXS16DF7eaGPvKrikCBTf5QAZmbTTFej269cs4uH 35KwTLyTaGS0mLfqYEIWw0WqkmMcMDsOa3Rs6DhNrcnWiKoafBgamZITULYCv3a7pamJxnVTjjTF ysM4F6A0Rs0hVtq2ldbdvR2mt6ziP3871ROjoWKkROSGWn4tf3D8fo1jDlX5_ajRa2USsdwStcky OZcSy1bY2DWyj3EBx2C97AGmG7eWnARDiXZSzGyo0gAZePRc2MZWKkH8Yo2CIM3p8xC980JHC8iF fGJhUbClMC0eKF3k4OWGK_T3kH7aV_RZTIb2Hc_cEzOESwd0fU1mBTjfPaY6lTBRV8a_FVamr_2J gr1BCfo28TJn9Evx6ZVIBPLxoVfmfhFf2YGbjB8Vis.4jzqxLGwDHLAP2C48_gS2IYZAbJH0NnR1 Nz3nat49Z5v051OOzZWFaFulAzSqvMqBKOouq8ZHFIkF8ZohgtCX7d6ZlqZUXWdrhBO8YM4eapDT aPMFRDbgt_wDo66S7d2bcEEGKXEdDS5wHiSfNOhQMqRJzDoRS2VBbO_gnjpzDump_oAul8QXkKC4 2CadVK9EeXfa9AmzYM.D4cdH3sDCqqeEayw_PEg0a25eW4SnWOjg3ptROZ3FNnCLBnGNOhzo0IOt ARVFrIIPeCC2na01dJJONhUyX00kS2Oq8Txtbs2uPN X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Sat, 23 Apr 2022 11:58:30 +0000 Original-Received: by hermes--canary-production-sg3-6589f79784-bpc8m (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 460691536db7950cd85103512568be1f; Sat, 23 Apr 2022 11:58:23 +0000 (UTC) In-Reply-To: <837d7gp38q.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Apr 2022 12:18:13 +0300") 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.189.146; envelope-from=luangruo@yahoo.com; helo=sonic314-20.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=unavailable 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:288817 Archived-At: Eli Zaretskii writes: > In general, I don't think we'd object to having such Cairo-specific > code in one place. However, having GUI code common to all the GUI > backends in one place is more important, so if this Cairo-specific > module will make that common code less so, it would be a step > backward, IMO. IOW, as long as the effort to have Cairo-specific code > in one place doesn't "invade" on the common code, it is welcome, I > think. I think that we won't be able to get the Cairo code all in one place, without a large amount of code specific to each window system, which defeats the point of such refactoring. The platforms where Cairo drawing is currently used already have subtle differences in their Cairo-related code to take care of platform-specific quirks regarding fringes, image transforms, scaling, etc. There will probably be more of these quirks in the future, as we support more and more window systems and display features (such as device scaling) that have to behave differently depending on the window system being used. Moving all the Cairo code in one place would impose a severe limitation on the ability to change the Cairo code for a single window system, at least without the preprocessor definition mess that this refactoring will hopefully avoid. Further, the amount of drawing code is quite minimal, and the currently existing duplication does not impede maintenance at all, so this is most likely a case of premature optimization.