From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Gramiak Newsgroups: gmane.emacs.bugs Subject: bug#35468: [PATCH] Refactor draw_glyph_string on X and w32 Date: Sun, 28 Apr 2019 13:46:46 -0600 Message-ID: <87pnp5oqu1.fsf@gmail.com> References: <877ebeor2d.fsf@gmail.com> <83tveit5ph.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="176926"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: 35468@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 28 21:47:22 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 1hKplh-000jvF-Ur for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Apr 2019 21:47:22 +0200 Original-Received: from localhost ([127.0.0.1]:47834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKple-0000Ce-16 for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Apr 2019 15:47:18 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hKplX-0000CG-5x for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2019 15:47:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hKplU-00019z-Cl for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2019 15:47:10 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52531) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hKplO-00017G-Ag for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2019 15:47:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hKplO-00029m-5d for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2019 15:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Gramiak Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Apr 2019 19:47:02 +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.15564808148272 (code B ref 35468); Sun, 28 Apr 2019 19:47:02 +0000 Original-Received: (at 35468) by debbugs.gnu.org; 28 Apr 2019 19:46:54 +0000 Original-Received: from localhost ([127.0.0.1]:37842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hKplF-00029L-PL for submit@debbugs.gnu.org; Sun, 28 Apr 2019 15:46:54 -0400 Original-Received: from mail-pg1-f172.google.com ([209.85.215.172]:33098) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hKplD-000297-Bm for 35468@debbugs.gnu.org; Sun, 28 Apr 2019 15:46:51 -0400 Original-Received: by mail-pg1-f172.google.com with SMTP id k19so4141819pgh.0 for <35468@debbugs.gnu.org>; Sun, 28 Apr 2019 12:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=2TFJW3W/u+Z4Hb+A01WKvKy13Ypg36Aso/+c192xkjo=; b=cK7XTJxvWQbZvrPj9e/VjH6uN912DOAc64dkGoajBzwvh0i/03Ye241LvTSbjTrQqK YlLkiPTgdzTNfyqK3vgVQkPapGHujCD3m3ok4q3FJyXH81hSKbwY95NdmdrZJb1V9wBg 5bQgjLdToFkGkES0hFifHww9fYRqq22A68zp6rSVQUF97e/OIXEKNXfvKkZn1vxibAM6 nj95jAvrp8bJkpVogCe5XUEcYpWhEgcuO4yijOv13IDy4B0fp9Cg/tmJwNZhXnnnE+n+ 0NrpbZK5O/icBOr3ktDSXzJAq+Db4KcXkiJk0Qlabb5AN/pfxx7+BxNVx/k9m++EXTdq zn7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=2TFJW3W/u+Z4Hb+A01WKvKy13Ypg36Aso/+c192xkjo=; b=q+K+MFkerkMQzj5x1d7aFvsmp/ZWW/QO/uwFvVnC+8BT6DxRP2tI47PkhL+GN6O9rs Xh6QSZhaRhwEprN3oabgBCSBErYr9tBdYjOQghXWTn2RP4TABX+UQ3xpzzZRTErMD8Xb PZyYDPY/bqk13KR0o0rO/vImrF6ma/hvLbLB5qeAevRByo8vVF2pjUJzbZA/8tMr9L6Z tuDsYO7oFlZOgf9BhYNrNqnKGAjo2Fyw72rWqO3skCyX6ySo2Pz3xC5mZ59V5B2b9TnY PZZbeTqKpSo2kauX47wbLvt1C2Yrb5n+RT4/h5+637DTDwhKTD71t8ey9wuW/rQHZQwL 1CoA== X-Gm-Message-State: APjAAAU90RxS2ejWTlSfdduuNZYAIczRShcKNTxU6l0CQ/wG2nb5I9qA L3+xzgwWB5KHkIvJo9ePd0HfsvIK X-Google-Smtp-Source: APXvYqxL2W4oxxTRu/j/rABKLYsBZQtNE2JD+dDZejXcS+q8b4XSeBXgRuaTyrWeCrB29xWjDU8HsA== X-Received: by 2002:aa7:8e14:: with SMTP id c20mr27416773pfr.14.1556480805038; Sun, 28 Apr 2019 12:46:45 -0700 (PDT) Original-Received: from lylat ([2604:3d09:e37f:1500:1a72:4878:e793:7302]) by smtp.gmail.com with ESMTPSA id u62sm50587215pfa.124.2019.04.28.12.46.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Apr 2019 12:46:44 -0700 (PDT) In-Reply-To: <83tveit5ph.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 28 Apr 2019 20:11:54 +0300") 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:158403 Archived-At: Eli Zaretskii writes: >> From: Alex Gramiak >> Date: Sat, 27 Apr 2019 19:29:30 -0600 >> >> This merges x_draw_glyph_string and w32_draw_glyph_string together to >> remove duplicated code. >> >> I wanted to do it for NS as well, but it seems just a bit too different >> to make it easily work. > > If we don't include NS in this, we won't actually gain enough to > justify the reshuffle. I still think that removing duplication between 2 out of 3 is worth it considering the size of the removal, but I started to do this because I'm working on a new backend (GTK without depending on X) that would benefit from this refactoring. > What prevented you from including NS, it looks to me the code is very > similar? Mostly the differences in clipping behaviour that seemed just slightly incompatible with the way gui_draw_glyphs_string does it. I'll look at it a bit harder. It also doesn't have the two sections (the s->prev and s->next conditionals) at the end, which I'm not sure is a bug or unnecessary there. Those could just be surrounded by a (!FRAME_NS_P (s->f)) conditional though. >> +struct draw_glyph_string_interface > > I'd prefer draw_glyphs_interface, it's shorter. And given the > comments below, maybe the name should be gui_interface. draw_glyphs_interface doesn't seem bad, as long as glyph strings are the only types of glyphs that are drawn (otherwise draw_glyphs would be too broad). I think gui_interface is too broad of a description, since many of the terminal hooks and frame parameter handlers (setting GUI window properties, accessing color structures, setting WM hints, etc.) could also be considered as belonging to a GUI interface. Perhaps gui_drawing_interface or graphical_drawing_interface? > The result of this refactoring should be more low-level and more > primitive interfaces, and they should each one make sense, not be > ad-hoc. It means the job becomes more complex, and you will probably > need to ask questions regarding the GUI systems you are less familiar > with. But the result will IMO much better and future-proof. I'll see what I can do.