Posts Tagged ‘buffering’

Double Buffering

Computer Graphics Double Buffering

In Computer Graphics, double buffering is a technique for drawing graphics that shows no flicker/tearing, etc.

To update a page of text, it is much easier to clear the entire page and then draw the letter than to somehow erase all the pixels that are not in both the old and new letters. However, this intermediate image is seen by the user as flickering. In addition, computer monitor redraw the visible video page, so even a perfect update should be visible momentarily as a horizontal divider between the new image and the old image, known as tearing.

A software implementation of double buffering has all drawing operations store their results in some region of system RAM.and such region is called a back buffer.

When all drawing operations are considered complete, the whole region is copied into the video RAM(called front buffer).

This copying is usually synchronized with the monitor’s raster beam in order to avoid tearing. Double buffering necessarily requires more video memory and CPU times

for the date copying.

Page Flipping

Instead of copying the data, both buffers are capable of being displayed(both allocated in Video RAM). At any one time, one buffer is being displayed and the other is being drawn.

When drawing is completed, the roles of the two buffer are switched.

Page flipping is much faster than copying the data and can guarantee that tearing will not be seen as long as the pages flipping during the monitor’s vertical blank period when no video data

is being drawn. The currently active buffer is called front buffer and the background page is called the back buffer.

Read Full Post »