VirtualBox

Changeset 18635 in vbox


Ignore:
Timestamp:
Apr 2, 2009 12:51:16 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt: handle large virtual resolutions correctly in VBoxFrameBuffer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxFrameBuffer.cpp

    r18553 r18635  
    386386    bool remind = false;
    387387    bool fallback = false;
     388    ulong bitsPerLine = re->bytesPerLine() * 8;
    388389
    389390    /* check if we support the pixel format and can use the guest VRAM directly */
     
    413414        if (!fallback)
    414415        {
    415             /* QImage only supports 32-bit aligned scan lines */
    416             fallback = re->bytesPerLine() !=
    417                 ((mWdt * re->bitsPerPixel() + 31) / 32) * 4;
    418             Assert (!fallback);
    419             if (!fallback)
    420             {
    421                 mImg = QImage ((uchar *) re->VRAM(), mWdt, mHgt, format);
    422                 mPixelFormat = FramebufferPixelFormat_FOURCC_RGB;
    423                 mUsesGuestVRAM = true;
    424             }
     416            /* QImage only supports 32-bit aligned scan lines... */
     417            Assert ((re->bytesPerLine() & 3) == 0);
     418            fallback = ((re->bytesPerLine() & 3) != 0);
     419        }
     420        if (!fallback)
     421        {
     422            /* ...and the scan lines ought to be a whole number of pixels. */
     423            Assert ((bitsPerLine & (re->bitsPerPixel() - 1)) == 0);
     424            fallback = ((bitsPerLine & (re->bitsPerPixel() - 1)) != 0);
     425        }
     426        if (!fallback)
     427        {
     428            ulong virtWdt = bitsPerLine / re->bitsPerPixel();
     429            mImg = QImage ((uchar *) re->VRAM(), virtWdt, mHgt, format);
     430            mPixelFormat = FramebufferPixelFormat_FOURCC_RGB;
     431            mUsesGuestVRAM = true;
    425432        }
    426433    }
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