From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Pfrommer, Julius" Newsgroups: gmane.emacs.devel Subject: Re: Unifying code for drawing on a cairo context Date: Fri, 29 Apr 2022 10:01:01 +0200 Message-ID: <1e28345b-7293-aa6f-9457-71435fec4eae@web.de> References: <837d7gp38q.fsf@gnu.org> <87fsm4810z.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28621"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Cc: emacs-devel@gnu.org To: Po Lu , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 29 10:05:48 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 1nkLdL-0007Hw-OK for ged-emacs-devel@m.gmane-mx.org; Fri, 29 Apr 2022 10:05:47 +0200 Original-Received: from localhost ([::1]:54988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nkLdK-0006VT-9W for ged-emacs-devel@m.gmane-mx.org; Fri, 29 Apr 2022 04:05:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkLYw-00042Y-Rx for emacs-devel@gnu.org; Fri, 29 Apr 2022 04:01:14 -0400 Original-Received: from mout.web.de ([212.227.15.4]:43287) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nkLYp-0008BN-Qx; Fri, 29 Apr 2022 04:01:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1651219262; bh=fmYsWR4gCHK7zRhxZXK9jKci8jbiPYgwaryn3WBx6EE=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=UlU4oF8dC80sH42glc6WphlZuY7SLY+JIrDQfxoEXrnHW2e5CeW/mDaHiTt2BDFuP vhjzs8OPJGMm0/mgYBqhUSYpzsjLqbzzG4YHcaFj287AUwoR4uDG+WSDWtlEbwJgjk v0Nw0T9CJY7O2GuxGLQsT7rdLXd0CkTiUpTsuJeU= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from [192.168.1.12] ([90.126.108.10]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MnFy4-1oBkLa0o3Y-00j94T; Fri, 29 Apr 2022 10:01:02 +0200 Content-Language: en-US In-Reply-To: <87fsm4810z.fsf@yahoo.com> X-Provags-ID: V03:K1:DtygyF2/J3Mn0248ISWBNYFT4lEKOVHD2+1o4WKAz8ZdiUoIl/m Lglvh8vcvd1Ob0kgmuUpD2gIH1mHxF+X4MgbsTJHHQrlnwchb7dkzdAGjuZh6vh3BmVmXYl TpoIf/CJ/wJmx7CIeb1yRK4VBqAT6BlpCl426H2uPbnifaqJh74cPMHBLhb9EWyC/F/fcQ8 DypDvzOi8AKAGBYSnxanw== X-UI-Out-Filterresults: notjunk:1;V03:K0:RhUCXwODHac=:dK7kMS34B2Zxme67Z/+dcN bceaiWzyKbS+o5vqE5/qSUiKBspWvkVqJTym0OMaGD7nb8YaOtlJV2oSJPp0XtFeQ1+Az2y7s BMVnxTvfgXYF5hH6z7AjKLGILRgEy35wMVGn5WOCblUPcMYgJR5VpM17KkrEGghV2Pkf5Jsol J3/Y7pCVUAZSZHHhoFX06FJrKh4/5bsaeQ1HpuWah9Hq6W2Lj101IeCVwIcJPBfVhYd7bc8S3 aGqYqXSsOwCu//byMdJ7KPWvUkNftXyih35R3fyL7ZwGsDF9SHlAFPyw0bj/8XWtKhL3CiwAa vxVDZbPiIGrhSobIMwEoaInY8/0VbxLUjGGD2odp2Gu2YTMYUQn4jpiImzysWooNlJD6iGzTL B9yXoU1/SYNks5zuOY3PoGzrdOWjXbxHtSPpqXs82rQwB+dkjCFKNVbeZCkwD11aYbAGsTSsW s3bk6cJc4HW9nQiTQmqWVvlcZ214zZed9iyN2BFeAtB/v5ECQ8t8veOcrt2cQRFmRKINpgRt6 nP7DMd5mqX0gh5IJsRs9JGVLjavOWT5CyWPY0G55vYIqQOEmn9tYZEv45gCRSAYaCcTg34aus lWbtd4Gz/+wxNuVpHD41Gi46gEb1DNHkAFxjs+6s1MtNptxTjCoMROY0h3DYsnShaeQpR5CDv KCdTjVXIUD4Nu0L8DH4U72hfhy7IY1vOu5x2AQ0Ag8S6/UVD4bOnVrG6hX4CJsXPAY60qxOip zxcG5CG/Kp8LdtCj9Ysv3DTcP4YLDa3BjmX4K8dksHT/EusKi43w09jp8EUh2AimVxEsAsSo Received-SPF: pass client-ip=212.227.15.4; envelope-from=julius.pfrommer@web.de; helo=mout.web.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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:288965 Archived-At: > 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. 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. > 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. Agreed, there are differences. But every Cairo operation eventually translates to an API call on a cairo_t "glass". Some platforms already have a "scaling-factor" as part of their Cairo drawing. Most of these platform-dependent differences could be handled by a slim wrapper on top of a common drawing implementation. > 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. 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. Anyhow, instead of hypothesizing, I will try out a couple of approaches to see how/whether the overall complexity is reduced by pulling out common drawing operations on top of the cairo_t "glass". Regards, Julius