9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Elliott Hughes <elliott.hughes@genedata.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] new versions of graphics programs?
Date: Fri, 15 Sep 2000 08:47:52 +0000	[thread overview]
Message-ID: <39c1db14@news.core.genedata.com> (raw)
In-Reply-To: <20000915020412.AA23219A01@mail>

"Russ Cox" <rsc@plan9.bell-labs.com> wrote in message
news:20000915020412.AA23219A01@mail...
> I admit to not understanding the
> appeal of double-buffering, especially
> the claim that it is more efficient.

it's not really an efficiency thing, but it does help make your program look
more snappy. the usefulness of double-buffering is that you don't get caught
with your pants down: the user will never see a half-finished display. as
you say, there's more work to be done, but the point is that you're making
the deadline easier to meet. you don't have to synchronize yourself with the
screen refresh and you don't have to get your drawing done before the next
refresh.

the interesting question is where to do the double-buffering, at what
granularity. if you have a container, is it worth double-buffering each of
its sub-components separately if they're only going to be 'drawn' into the
double-buffered parent? is it worth working out whether you need
double-buffering on a particular repaint? do you end up deciding you may as
well have one buffer per top-level window and do all your drawing into that?

last time i looked at GTK+, which i admit was a while ago, it wasn't using
double-buffering, and it looked terrible. particularly with a window manager
supporting opaque reshaping (i.e. the window changes all the time, rather
than making you guess from a rubber-band outline whether it would now look
the way you want, were you to stop rubber-banding). i haven't seen such
flicker in a long time. it doesn't matter how efficient your repainting is,
you're almost certain to look spastic if you don't double-buffer.

> To me, it
> seems like a software solution to a
> hardware problem.

you can say that about anything. this trade-off is ever-present. but until
all hardware is able to remove the need for double-buffering,
double-buffering is very useful indeed.

double-buffering may seem a waste of time, but speaking as a pragmatist, i
know i wouldn't want to live without it. (nor even do it myself; i'd rather
have it done for me, as it is in Java.)

 - Elliott



  parent reply	other threads:[~2000-09-15  8:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-15  2:03 Russ Cox
2000-09-15  8:47 ` Douglas A. Gwyn
2000-09-15  8:47 ` Elliott Hughes [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-09-15  2:30 okamoto
2000-09-15  1:51 okamoto
2000-09-14  2:31 okamoto
2000-09-14  8:14 ` Douglas A. Gwyn
2000-09-13  5:55 okamoto
2000-09-13  3:32 okamoto
2000-09-13  3:19 okamoto
2000-09-13  2:58 Russ Cox
2000-09-13  2:55 okamoto
2000-09-13  2:51 okamoto
2000-09-13  1:28 okamoto
2000-09-12 13:33 Russ Cox
2000-09-12 10:01 okamoto
2000-09-08  4:34 okamoto
2000-09-07 21:57 rob pike
     [not found] ` <rob@plan9.bell-labs.com>
2000-09-07 22:18   ` Tom Duff
2000-09-07 22:50 ` Jim Choate
     [not found]   ` <ravage@einstein.ssz.com>
2000-09-07 22:35     ` Tom Duff
2000-09-07 23:24       ` Jim Choate
2000-09-08 15:28         ` please_no_spam_to_
     [not found]           ` <D.M.Pick@qmw.ac.uk>
2000-09-08 16:43             ` Tom Duff
2000-09-07 16:08 Anthony Sorace

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=39c1db14@news.core.genedata.com \
    --to=elliott.hughes@genedata.com \
    --cc=9fans@cse.psu.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).