[racket-dev] Universe double buffering

From: Nadeem Abdul Hamid (nadeem at acm.org)
Date: Thu Sep 2 10:10:34 EDT 2010

It still behaves the same. I can literally capture a screenshot of the
canvas at any point where only a portion of the pictures have been
drawn on it.


On Thu, Sep 2, 2010 at 9:53 AM, Robby Findler
<robby at eecs.northwestern.edu> wrote:
> What happens if you restart drracket and try the same program again?
> (If the double buffering appears to come back I think I know what
> happened.)
>
> Robby
>
> On Thu, Sep 2, 2010 at 8:15 AM, Nadeem Abdul Hamid <nadeem at acm.org> wrote:
>>> Why do you think it doesn't?
>>
>> (I'm assuming you mean: "What makes me think that it is not
>> double-buffering?") ...
>>
>> I have a list of 15 thumbnail images of people and a function that
>> places pairs of them side by side, using above/beside to create a 133
>> x 581 image. i.e.
>>   choose-and-show-pairs : (listof image) -> image
>>
>> Now, when I do:
>> (big-bang PIC-LIST
>>          (on-draw choose-and-show-pairs))
>>
>> I see each individual image getting laid out, one by one, rather
>> excrutiatingly slowly. The choose-and-show-pairs actually randomizes
>> the pairing up, and so if I move the mouse over the canvas, apparently
>> the redraw handler is called, so I see a new set of pairs getting laid
>> out, very slowly.
>>
>> I would have expected a double-buffered implementation to lay out the
>> images in memory on some bitmap buffer and then quickly transfer the
>> bitmap buffer to the canvas, so you don't actually witness the effect
>> of all the above/beside operations happening.
>>
>>
>>>
>>>
>>>
>>>
>>> On Sep 2, 2010, at 8:52 AM, Nadeem Abdul Hamid wrote:
>>>
>>>> Why doesn't 2htdp/universe use double-buffering?
>>>>
>>>> --- nadeem
>>>> _________________________________________________


Posted on the dev mailing list.