Changeset 85864 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Aug 21, 2020 12:44:56 PM (4 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-info.cpp
r85858 r85864 1818 1818 if (cbPixel == 4) 1819 1819 { 1820 B ITMAPV4HEADER bh;1821 RT_ZERO( bh);1822 bh.bV4Size = sizeof(bh);1823 bh.bV4Width = w;1824 bh.bV4Height = -h;1825 bh.bV4Planes = 1; 1826 bh.bV4BitCount = 32;1827 bh.bV4V4Compression = BI_BITFIELDS;1828 bh.bV4SizeImage = cbBitmap;1829 bh.bV4XPelsPerMeter = 2835;1830 bh.bV4YPelsPerMeter = 2835;1831 // bh.bV4ClrUsed = 0;1832 // bh.bV4ClrImportant = 0;1833 bh.bV4RedMask = 0x00ff0000;1834 bh.bV4GreenMask = 0x0000ff00;1835 bh.bV4BlueMask = 0x000000ff;1836 bh.bV4AlphaMask = 0xff000000;1837 bh.bV4CSType = LCS_WINDOWS_COLOR_SPACE;1838 // bh.bV4Endpoints = {0};1839 // bh.bV4GammaRed =0;1840 // bh.bV4GammaGreen =0;1841 // bh.bV4GammaBlue = 0;1842 1843 BMPINFO bf;1844 RT_ZERO(bf);1845 bf.Type = BMP_HDR_MAGIC;1846 bf.FileSize = sizeof(bf) + sizeof(bh) + cbBitmap;1847 bf.Offset = sizeof(bf) + sizeof(bh);1848 1849 fwrite(& bf, 1, sizeof(bf), f);1850 fwrite(& bh, 1, sizeof(bh), f);1820 BMPFILEHDR fileHdr; 1821 RT_ZERO(fileHdr); 1822 fileHdr.uType = BMP_HDR_MAGIC; 1823 fileHdr.cbFileSize = sizeof(fileHdr) + sizeof(BITMAPV4HEADER) + cbBitmap; 1824 fileHdr.offBits = sizeof(fileHdr) + sizeof(BITMAPV4HEADER); 1825 1826 BITMAPV4HEADER hdrV4; 1827 RT_ZERO(hdrV4); 1828 hdrV4.bV4Size = sizeof(hdrV4); 1829 hdrV4.bV4Width = w; 1830 hdrV4.bV4Height = -h; 1831 hdrV4.bV4Planes = 1; 1832 hdrV4.bV4BitCount = 32; 1833 hdrV4.bV4V4Compression = BI_BITFIELDS; 1834 hdrV4.bV4SizeImage = cbBitmap; 1835 hdrV4.bV4XPelsPerMeter = 2835; 1836 hdrV4.bV4YPelsPerMeter = 2835; 1837 // hdrV4.bV4ClrUsed = 0; 1838 // hdrV4.bV4ClrImportant = 0; 1839 hdrV4.bV4RedMask = 0x00ff0000; 1840 hdrV4.bV4GreenMask = 0x0000ff00; 1841 hdrV4.bV4BlueMask = 0x000000ff; 1842 hdrV4.bV4AlphaMask = 0xff000000; 1843 hdrV4.bV4CSType = LCS_WINDOWS_COLOR_SPACE; 1844 // hdrV4.bV4Endpoints = {0}; 1845 // hdrV4.bV4GammaRed = 0; 1846 // hdrV4.bV4GammaGreen = 0; 1847 // hdrV4.bV4GammaBlue = 0; 1848 1849 fwrite(&fileHdr, 1, sizeof(fileHdr), f); 1850 fwrite(&hdrV4, 1, sizeof(hdrV4), f); 1851 1851 } 1852 1852 else 1853 1853 #endif 1854 1854 { 1855 BMP INFO bf;1856 RT_ZERO( bf);1857 bf.Type= BMP_HDR_MAGIC;1858 bf.FileSize = sizeof(BMPINFO) + sizeof(WINHDR) + cbBitmap;1859 bf.Offset = sizeof(BMPINFO) + sizeof(WINHDR);1860 1861 WINHDR bi;1862 RT_ZERO( bi);1863 bi.Size = sizeof(bi);1864 bi.Width= w;1865 bi.Height= -h;1866 bi.Planes= 1;1867 bi.BitCount= 32;1868 bi.SizeImage = cbBitmap;1869 1870 fwrite(& bf, 1, sizeof(bf), f);1871 fwrite(& bi, 1, sizeof(bi), f);1855 BMPFILEHDR fileHdr; 1856 RT_ZERO(fileHdr); 1857 fileHdr.uType = BMP_HDR_MAGIC; 1858 fileHdr.cbFileSize = sizeof(BMPFILEHDR) + sizeof(BMPWIN3XINFOHDR) + cbBitmap; 1859 fileHdr.offBits = sizeof(BMPFILEHDR) + sizeof(BMPWIN3XINFOHDR); 1860 1861 BMPWIN3XINFOHDR coreHdr; 1862 RT_ZERO(coreHdr); 1863 coreHdr.cbSize = sizeof(coreHdr); 1864 coreHdr.uWidth = w; 1865 coreHdr.uHeight = -h; 1866 coreHdr.cPlanes = 1; 1867 coreHdr.cBits = 32; 1868 coreHdr.cbSizeImage = cbBitmap; 1869 1870 fwrite(&fileHdr, 1, sizeof(fileHdr), f); 1871 fwrite(&coreHdr, 1, sizeof(coreHdr), f); 1872 1872 } 1873 1873 -
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r85863 r85864 3871 3871 * Get bitmap header data 3872 3872 */ 3873 PBMP INFO pBmpInfo = (PBMPINFO)(pThisCC->pbLogo + sizeof(LOGOHDR));3874 P WINHDR pWinHdr = (PWINHDR)(pThisCC->pbLogo + sizeof(LOGOHDR) + sizeof(BMPINFO));3875 3876 if (p BmpInfo->Type == BMP_HDR_MAGIC)3877 { 3878 switch (p WinHdr->Size)3873 PBMPFILEHDR pFileHdr = (PBMPFILEHDR)(pThisCC->pbLogo + sizeof(LOGOHDR)); 3874 PBMPWIN3XINFOHDR pCoreHdr = (PBMPWIN3XINFOHDR)(pThisCC->pbLogo + sizeof(LOGOHDR) + sizeof(BMPFILEHDR)); 3875 3876 if (pFileHdr->uType == BMP_HDR_MAGIC) 3877 { 3878 switch (pCoreHdr->cbSize) 3879 3879 { 3880 case BMP_H EADER_OS21:3880 case BMP_HDR_SIZE_OS21: 3881 3881 { 3882 P OS2HDR pOs2Hdr = (POS2HDR)pWinHdr;3883 pThisCC->cxLogo = pOs2Hdr-> Width;3884 pThisCC->cyLogo = pOs2Hdr-> Height;3885 pThisCC->cLogoPlanes = pOs2Hdr-> Planes;3886 pThisCC->cLogoBits = pOs2Hdr-> BitCount;3887 pThisCC->LogoCompression = BMP_COMPRESS _NONE;3882 PBMPOS2COREHDR pOs2Hdr = (PBMPOS2COREHDR)pCoreHdr; 3883 pThisCC->cxLogo = pOs2Hdr->uWidth; 3884 pThisCC->cyLogo = pOs2Hdr->uHeight; 3885 pThisCC->cLogoPlanes = pOs2Hdr->cPlanes; 3886 pThisCC->cLogoBits = pOs2Hdr->cBits; 3887 pThisCC->LogoCompression = BMP_COMPRESSION_TYPE_NONE; 3888 3888 pThisCC->cLogoUsedColors = 0; 3889 3889 break; 3890 3890 } 3891 3891 3892 case BMP_H EADER_OS22:3892 case BMP_HDR_SIZE_OS22: 3893 3893 { 3894 P OS22HDR pOs22Hdr = (POS22HDR)pWinHdr;3895 pThisCC->cxLogo = pOs22Hdr-> Width;3896 pThisCC->cyLogo = pOs22Hdr-> Height;3897 pThisCC->cLogoPlanes = pOs22Hdr-> Planes;3898 pThisCC->cLogoBits = pOs22Hdr-> BitCount;3899 pThisCC->LogoCompression = pOs22Hdr-> Compression;3900 pThisCC->cLogoUsedColors = pOs22Hdr-> ClrUsed;3894 PBMPOS2COREHDR2 pOs22Hdr = (PBMPOS2COREHDR2)pCoreHdr; 3895 pThisCC->cxLogo = pOs22Hdr->uWidth; 3896 pThisCC->cyLogo = pOs22Hdr->uHeight; 3897 pThisCC->cLogoPlanes = pOs22Hdr->cPlanes; 3898 pThisCC->cLogoBits = pOs22Hdr->cBits; 3899 pThisCC->LogoCompression = pOs22Hdr->enmCompression; 3900 pThisCC->cLogoUsedColors = pOs22Hdr->cClrUsed; 3901 3901 break; 3902 3902 } 3903 3903 3904 case BMP_H EADER_WIN3:3905 pThisCC->cxLogo = p WinHdr->Width;3906 pThisCC->cyLogo = p WinHdr->Height;3907 pThisCC->cLogoPlanes = p WinHdr->Planes;3908 pThisCC->cLogoBits = p WinHdr->BitCount;3909 pThisCC->LogoCompression = p WinHdr->Compression;3910 pThisCC->cLogoUsedColors = p WinHdr->ClrUsed;3904 case BMP_HDR_SIZE_WIN3X: 3905 pThisCC->cxLogo = pCoreHdr->uWidth; 3906 pThisCC->cyLogo = pCoreHdr->uHeight; 3907 pThisCC->cLogoPlanes = pCoreHdr->cPlanes; 3908 pThisCC->cLogoBits = pCoreHdr->cBits; 3909 pThisCC->LogoCompression = pCoreHdr->enmCompression; 3910 pThisCC->cLogoUsedColors = pCoreHdr->cClrUsed; 3911 3911 break; 3912 3912 3913 3913 default: 3914 AssertLogRelMsgFailedReturn(("Unsupported bitmap header size %u.\n", p WinHdr->Size),3914 AssertLogRelMsgFailedReturn(("Unsupported bitmap header size %u.\n", pCoreHdr->cbSize), 3915 3915 VERR_INVALID_PARAMETER); 3916 3916 break; … … 3933 3933 VERR_INVALID_PARAMETER); 3934 3934 3935 AssertLogRelMsgReturn(pThisCC->LogoCompression == BMP_COMPRESS _NONE,3935 AssertLogRelMsgReturn(pThisCC->LogoCompression == BMP_COMPRESSION_TYPE_NONE, 3936 3936 ("Unsupported %u compression.\n", pThisCC->LogoCompression), 3937 3937 VERR_INVALID_PARAMETER); … … 3947 3947 if (pThisCC->cLogoPalEntries) 3948 3948 { 3949 const uint8_t *pbPal = pThisCC->pbLogo + sizeof(LOGOHDR) + sizeof(BMP INFO) + pWinHdr->Size; /* ASSUMES Size location (safe) */3949 const uint8_t *pbPal = pThisCC->pbLogo + sizeof(LOGOHDR) + sizeof(BMPFILEHDR) + pCoreHdr->cbSize; /* ASSUMES Size location (safe) */ 3950 3950 3951 3951 for (uint16_t i = 0; i < pThisCC->cLogoPalEntries; i++) … … 3969 3969 * Bitmap data offset 3970 3970 */ 3971 pThisCC->pbLogoBitmap = pThisCC->pbLogo + sizeof(LOGOHDR) + p BmpInfo->Offset;3971 pThisCC->pbLogoBitmap = pThisCC->pbLogo + sizeof(LOGOHDR) + pFileHdr->offBits; 3972 3972 } 3973 3973 else
Note:
See TracChangeset
for help on using the changeset viewer.