From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#35468: [PATCH] Refactor draw_glyph_string on X and w32 Date: Sun, 05 May 2019 05:34:56 +0300 Message-ID: <838svlljcf.fsf@gnu.org> References: <877ebeor2d.fsf@gmail.com> <83tveit5ph.fsf@gnu.org> <87pnp5oqu1.fsf@gmail.com> <877ebcogg4.fsf@gmail.com> <83sgu0rsue.fsf@gnu.org> <8736lznzjf.fsf@gmail.com> <83zho6ox5u.fsf@gnu.org> <878svomynv.fsf@gmail.com> <838svmmy5q.fsf@gnu.org> <87pnoyj9wh.fsf@gmail.com> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="221863"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 35468@debbugs.gnu.org To: Alex Gramiak Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 05 04:36:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hN70e-000vZA-3D for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 May 2019 04:36:12 +0200 Original-Received: from localhost ([127.0.0.1]:35417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hN70c-0002rr-UD for geb-bug-gnu-emacs@m.gmane.org; Sat, 04 May 2019 22:36:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:32961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hN70V-0002rl-N2 for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 22:36:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hN70U-0007IL-SZ for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 22:36:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39201) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hN70U-0007IB-PD for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 22:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hN70T-0004gL-Q0 for bug-gnu-emacs@gnu.org; Sat, 04 May 2019 22:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 May 2019 02:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35468 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35468-submit@debbugs.gnu.org id=B35468.155702372617948 (code B ref 35468); Sun, 05 May 2019 02:36:01 +0000 Original-Received: (at 35468) by debbugs.gnu.org; 5 May 2019 02:35:26 +0000 Original-Received: from localhost ([127.0.0.1]:52745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hN6zt-0004fQ-Rh for submit@debbugs.gnu.org; Sat, 04 May 2019 22:35:26 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hN6zs-0004fD-3C for 35468@debbugs.gnu.org; Sat, 04 May 2019 22:35:24 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39237) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hN6zk-0006uz-On; Sat, 04 May 2019 22:35:17 -0400 Original-Received: from [176.228.60.248] (port=4410 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hN6zi-0003nN-Eg; Sat, 04 May 2019 22:35:16 -0400 In-reply-to: <87pnoyj9wh.fsf@gmail.com> (message from Alex Gramiak on Sat, 04 May 2019 13:29:34 -0600) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158772 Archived-At: > From: Alex Gramiak > Cc: 35468@debbugs.gnu.org, mituharu@math.s.chiba-u.ac.jp > Date: Sat, 04 May 2019 13:29:34 -0600 > > > The way I wrote it was confusing: by the 'draw' method I actually > > meant the external APIs called by the 'draw' method, like > > XftDrawGlyphs. Compare that with w32's ExtTextOutW in w32font_draw. > > Ah, I see. I'll keep the setter and rename it to, say, > set_device_context_font. "Device context" is a w32-specific concept, I wouldn't propagate it into an abstraction. set_font sounds much better to me. > > I don't think I understand the difficulties, sorry. Why is > > s->img->mask a problem? > > I meant problem as in that it's "leaking" the internals a bit. Yes, but where and why do you need to leak it? > > What details does glyph_has_image hide? Is that just to test > > s->img->pixmap? > > On most platforms, yes, but the Cairo drawing uses s->img->cr_data > instead. A macro should do here, there's no need for an interface, IMO. > >> if (!gdif->glyph_image_uses_mask (s)) > > > > And what does glyph_image_uses_mask hide? AFAIU, the current code > > simply looks at s->img->mask, and if so, why do we need an interface > > for that? > > I was thinking that since AFAIU the Cairo drawing doesn't set > s->img->mask it wouldn't make sense, from an interface POV, to check it > directly. I suppose it doesn't really matter in that case, and it would > be faster to just check s->img->mask even if the backend doesn't use it. Yes, I think so.