Changeset 18635 in vbox
- Timestamp:
- Apr 2, 2009 12:51:16 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFrameBuffer.cpp
r18553 r18635 386 386 bool remind = false; 387 387 bool fallback = false; 388 ulong bitsPerLine = re->bytesPerLine() * 8; 388 389 389 390 /* check if we support the pixel format and can use the guest VRAM directly */ … … 413 414 if (!fallback) 414 415 { 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; 425 432 } 426 433 }
Note:
See TracChangeset
for help on using the changeset viewer.

