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: Text shadows Date: Sun, 12 Mar 2023 18:33:38 +0800 Message-ID: <87ttyqb6nx.fsf@yahoo.com> References: <72650A07-DEC8-4E08-A524-5C7AF804F3CB@gmail.com> <83mt4iv3xa.fsf@gnu.org> <87356acq6a.fsf@yahoo.com> <795E6DF6-EC17-4E68-B8A7-A99E81B072C7@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26542"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Kai Ma Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 12 11:34:39 2023 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 1pbJ2F-0006fn-5K for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Mar 2023 11:34:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbJ1X-0005Gs-Q6; Sun, 12 Mar 2023 06:33:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pbJ1W-0005Gk-Jc for emacs-devel@gnu.org; Sun, 12 Mar 2023 06:33:54 -0400 Original-Received: from sonic314-20.consmr.mail.ne1.yahoo.com ([66.163.189.146]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pbJ1U-0006no-Tn for emacs-devel@gnu.org; Sun, 12 Mar 2023 06:33:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678617228; bh=/EPTUHfG4Z2QHbTlokF4jiWeoHgEkdV17ByeN8nD1tI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=ZF8hWnVgba5f2spmuNC6xndEVd1fLny9i4E+2Jez3j8KYZulntP7bqSjXB3xYbqVN4xPaBPB8iBAOz62tL+TwR/99eTHC/dd/Ykocfjrg4WokghcxHT9z0nVQzjO0cjAjOKxh2+Ee826IhKgYMO+1LDftk0nQ/gkdug2QVxJn4M90aY8wpc78UkYYoK76mSXMEtSvvAIqicyzka0zGUgV4tMX6JxjJMwKtXK/n/+O7liOVoHXZ23kNYO1StJKn5oilVCpUSwLsBSO8YqC60ewcVgU1F+QbrlISTr9VKU5BCJwXRnThPU2v54HK9gnEEtnIsmis9lrkujAqI2TX8Pzg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678617228; bh=IwdP13HY4VzRj+jkywPAWLlMiue+Eyv/ug6zIT8wo5n=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=SimbPMZ6zkXwxiQEV4onrRrDAtF1jEvEvtmGbNuZKAkLUeereR7zD2kvi9/UODwKApqSlXipuNSvG2sfJsViX1dB/q2HH+WFh+Egne5ErYTgEBs50PjYVmV28mSIu2YSkIVR2ens2NYHGS5OMGdD3J/BPmfIC7fbSwZPE/wEKDI3o2Rceujx5xuBtpFZBrQLqJsVmV88gdsbqryZLIH+BBzpfMGIu70VGVzWdI7f28ZTo/ilRP6ez8nZf1dRfOpvYXmc/CpGACSKlEqeUHQ57o5fs3ZvBa2OLfdcZqHEXMPIMTsXMirnHNgvLzd9jW1ofLqlPOSIVRqbvNrQAAAfFA== X-YMail-OSG: gdWF.oYVM1lhGlu9bFVqriII56yFXX4pWPbmc5rIkcBA7lNOksM7LW2EFEjjWUg 4_OFFWNV8yji7PXL9zCgNvkBxchCgxca28fd2isoXRCSeba2Grl_REONa.xz3kFSzkxRUqj9LWBW ZxIxpG5nK1x4LJPZUhLCA.eRUjvLIrIMrqOtqIkvAT0xLSUfbcDMIaAwZkWDD645WfZ9ynkU1KIs GVE_VpCKe_De4vQEf2sk_L8cwS85CcOOOWT2wF54Zvc6wrPaR1pQnmq1lXTKhhfh4nZg8AfGByIi AEs2qsxHdWfRnR4P6J0mhSNOXRmFLtt0J_T8b3R2LWlgjTIbKhPKH1SSfcYTdvjOuWdpkwKencBB QhbjRA7fiyh3gVxGlvobB2.6RhA8SvMh2hn0o29iqytXY6Efs._F.dDTPI7UBdEuotcoARxRLOzf okd8diXPF.IlRxXYxQZf8aHDG_sphNXrE5PCs.8f2wz4jZnkIHFaAXoOHa5P8cVkuHG5A2iwSrha 7XhHuOK5F3hcDmKNx7JISOJdIc3vGB4mrpMYlCOX1JfSvPqR7w8s3UgaWMMnlXICgQZ9NSWd4RRw mOgIk6QOr4uicXo2eLkXXIEuRaObNIDRlpQJFetYkUQJgRpB9oNvR3XJv2VwXOn5lXQX__EF9p86 mmRBr7Mi1LNMwAaQpaNuG0LLN35ObTh86sxJ5JXm0L8Vm8Masg95f5a_7cDUtrjT8P6VjcevcRun ttv39dxk15LaKiSikabU4IIPneDPYJYXnloMNPcAC4McnrLkmnlyaZ1oOqgE_Os62g9NQR0iGXhh a5ggnOAbVKv92yAacCHxL0JiUt263xc.rXCGfC1ohW X-Sonic-MF: X-Sonic-ID: eef23254-3159-4fc3-89c4-1e68946e4904 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Sun, 12 Mar 2023 10:33:48 +0000 Original-Received: by hermes--production-sg3-67c57bccff-l2hjz (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 034041342918760b11be6a844690bf25; Sun, 12 Mar 2023 10:33:43 +0000 (UTC) In-Reply-To: <795E6DF6-EC17-4E68-B8A7-A99E81B072C7@gmail.com> (Kai Ma's message of "Sun, 12 Mar 2023 17:23:40 +0800") X-Mailer: WebService/1.1.21284 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 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304360 Archived-At: Kai Ma writes: > On Mar 12, 2023, at 16:46, Po Lu wrote: > > Theoretically, nothing. I targeted Cairo because (I think) it is the mo= st popular option on GNU/Linux. > > Speaking of this specific implementation, gaussian_blur() relies on a sp= ecific Cairo image format ARGB32, (this assumption could be > easily removed), and then it is used by ftcrfont_draw() to generate shad= ows. > > I don=E2=80=99t know whether non-Cairo builds (non-cairo X, win32) can/s= hould use gaussian_blur() though, since I=E2=80=99m not familiar with them. > > Non-Cairo builds and Cairo builds alike should use the X Rendering > Extension, where an arbitrary blur kernel is a standard picture filter. > Cairo builds on X should as well. > > I agree XRender should be used for non-Cairo X builds (when XRender is av= ailable). You can create a scratch Cairo surface backed by the drawable and suitable picture format. Temporary drawable and GC allocation is usually very fast in X servers descending from the MIT sample server because they internally use many different kinds of ``scratch pixmaps'' and ``scratch GCs'', but if you worry about this kind of thing you can reuse the surface if you want too. Then, place a filter on that surface's picture and composite its contents to FRAME_X_PICTURE (f). Any code which involves Emacs writing to memory is unacceptable under X. The reason is that the shared memory extension is not always available, and is slower.