Listing 1. Code from nv_shadow.c

void
NVRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
{
       NVPtr pNv = NVPTR(pScrn);
       int width, height, Bpp, FBPitch;
       unsigned char *src, *dst;
       Bpp = pScrn->bitsPerPixel >> 3;
       FBPitch = BitmapBytePad(pScrn->displayWidth * pScrn->bitsPerPixel);
       while(num--) {
          width = (pbox->x2 - pbox->x1) * Bpp;
          height = pbox->y2 - pbox->y1;
          src = pNv->ShadowPtr +
               (pbox->y1 * pNv->ShadowPitch) +
               (pbox->x1 * Bpp);
          dst = pNv->FbStart + (pbox->y1 * FBPitch) + (pbox->x1 * Bpp);
          while(height--) {
            memcpy(dst, src, width);
            dst += FBPitch;
            src += pNv->ShadowPitch;
          }
       pbox++;
    }
}