From: Po Lu <luangruo@yahoo.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Ken Brown <kbrown@cornell.edu>, emacs-devel@gnu.org
Subject: Re: MS Windows double buffering
Date: Sat, 30 Apr 2022 15:46:43 +0800 [thread overview]
Message-ID: <87v8urt3mk.fsf@yahoo.com> (raw)
In-Reply-To: <835ymr9i9v.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 30 Apr 2022 09:50:36 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
> However, I don't understand why you went ahead without waiting for the
> review of the patches you posted. What's the rush? The result can be
> only one: the changeset is spread on a larger set of commits, and
> makes it harder to understand what changed and why, when later these
> questions are asked.
>
> Please don't act as if we are under some time pressure when we really
> aren't.
I will keep that in mind in the future, sorry.
> The old_value argument is unused, which should at least be mentioned,
> if not marked with an explicit "unused" attribute.
>
> Also, this function is a frame redisplay-interface method, so it
> should have a comment describing its functionality.
I will write one, thanks.
> These two functions should do nothing and return immediately if
> double-buffering is disabled. They currently will try to enter the
> critical section before returning, which is an unnecessary slowdown.
> At least w32_release_paint_buffer is called also when double-buffering
> is disabled, AFAIU, so it should return immediately in that case.
w32_release_paint_buffer releases the back buffer bitmap when a back
buffer exists. It is only called if double buffering is enabled, or
when double buffering is being turned off, or during frame resize (to
resize the back buffer bitmap.) But w32_show_back_buffer should indeed
work that way, yes.
> Here and elsewhere in the modified code, I'd like to have all the
> changes that affect the no-double-buffering code to be conditioned on
> some variable exposed to Lisp. That way, if and when someone reports
> a problem that could be related to this feature, we could easily get
> back to exactly the old code as it was before the changeset, and see
> if the problem is indeed due to this change. For example, entering
> the critical section above is one such change.
Thanks. That's not something we do on X, but I will add such a
variable.
> This function, which is an important part of redisplay, was basically
> rewritten from scratch. As explained above, please add back the
> deleted old code, conditioned under the variable I described there, so
> that we could test whether the new code is responsible for some
> problem that users may report.
[...]
> There should be a comment here explaining why we return in that case.
Likewise, I will do that.
> I don't understand why you enter the critical section here:
> w32_show_back_buffer does that internally, and the old code didn't
> need that.
`paint_buffer' can only be accessed safely inside the critical section,
as long as get_frame_dc can be called from the message pump thread, but
maybe it isn't called there.
> This is not clean, since it references a WM_ message in a place other
> than where its main processing happens. Please change it so
> processing of WM_WINDOWPOSCHANGED raises some flag (which is otherwise
> always false), and have this code here test that flag.
Will do, thanks.
> This looks like whitespace change? Or did I miss something?
Sorry for that, it snuck in somehow.
> And two more general issues:
>
> . w32term.c is also used in the Cygwin w32 build, (which produces a
> Cygwin Emacs that uses the native MS-Windows GUI functions instead
> of X). Will this code work in that build? If not, the new code
> should be ifdef'ed away on Cygwin. Ken, can you please chime in
> and help us DTRT here?
No idea, though I don't think double buffering uses anything that might
not work on Cygwin.
> . how does one test this feature? I rarely see any flickering on
> MS-Windows, so what should I try to see the effect of double
> buffering in action?
Emacs should flicker much less (or not at all) upon any of the test
cases in the last thread(s) on flicker, or when you run this:
(while t (redraw-display) (redisplay))
Thanks.
next prev parent reply other threads:[~2022-04-30 7:46 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <877d791thh.fsf.ref@yahoo.com>
2022-04-28 8:51 ` MS Windows double buffering Po Lu
2022-04-28 9:42 ` Eli Zaretskii
2022-04-28 12:45 ` Po Lu
2022-04-29 3:36 ` Po Lu
2022-04-30 5:41 ` Po Lu
2022-04-30 6:50 ` Eli Zaretskii
2022-04-30 7:46 ` Po Lu [this message]
2022-04-30 9:10 ` Eli Zaretskii
2022-04-30 9:55 ` Po Lu
2022-04-30 10:23 ` Eli Zaretskii
2022-04-30 10:33 ` Po Lu
2022-04-30 10:55 ` Eli Zaretskii
2022-04-30 11:01 ` Po Lu
2022-04-30 11:32 ` Eli Zaretskii
2022-04-30 11:54 ` Po Lu
2022-05-03 8:23 ` Robert Pluim
2022-05-03 8:43 ` Po Lu
2022-04-30 17:34 ` Ken Brown
2022-04-30 18:25 ` Eli Zaretskii
2022-05-01 0:35 ` Po Lu
2022-05-01 16:00 ` Arash Esbati
2022-05-01 16:07 ` Eli Zaretskii
2022-05-01 16:11 ` Arash Esbati
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v8urt3mk.fsf@yahoo.com \
--to=luangruo@yahoo.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=kbrown@cornell.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.