VirtualBox

Changeset 35266 in vbox


Ignore:
Timestamp:
Dec 20, 2010 9:00:44 PM (14 years ago)
Author:
vboxsync
Message:

Additions/x11/vboxvideo: clear video memory before resizing the virtual framebuffer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c

    r35207 r35266  
    5858#include "product-generated.h"
    5959#include <xf86.h>
     60#include <misc.h>
    6061
    6162/* All drivers initialising the SW cursor need this */
     
    12881289     * too large for VRAM as we sometimes have to do this - see comments in
    12891290     * VBOXPreInit. */
    1290     if (offStart + pVBox->cbLine * cHeight > pVBox->cbFramebuffer)
     1291    if (   offStart + pVBox->cbLine * cHeight > pVBox->cbFramebuffer
     1292        || pVBox->cbLine * pScrn->virtualY > pVBox->cbFramebuffer)
    12911293        fActive = FALSE;
    12921294    /* Deactivate the screen if it is outside of the virtual framebuffer and
     
    13271329    VBOXPtr pVBox = VBOXGetRec(pScrn);
    13281330    uint64_t cbLine = vboxLineLength(pScrn, width);
     1331    uint32_t cbOldPixmap;
    13291332
    13301333    TRACE_LOG("width=%d, height=%d\n", width, height);
     
    13441347                                pScrn->depth, vboxBPP(pScrn), cbLine,
    13451348                                pVBox->base);
     1349    cbOldPixmap = pVBox->cbLine * pScrn->virtualY;
     1350    if (cbOldPixmap > pVBox->cbFramebuffer)
     1351        cbOldPixmap = 0;
    13461352    pScrn->virtualX = width;
    13471353    pScrn->virtualY = height;
    13481354    pScrn->displayWidth = vboxDisplayPitch(pScrn, cbLine);
    13491355    pVBox->cbLine = cbLine;
     1356    /* Clear video RAM for esthetic reasons */
     1357    memset(pVBox->base, 0, max(cbLine * height, cbOldPixmap));
    13501358#ifdef VBOX_DRI
    13511359    if (pVBox->useDRI)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette