9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Theo Honohan <theoh@chiark.greenend.org.uk>
To: 9fans@cse.psu.edu
Cc: theoh@chiark.greenend.org.uk
Subject: [9fans] Re: moving things in a window
Date: Tue, 26 Sep 2000 18:00:14 +0100	[thread overview]
Message-ID: <E13dy5X-0002Zc-00@chiark.greenend.org.uk> (raw)

Kenji Arisawa wrote:
> 
> Russ's usage of mask image is interesting, however the difficult point 
> to apply this mask image to rubber-banding I met was:
> 
> imgmask = allocimage(display, Rect(-Msize-2, -Msize-2, Msize+2, Msize+2),
>                      GREY1, 0, DWhite);
> 
> where Msize is pre-defined as 100.  ^_^

Yes.  I *think* Russ's technique is roughly equivalent to

dst = ((opaque(white,1) held out by ball) in mask) over dst
dst = (ball in mask) over dst

("mask" here isn't the same as Russ's mask; it might the same mask as
used for everything else in that window)

Where "dst" starts off being whatever happens to be behind the ball;
with a "general" ball, say with transparency, you'll have to redraw
any parts of the background that were covered in the previous frame
(or touched by previous drawing operations for this frame), so the
first operation is actually

dst = ((background held out by ball) in mask) over dst

When Russ adds support for other operators to gendraw(), it will get a
lot easier to express things like this. we'll be able to just say
things "background held out by ball", with clipping set appropriately
for efficiency.


Maintaining "background" is easy enough, but if you repeat the above
operations for a stack of moving layers, then you'll usually end up
painting some pixels more than once.  To avoid flickering, you would
need to composite all of your layers together before doing the two
steps above, just once, with "ball" standing for the composition of
all the layers apart from the background.

I think that's a clumsy description of one of the non-hardware related
reasons for double-buffering; if your program thinks in terms of
discrete frames, you must display only finished frames, or the display
will be "wrong" some of the time.  An unfinished raster scan (at the
video level) or an unfinished display list (entirely in software) just
result in different artifacts.

Theo



             reply	other threads:[~2000-09-26 17:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-26 17:00 Theo Honohan [this message]
2000-09-26 17:15 ` andrey mirtchovski
2000-09-26 18:00   ` Theo Honohan
2000-09-28 10:18   ` Douglas A. Gwyn
2000-09-28 11:28     ` Theo Honohan
2000-09-29  8:31       ` Douglas A. Gwyn
2000-09-27  0:08 okamoto
2000-09-27  0:19 ` Theo Honohan
2000-09-27  0:17 okamoto
2000-09-27  0:30 okamoto
2000-09-27  0:35 rob pike
2000-09-27  6:27 okamoto
2000-09-29 12:35 Russ Cox
2000-10-02  9:00 ` Douglas A. Gwyn

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=E13dy5X-0002Zc-00@chiark.greenend.org.uk \
    --to=theoh@chiark.greenend.org.uk \
    --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).