From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#47895: 28.0.50; Emacs should only animate images that are visible Date: Sun, 25 Apr 2021 21:07:48 +0200 Message-ID: <87bla2ji7v.fsf@gnus.org> References: <87r1j6m920.fsf@gnus.org> <8335vmrux2.fsf@gnu.org> <87mttum230.fsf@gnus.org> <83r1j5qd2x.fsf@gnu.org> <87v98ajj3k.fsf@gnus.org> <834kfukx2v.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23206"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 47895@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 25 21:09:15 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lak83-0005vZ-6z for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Apr 2021 21:09:15 +0200 Original-Received: from localhost ([::1]:52880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lak82-0003iw-At for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Apr 2021 15:09:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lak7q-0003id-57 for bug-gnu-emacs@gnu.org; Sun, 25 Apr 2021 15:09:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60535) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lak7p-0003pu-UR for bug-gnu-emacs@gnu.org; Sun, 25 Apr 2021 15:09:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lak7p-00070b-QU for bug-gnu-emacs@gnu.org; Sun, 25 Apr 2021 15:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Apr 2021 19:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47895 X-GNU-PR-Package: emacs Original-Received: via spool by 47895-submit@debbugs.gnu.org id=B47895.161937768726882 (code B ref 47895); Sun, 25 Apr 2021 19:09:01 +0000 Original-Received: (at 47895) by debbugs.gnu.org; 25 Apr 2021 19:08:07 +0000 Original-Received: from localhost ([127.0.0.1]:43848 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lak6w-0006zV-UL for submit@debbugs.gnu.org; Sun, 25 Apr 2021 15:08:07 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:38190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lak6u-0006z2-Tk for 47895@debbugs.gnu.org; Sun, 25 Apr 2021 15:08:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=NTiMXSxu6l4TVtRpkOsZtckw0mPOBH69kSn9eqyS6zQ=; b=UpxxMTPTK0qQiiCTH+prLd28zK OzBmWkymGRz/z/uDqdus/wGENgJsa/N0aqfAjd8dP5ZLS0mvaO3VrEs8TtVSJLzAdreiSBkH776Nn l2vUVohi7du7CbOY6HZIARnWMq/EGuSnhwjesu4OuQXRm8wXJOuJUeYiLv1pI8Jn1pVU=; Original-Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lak6f-0001HN-Ev; Sun, 25 Apr 2021 21:07:59 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEU1NimsbSbEmhh+ hYb////81lOLAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+UEGRMAB9LIFs4AAAGwSURBVDjLbVRRlsQg CIN6AbAXEE7QLve/2wbUvuns+uGoMQRCHSIlcnch+hmHGVF3FnYsAJAqgE6HOTZ+DHYseh4S55QM VeMCpAsJuY68OzAjKkINTLjesct7llzDJlGIKADVwd26e2VyIFSJsObBkAk4blJepYw/M/M9kAoO BqIm+gK6Idc+skSMHWwCUgdYVs4LEKSSxbNrGbOjkRzORusm1Y0dyssTpA4Gpv4BlGxS7HjSQqgS n8GteJshC+BMYimka51egx/GUmixAaHo5XMOPe973qiOtV6Zi7IqyjPdcu32KsAAJBsm9LIBDZ55 VtmC3jmXL6w8ATGFlw3oT+Wq7VqAnrNNZ2gBGSqwHhSpGtIiijM1spSW54Fq4t6Vr+JmVOKI8nH6 EXFtANT7IdAtdH3YBcraxxlXK5nlyuNfAwCd8rE9YfMngWsB8cS8Ekzgsy3r0QA6X/1SigQ+pTcD xTMF/R3LFv0HkJl7e/d+MvLprP22htJ7NFx3rCcJS0J2XL408GkE9W7Gf8TrwwTxi1JfE16uylfG Ws9Vqs5vkTwE73qfc2rg70H17dYv17c8bOqLIYAAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjEtMDQt MjVUMTk6MDA6MDcrMDA6MDCDhJcRAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIxLTA0LTI1VDE5OjAw OjA3KzAwOjAw8tkvrQAAAABJRU5ErkJggg== X-Now-Playing: Octo Octa's _Resonant Body_: "Ecstatic Beat" In-Reply-To: <834kfukx2v.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 25 Apr 2021 22:01:28 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:204913 Archived-At: Eli Zaretskii writes: >> Hm... No, even without the force-update, Emacs uses 100% CPU. > > Beware: changing that might make the timer run more frequently, so you > might see CPU usage soar even though Emacs does almost nothing. It's still updating at the same rate (25 times a second for the image in question). > We access a different frame of the GIF image, so that would mean > regenerating the pixmap for the image, no? It does, but why does that happen before redisplay has decided to display the image? >> I'd keep interpreting that the same -- that is, count down, even if the >> image isn't displayed. > > But then if and when the image becomes visible, it won't show the > animation, because it already reached the LIMIT. Right? Yes. I think that's fine -- you've asked for X repetitions, and you get X repetitions, whether it's shown or not. >> Or just compute the position on each iteration -- the image may change >> its position if more text is inserted, for instance. > > Sure, but even if the position doesn't change we currently cannot tell > if the image is visible. We have pos-visible-in-window-p, but that > needs a buffer position -- which is why I suggest to record that > position in the image. Sure. Could make it a marker, I guess. >> But I'm still wondering about why this doesn't just work >> "automatically" -- if we could handle this in the redisplay code, that >> would be more natural. > > Animation doesn't work in redisplay, it works in this code I pointed > to. The code just alters some elements in the image plist. It's unexpected that this should lead to Emacs doing a lot of work -- unless it's actually displaying the image. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no