From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: Emacs Mac port Date: Wed, 17 Apr 2013 08:52:31 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <83ip3p72mz.fsf@gnu.org> <83d2tw73h7.fsf@gnu.org> <8361zo6um1.fsf@gnu.org> <8338us6oz9.fsf@gnu.org> <838v4j55si.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1366156372 12421 80.91.229.3 (16 Apr 2013 23:52:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Apr 2013 23:52:52 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 17 01:52:52 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1USFg6-00055V-9l for ged-emacs-devel@m.gmane.org; Wed, 17 Apr 2013 01:52:46 +0200 Original-Received: from localhost ([::1]:43708 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USFg5-000844-Qa for ged-emacs-devel@m.gmane.org; Tue, 16 Apr 2013 19:52:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USFg1-00083y-Su for emacs-devel@gnu.org; Tue, 16 Apr 2013 19:52:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USFfz-0001R4-N4 for emacs-devel@gnu.org; Tue, 16 Apr 2013 19:52:41 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:52305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USFfx-0001PX-9V; Tue, 16 Apr 2013 19:52:37 -0400 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 9F9C1C055D; Wed, 17 Apr 2013 08:52:31 +0900 (JST) In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 133.82.132.2 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:158962 Archived-At: >>>>> On Tue, 16 Apr 2013 09:20:15 -0400, Stefan Monnier said: >> That shows a typical reason why recent toolkits treat the "expose" >> handler as the primary drawing method. By freshly redrawing >> invalidated area in a rear-to-front way, it can provide some fancy >> appearances such as overlapped/translucent widgets in a correct way. > So IIUC, the "new normal" way you describe goes something like: > - redisplay builds glyph matrices from Lisp data and invalidates the > parts of the display that might need to be redrawn but does not draw. > - expose handlers use the glyph matrices to draw on the screen > when/where needed. > That makes a lot of sense. Yes. See also this post: http://lists.gnu.org/archive/html/emacs-devel/2010-07/msg00821.html (copied to the end of this mail.) Currently, I don't think it is practical to prohibit the actual drawing in redisplay time completely, at least in a short term, mainly because of the item 4 in the above post. But it makes sense to make expose_frame more efficient (and correct). YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp >>>>> On Thu, 15 Jul 2010 12:00:05 -0400, Chong Yidong said: > A more promising route is the one that Yamamoto Mitsuharu has > explored, mentioned earlier in this thread, which (IIUC) treats > Cairo as a graphical terminal to render onto, on the same footing as > the tty/X/Windows/NS terminals. Here, I can see a reasonable path > to real improvement. For example, it might allow us to use the GTK > printing infrastructure, which operates on Cairo contexts. If you > are interested in redisplay development, that is the direction I'd > suggest looking into. My proof-of-concept cairo port was primarily intended for the printing support, not for screen drawing (though it does both). http://lists.gnu.org/archive/html/emacs-devel/2009-04/msg00390.html Screen drawing in the cairo port is not so efficient for several reasons. To make it more efficient, one would need some modest modifications to the current drawing model in Emacs. 1. Don't draw during redisplay, but mark the updated area dirty so the upcoming exposure event can trigger the actual redraw for the area to be updated. 2. Restrict the actual drawings to those in response to exposure events. This is the standard way in GTK+ and Cocoa. That would make double-buffering straightforward in GTK+ builds. 3. Make expose_window etc. more efficient. For example, the foreground of same row might currently be redrawn three times for some cases in order to handle overlaps between rows with minimal flickering. This can be eliminated if double-buffering is introduced and whole the background is drawn at once and then whole the foreground is drawn afterwards. 4. Scrolling in redisplay (x_shift_glyphs_for_insert and x_scroll_run) might require special treatment because copied area might be marked dirty at the time of scrolling.